![]() |
"Safe" remove decimals from prices
Hi
I tried some solutions, but none "perfect". 1., I tried this SQL patch, it doesn't do anything. Code:
UPDATE xcart_config SET variants="2.,:1,999.53\n2.:1999.53\n2, :1 999,53\n2,.:1.999,53\n0 :1 999" WHERE name="number_format";2., I tried change the price field in xcart_pricing SQL table "decimal (12,2)" to "decimal (12,0)", it doesn't do anything. 3., I tried change in modifier.formatprice.php "precision= Null" to "precision= 0". It's working only on admin page, but not working on storefront. 4., I tried add this code for fuction.currency.php: Code:
$_tmp = strtr($_tmp, array(".00"=>""));and combined with 1-3 step. Great , it's working, but it's remove the decimals from weight...grrr. I'm now very nervous...I only want remove/hide .00 in price. Eg. 1980.00 to 1980 Why this is so complicated ? Anybody can help me ? THX![-o< |
Re: "Safe" remove decimals from prices
Nobody ?
|
Re: "Safe" remove decimals from prices
One option is to add another format to number_format in the config table of the database. Then select it in the Appearance settings.
Or if you just want to change that currency function then I would adjust the following line similar to the change you were wanting to make: $result .= str_replace('$', $config['General']['currency_symbol'] , str_replace('x', $cf_value, $config['General']['currency_format'])); |
Re: "Safe" remove decimals from prices
Quote:
1., I tried add new value for xcart_config tablet numeric_format, but it's do nothing (not show new number fromating on admin). 2., I think this soluton not good for me, becuase if i want export prices, the decimals will show...or not ? |
Re: "Safe" remove decimals from prices
1. That might be cached, or double-check it is entered correctly
2. Have you tried it? |
Re: "Safe" remove decimals from prices
Quote:
1., Yes, i checked repeatedly and clean caches etc, but does not work 2., No, but i found this code in function.currency.php. Need to add other files ? THX! |
Re: "Safe" remove decimals from prices
No solution ? :(
|
Re: "Safe" remove decimals from prices
Quote:
Can you please let me know how to do this on 4.6.1 Platinum? To display prices without decimal part you will need to modify this "function smarty_function_currency" in the following script: <xcart_dir>/include/templater/plugins/function.currency.php is it so? |
| All times are GMT -8. The time now is 09:52 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.