VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: sandomatyas on April 01, 2022, 16:26:46 PM

Title: Set different product price per currency
Post by: sandomatyas on April 01, 2022, 16:26:46 PM
Is it possible to use exact product prices per currency instead of currency rates?
Like there is a shop which accepts 2 currencies: USD and EUR.
For now I can use the automatic rates or set manual rates but the customer wants to set  specific price in USD and an other specific price in EUR
Is it possible to do that in VM?
Title: Re: Set different product price per currency
Post by: sandomatyas on April 01, 2022, 16:49:13 PM
or the second option:
"nice rounding" -> after the currency conversion rond up the price to the next .5 or .9
Like
€10 -> conversion -> $11.03 -> nice rounding -> $11.5
€18 -> conversion -> $19.85 -> nice rounding -> $19.9

maybe a calculation plugin?
Title: Re: Set different product price per currency
Post by: sandomatyas on April 12, 2022, 13:49:30 PM
Seems it is not possible with VM?
Title: Re: Set different product price per currency
Post by: Jörgen on April 12, 2022, 14:15:39 PM
Yes it is possible with a calculation plugin.  Probably even possible with a vmcustom plugin. Text input plugin modifies the sales price, might be worth checking out.

Jörgen
Title: Re: Set different product price per currency
Post by: sandomatyas on April 19, 2022, 16:48:03 PM
Quote from: Jörgen on April 12, 2022, 14:15:39 PM
Yes it is possible with a calculation plugin.  Probably even possible with a vmcustom plugin. Text input plugin modifies the sales price, might be worth checking out.

Jörgen

Hi Jörgen

Thanks for your reply.
I've already checked the textinput vmcustom plugin but it does work via plgVmPrepareCartProduct method and doesn't change the product price but the cart element's price. Also it does work with $modificatorSum instead of the price itself.

Also checked the vmcalculation plugin. Created a new math op via plgVmAddMathOp and implemented it in plgVmInterpreteMathOp. Here I can modify the price but only _before_ the currency convert so when the price is uses the vendor's currency. I didn't find any documentation or trigger how should I modify the price after the currency conversion. Or set different prices per currency.
Any hint?