VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: fallnet on November 09, 2015, 13:12:02 PM

Title: Show multiple (dual) currency on product details.
Post by: fallnet on November 09, 2015, 13:12:02 PM
Hello,

Im looking for solution, where I can show two currency on product details.
For example my main currency is EUR and I want show GBP also, something like:

Price: 10 EUR (7.14 GBP)

Dont you have somebody some finished code or plugin which make this, please?
Convert rate should be taken from convertECB.php
I was find here in forum solution for old VM 1. But nothing for Virtuemart 3.x.

Thank you.
Best Regards
fallnet
Title: Re: Show multiple (dual) currency on product details.
Post by: fallnet on November 10, 2015, 10:21:01 AM
Hello,

I was find solution, but with rounded.
My currency is rounded to cdecimal place 0, but I want 2nd currency rounded on 2 decimal place.
I mean show EUR: 22,90 instead of EUR: 23

echo '<b>EUR: '.$this->currency->roundForDisplay($this->product->prices['salesPrice'],47,1,false).'</b>';

Dont you have idea how to change this code to 2 decimal place after , ?
In currency administration is correct 2

Regards
fallnet
Title: Re: Show multiple (dual) currency on product details.
Post by: Milbo on November 10, 2015, 14:07:51 PM
roundForDisplay($price, $currencyId=0,$quantity = 1.0,$inToShopCurrency = false,$nb= -1){

=> $this->currency->roundForDisplay($this->product->prices['salesPrice'],47,1,false,2)

Else it takes it from the currency object.
Title: Re: Show multiple (dual) currency on product details.
Post by: aka.deton on March 24, 2017, 14:43:44 PM
Quote from: Milbo on November 10, 2015, 14:07:51 PM
roundForDisplay($price, $currencyId=0,$quantity = 1.0,$inToShopCurrency = false,$nb= -1){

=> $this->currency->roundForDisplay($this->product->prices['salesPrice'],47,1,false,2)

Else it takes it from the currency object.
Does not work in version 3.0.18!
Title: Re: Show multiple (dual) currency on product details.
Post by: jenkinhill on March 24, 2017, 16:03:13 PM
So maybe try VM3.2?  On a backup copy of the site, of course.  http://virtuemart.net/news/latest-news/479-virtuemart-3-2-cached-and-optimized