Jump to content

Can you help me delete double zero ??


Recommended Posts

Hi, you want to use that for Vietnamese currency?
You can do this way, but It only affect for category/sub cat view. The home page not affected !!!
If any one know how to change for the home page, pls let us know. Thanks.


How to change Currency number format for VND: ex: 2 055 570 d (zero numbers after decimal point instead of 2)
(does not affect if product belong to home category???)
In ../classes/Tools.php, search for: 'function displayPrice' (line 181)
Below that, there are 4 cases
For ex if you want to use case 4 for Vietnam currency format:
Search for: $ret = number_format($price, 2, '.', ',').' '.$c_sign;
Replace with: $ret = number_format($price, 0, ',', ' ').' '.$c_sign;
+ Also, change the name for display in admin CP:(optional)
Open file \prestashop\adminttt\tabs\AdminCurrencies.php
Search for: "$currency_formats = array("
Search for: 4 => '0,000.00X',
Replace with: 4 => '0 000 X ('.$this->l('as with Vietnam dong').')',

After that go to Back office>>payment>>currency, select the currency you want then select the formatting to option 4.

Link to comment
Share on other sites

  • 3 weeks later...

I added format number 5, it's better than edit built-in fomates.
You need too edit themes/prestashop/js/tools.js

In function formatCurrency add new format or edit built-in.
In function formatNumber last line need to looks like this:
return abs_val_string + (deci_string > 0 ? virgule + deci_string : '');

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...