Jump to content

Curency


zebedeubeatu

Recommended Posts

Hello. im using web20cart and i wold like to add some lines where to put some curency info

 

 

Subtotal: € 9.90 EUR

Total Due Today: € 9.90 EU

Equivalent in RON: 42.03 RON (and here the Total converted in RON)

1 EURO = 4.2455 RON (here to be the exchange rate)

Total Recurring: € 9.90 EUR Annually

 

and the same thing on my viewinvoice.php

Edited by zebedeubeatu
Link to comment
Share on other sites

Im on half way guys i made it on viewinvoice.tpl and viewcart.tpl now im intrested in doing it in invoicepdf.tpl i will explain below how i do it and maybe you can guide me to do it in pdf

 

FIRST I ADDTED THE BELOW STRING TO TE PAGE

 

{php}

global $currency;

if ($currency['code']=='EUR') {

$datecreated = $this->_tpl_vars['datecreated'];

$result = full_query("SELECT rate FROM mod_exchangerates WHERE date<'".toMySQLDate($datecreated)."' ORDER BY date DESC");

$data = mysql_fetch_array($result);

$convrate = $data["rate"];

}

if (!$convrate) $convrate = 4.26404;

{/php}

 

 

THEN I CONVERTED THE TOTAL PRICE IN RON

 

 

{php} echo format_as_currency(preg_replace('/[^0-9.]/','',$this->_tpl_vars['total'])*$convrate); {/php} RON

 

 

THEN I DISPLAYED THE CURENCY

 

{php} echo ($convrate); {/php} RON

 

Please help me do it in pdf

 

 

 

Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated