Two currencies

Fiko

No avatar

2008-10-20 00:19

Hey there,

can I use two currencies? I mean some products I would like to sell in US dollars and some in my home currency. Thanks

» Quick.Cart v3.x

Fiko

treewood (OpenSolution)

Avatar: treewood

2008-10-20 07:41

hmmm... this will be not easy. you should edit core/products.php and find function: generateCache
find this: $this->aProducts[$aExp[0]] = $sFunction( $aExp );
After paste code:
$this->aProducts[$aExp[0]]['fPrice2'] = $this->aProducts[$aExp[0]]['fPrice'] * 0.89; // here change 0.89 to value what you want to get

After in listProducts function find this:
$aData['sPrice'] = is_numeric( $aData['fPrice'] ) ? displayPrice( $aData['fPrice'] ) : $aData['fPrice'];
Add this code after:
$aData['sPrice2'] = is_numeric( $aData['fPrice2'] ) ? displayPrice( $aData['fPrice2'] ) : $aData['fPrice2'];

And in function throwProduct find this:
$aData['sPrice'] = is_numeric( $this->aProducts[$iProduct]['fPrice'] ) ? displayPrice( $this->aProducts[$iProduct]['fPrice'] ) : $this->aProducts[$iProduct]['fPrice'];
Add this code after:
$aData['sPrice2'] = is_numeric( $this->aProducts[$iProduct]['fPrice2'] ) ? displayPrice( $this->aProducts[$iProduct]['fPrice2'] ) : $this->aProducts[$iProduct]['fPrice2'];

Now in templates/page_default.tpl in block PRODUCTS_LIST and in templates/products_default.tpl in block CONTAINER add variable:
$aData['sPrice2']

This is only instruction how to display product two prices in client side. It is too much work to display this two prices in basket, in admin, in order form etc etc.
Use it to get more information about functions and what you must change to get what you want:
http://opensolution.org/Quick.Cart/docs/

Fiko

No avatar

2008-10-20 11:20

Thanks for your reply! I had no idea how difficult it is. But displaying price in 2 currencies would be enough so I am gonna try. Btw thanks for the great software.

<OT>
One more question. Going through the manual I found out that I can have my e-shop in more languages using this code:

<a href="?sLang=pl">polski</a>
<a href="?sLang=en">english</a>

And my question is how can I copy data (products) from one language to the other one. I want to sell the same products but display info in 2 languages.
</OT>

Thank you

Fiko

treewood (OpenSolution)

Avatar: treewood

2008-10-21 07:17

copy all files in db/ to db2/ and change names of LANGUAGE_xxx.php for example: en_pages.php to your language for example to: fr_pages.php and all this files with this "en_" in name of files

Back to top
about us | contact