mitchellds Posted August 30, 2012 Share Posted August 30, 2012 Version: CubeCart 5.1.4 All product pricing information in my installation of CubeCart is displayed without the thousands separator (the comma). For example, if a product has a price of eleven thousand dollars, my CubeCart environment displays this as $11000.00 What I want is for my CubeCart environment to display $11,000.00 Anyone have an idea on how to get this problem fixed? Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 30, 2012 Share Posted August 30, 2012 Welcome mitchellds! Glad to see you made it to the forums. Trust me, CC5 is supposed to display money amounts with thousands separators and decimal points. It appears we need to figure out why your installation of CC5 isn't. At a start, we need to know specifically where you are not seeing the formatted price: the View Product page, the admin's Add/Edit Product screen, the emails, the order summary, or everywhere. Follow that with letting us know what skin you are using and if you have made any edits to the code. Let's start by looking at the file /class/tax.class.php, at about line 238. Here is what gets done to the price if we are not hiding it. We will either use PHP's money_format() or number_format() functions. The first is used if PHP is aware of the server's local environment (maybe would be inappropriate) and the customer is using that very same currency. Otherwise the second function is used. This function, number_format() requires a symbol to use as the thousands separator. The thousands separator will be either a comma or a period. Not nothing. I will look at the code that generates all the product's info to display on the View Product page. In the meantime, double check your copy of this file for me. Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 30, 2012 Share Posted August 30, 2012 I found the cause of this problem. Now I need to find out the cause of the cause. Can I get one or two corroborating reports of a missing thousands separator in the product's price on the View Product page? Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 30, 2012 Share Posted August 30, 2012 Here's what I would like for you to do: Open this file for editing: /classes/tax.class.php, lines 243 and 244. $symbol = ($this->_currency_vars['symbol_decimal']) ? ',' : '.'; return $this->_currency_vars['symbol_left'].number_format($this->priceCorrection($price), $this->_currency_vars['decimal_places'], $symbol, '').$this->_currency_vars['symbol_right']; Replace those two lines with these: $symbol_d = ($this->_currency_vars['symbol_decimal']) ? ',' : '.';$symbol_t = (!$this->_currency_vars['symbol_decimal']) ? ',' : '.'; return $this->_currency_vars['symbol_left'].number_format($this->priceCorrection($price), $this->_currency_vars['decimal_places'], $symbol_d, $symbol_t).$this->_currency_vars['symbol_right']; Quote Link to comment Share on other sites More sharing options...
mitchellds Posted August 30, 2012 Author Share Posted August 30, 2012 bsmither, First, thank you very much for your expertise! I sincerely appreciate it! Second, I followed your code change directions explicitly. Result = success! Again, thank you very much! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.