Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

HELP: How to display two currencies?


SEDef

Recommended Posts

Hi there

 

I need help on how to display two currencies for the products, in shopping cart, sub-total and total.

 

Example:

 

Logitech Mouse PS/2

29.99 USD

(25.00 EUR)

 

It will be enough to display two currencies only at the product.

 

Is out there any module or can anyone help me with this. It is urgent!!!

 

Thanks!

Link to comment
Share on other sites

as i mentioned in the other post :

it not idisplay both currencies in checkout_confirmation.php and so later in the invoice!

 

any help please?

 

well, undo the change you did to the currencies class display_price function, then:

 

before this code in the function format

 

return $format_string;

 

 

you add:

 

$currency_type = 'EUR'; // second currency

 

if ($calculate_currency_value == true) {

$rate = (tep_not_null($currency_value)) ? $currency_value : $this->currencies[$currency_type]['value'];

$format_string .= '<br>'.$this->currencies[$currency_type]['symbol_left'] . number_format(tep_round($number * $rate, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right'];

if ( (DEFAULT_CURRENCY == 'EUR') && ($currency_type == 'DEM' || $currency_type == 'BEF' || $currency_type == 'LUF' || $currency_type == 'ESP' || $currency_type == 'FRF' || $currency_type == 'IEP' || $currency_type == 'ITL' || $currency_type == 'NLG' || $currency_type == 'ATS' || $currency_type == 'PTE' || $currency_type == 'FIM' || $currency_type == 'GRD') ) {

$format_string .= ' <small>[' . $this->format($number, true, 'EUR') . ']</small>';

}

} else {

$format_string .= '<br>'.$this->currencies[$currency_type]['symbol_left'] . number_format(tep_round($number, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right'];

}

 

 

WARNING: this will do it to ALL your prices.

Treasurer MFC

Link to comment
Share on other sites

well, undo the change you did to the currencies class display_price function, then:

 

before this code in the function format

 

return $format_string;

you add:

 

$currency_type = 'EUR'; // second currency

 

if ($calculate_currency_value == true) {

$rate = (tep_not_null($currency_value)) ? $currency_value : $this->currencies[$currency_type]['value'];

$format_string .= '<br>'.$this->currencies[$currency_type]['symbol_left'] . number_format(tep_round($number * $rate, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right'];

if ( (DEFAULT_CURRENCY == 'EUR') && ($currency_type == 'DEM' || $currency_type == 'BEF' || $currency_type == 'LUF' || $currency_type == 'ESP' || $currency_type == 'FRF' || $currency_type == 'IEP' || $currency_type == 'ITL' || $currency_type == 'NLG' || $currency_type == 'ATS' || $currency_type == 'PTE' || $currency_type == 'FIM' || $currency_type == 'GRD') ) {

$format_string .= ' <small>[' . $this->format($number, true, 'EUR') . ']</small>';

}

} else {

$format_string .= '<br>'.$this->currencies[$currency_type]['symbol_left'] . number_format(tep_round($number, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right'];

}

WARNING: this will do it to ALL your prices.

 

 

yes .. it works fine .. till checkout_confirmation.php ... now I have same amount in both currencies in checkout_confirmation.php ...

any further help, please ?

 

thanx in advance

Link to comment
Share on other sites

yes .. it works fine .. till checkout_confirmation.php ... now I have same amount in both currencies in checkout_confirmation.php ...

any further help, please ?

 

thanx in advance

 

what if you add this:

 

$currency_value = '';

 

right after this:

 

$currency_type = 'EUR'; // second currency

Treasurer MFC

Link to comment
Share on other sites

what if you add this:

 

$currency_value = '';

 

right after this:

 

$currency_type = 'EUR'; // second currency

 

 

another question .. if I dare ... where to put bracket or space between two currencies ...

Link to comment
Share on other sites

another question .. if I dare ... where to put bracket or space between two currencies ...

 

where it says:

 

$format_string .= '<br>'.$this->currencies[$curren......

 

you replace the <br> with / or - or....

Treasurer MFC

Link to comment
Share on other sites

where it says:

 

$format_string .= '<br>'.$this->currencies[$curren......

 

you replace the <br> with / or - or....

 

yes, i know .. i have try this. it works but not in checkout_confirmation.php and so later in the invoice ...

 

any idea?

Link to comment
Share on other sites

  • 1 year later...

How I can select the language so that the page shows the value in the correct currency?

 

If I select the languages standards (English, German or Spanish) the page automatically is shown with its respective currencies.

 

But if I select Portuguese Brazilian it does not show the correct currency (BRL R$).

Please it helps me!

 

How I must proceeds?

 

If possible it makes a visit and it has tested the store virtual.

 

Thanks!

 

Aziz Guilherme

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...