Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Currency Problem


Guest

Recommended Posts

Posted

Hiya. I have just changed my currency to UK Pound, but now all my product prices are showing up as 0

 

 

I have the following settings in the currency panel in admin:

 

 

Title: UK Pound

Code: GBP

Symbol Left: £

Symbol Right:

Decimal Point: .

Thousands point: ,

Decimal Places: 2

Value: 1.00000

 

I dont have any other currency in the shop, where have i gone wrong

 

Thanks,

 

 

Andy

Posted

You need to make your currency your default currency in Admin because you deleted the USD which is the default currency when OSC is installed.

 

You also need to do this:

 

look in catalog\includes\languages\english.php and make

// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)

define('LANGUAGE_CURRENCY', 'USD');

 

this

 

// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)

define('LANGUAGE_CURRENCY', 'GBP');

 

You may also have to set Admin ---> My Store --- > Default Language Currency to true.

Posted

define('LANGUAGE_CURRENCY', 'GBP'); plus

You may also have to set Admin ---> My Store --- > Default Language Currency to true.

 

as stated by Leslie.

 

If this does not work and You have just one currency then go to currency class and where You find some value.Set it to one.

 

The other reason can be that reading session value is not happening as session variables are no more globals.

 

so after new currency code in application_top.php

$courrency = 'GBP';

You can set $_SESSION['currency '] = $currency;

 

As ther is just one currency this will take care.

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

  • 1 month later...
Posted

I'm sorry, can you help me for this currency problem:

 

I use Indonesian Rupiah (Rp.) currency as a default currency. Refering to my country rules, decimal point is use ',' and thousand point is use '.'

When I add a product, say, with price Rp.39.000.000,00 - the price is display correctly in my admin page (in preview menu, when I add this product). But, when I open it from Categories Box in main page (public page), the price for that product is changing to Rp.3,90

 

I have try to change setting of decimal point and thousand point, but it's no change anything in price display (only change the decimal point, Rp.3,90 --> Rp.3.90).

 

But, when I change the price to Rp.39.300.000,00 then the price is display correctly in the public page.

 

What's happened? is there anything that I should set it up?

 

Thanks

Posted

Still trying to figure this out. Can anyone help me??

 

I think this is where the problem lies - rounding in the currencies table. I believe I copies htis one from the catalog / includes / class / currencies.php (there are about 6 different currencies.php files.

 

Does anyone see an error (I'm not a programmer but I can make basic changes as needed.)

 

Please take a look and let me know if you see any reason why setting the decimal places would be affecting the alternate currency product price display number....

 

Thank you.

 

<?php

/*

$Id: currencies.php 1803 2008-01-11 18:16:37Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2008 osCommerce

 

Released under the GNU General Public License

*/

 

////

// Class to handle currencies

// TABLES: currencies

class currencies {

var $currencies;

 

// class constructor

function currencies() {

$this->currencies = array();

$currencies_query = tep_db_query("select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from " . TABLE_CURRENCIES);

while ($currencies = tep_db_fetch_array($currencies_query)) {

$this->currencies[$currencies['code']] = array('title' => $currencies['title'],

'symbol_left' => $currencies['symbol_left'],

'symbol_right' => $currencies['symbol_right'],

'decimal_point' => $currencies['decimal_point'],

'thousands_point' => $currencies['thousands_point'],

'decimal_places' => $currencies['decimal_places'],

'value' => $currencies['value']);

}

}

 

// class methods

function format($number, $calculate_currency_value = true, $currency_type = '', $currency_value = '') {

global $currency;

 

if (empty($currency_type)) $currency_type = $currency;

 

if ($calculate_currency_value == true) {

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

$format_string = $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'];

} else {

$format_string = $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'];

}

 

return $format_string;

}

 

function calculate_price($products_price, $products_tax, $quantity = 1) {

global $currency;

 

return tep_round(tep_add_tax($products_price, $products_tax), $this->currencies[$currency]['decimal_places']) * $quantity;

}

 

function is_set($code) {

if (isset($this->currencies[$code]) && tep_not_null($this->currencies[$code])) {

return true;

} else {

return false;

}

}

 

function get_value($code) {

return $this->currencies[$code]['value'];

}

 

function get_decimal_places($code) {

return $this->currencies[$code]['decimal_places'];

}

 

function display_price($products_price, $products_tax, $quantity = 1) {

return $this->format($this->calculate_price($products_price, $products_tax, $quantity));

}

}

?>

Posted
I'm sorry, can you help me for this currency problem:

 

I use Indonesian Rupiah (Rp.) currency as a default currency. Refering to my country rules, decimal point is use ',' and thousand point is use '.'

When I add a product, say, with price Rp.39.000.000,00 - the price is display correctly in my admin page (in preview menu, when I add this product). But, when I open it from Categories Box in main page (public page), the price for that product is changing to Rp.3,90

 

I have try to change setting of decimal point and thousand point, but it's no change anything in price display (only change the decimal point, Rp.3,90 --> Rp.3.90).

 

But, when I change the price to Rp.39.300.000,00 then the price is display correctly in the public page.

 

What's happened? is there anything that I should set it up?

 

Thanks

I think some one had this problem a few months ago, you could search the forum for the solution.

Use this link to search

Posted
Still trying to figure this out. Can anyone help me??

Did you check the values for deimal places in your admin?

Posted
I think some one had this problem a few months ago, you could search the forum for the solution.

Use this link to search

 

Hi Coopco,

I tried to search it, but unfortunately I can't find it.

 

Now, when I use 5 decimal places (in setting of default currency), the price of Rp.39.000.000 is displayed correctly, instead of using 2 or 3 or 4 decimal places. But, it's still not answer why when I use price Rp.39.300.000, the price is displayed correctly no matter what decimal places I use for.

 

Any clue?

 

Thanks

Archived

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

×
×
  • Create New...