VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: Osearcaigh on October 24, 2017, 08:08:57 AM

Title: Product link to price in non-default currency [Solved]
Post by: Osearcaigh on October 24, 2017, 08:08:57 AM
Joomla 3.8.1
Virtuemart 3.2.4

Is it possible to create a product page link where the product price is shown in another currency? For example, where the default currency is EUR, and we want to send a link to the product in USD can we generate a link along the lines of:

index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=1&currency=USD





Title: Re: Product link to price in non-default currency
Post by: Ghost on October 24, 2017, 10:11:03 AM
Yes, use virtuemart_currency_id parameter.
Title: Re: Product link to price in non-default currency
Post by: Osearcaigh on October 25, 2017, 12:57:46 PM
Thank you for your answer. It makes sense. I could not see it working in my case though. My base currency is EUR (ID 978) I expected:

index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=1&virtuemart_currency_id=554 to show me the product in NZD, which is configured with an exchange rate and is on the list of vendor accepted currencies. On the list of prices, sales price, tax etc etc, it showed by nothing from any of them. When I manually navigate to this product and select NZD from the currency selector, it works as expected but not via the direct link.

Can you think of anything else I should check, change or look at?


Title: Re: Product link to price in non-default currency
Post by: Ghost on October 25, 2017, 13:17:11 PM
You need to use ID, not currency code.

ID is not shown on currency page but you can see it in the URL when editing currency, for example: /administrator/index.php?option=com_virtuemart&view=currency&task=edit&cid[]=107. In this case ID is 107.
Title: Re: Product link to price in non-default currency
Post by: Osearcaigh on October 25, 2017, 14:10:49 PM
Perfect, thank you for your help Ghost. That works exactly as expected.

For anyone else reading, the codes for each of the currencies I happen to be using are:

USD=144
NZD=107
AUD=9
EUR=47