Guest bigfoot6155 Posted October 10, 2005 Share Posted October 10, 2005 Is it possable to add commas to the price values in the software, if so, please explain. Thank you Robert Reardon Quote Link to comment Share on other sites More sharing options...
Guest tbladecki Posted October 11, 2005 Share Posted October 11, 2005 First and formost THANK YOU for putting the version in the title of the questions saves a lot of time tring to figure out which product you are using. But I need a little more info.... where is it that you are trying to put the "," in the price on the product view, the order form,???? Quote Link to comment Share on other sites More sharing options...
markscarts Posted October 11, 2005 Share Posted October 11, 2005 Well, that's a good question . . . I think the answer is no, because I tried entering $2,500.00 and the software treated the comma as a zero, and put the price at $2.50 If you put in a price of, say, $1000.00 it must be without a comma, and when the price is displayed in the store, it is displayed without a comma. That has been my experience, anyway. Quote Link to comment Share on other sites More sharing options...
Guest Posted October 11, 2005 Share Posted October 11, 2005 If what you want is to have a price like this: $1,234,567.89 then yes, it's easily done. You can check it out here: http://www.swscripts.com/index.php?act=viewProd&productId=3 I did that my editing two lines in the /includes/functions.php file. In the priceFormat function, replace these two sections: sprintf("%.".$currencyVars[0]['decimalPlaces']."f",$price) sprintf("%.".$currencyVars[0]['decimalPlaces']."f",0.00) With this code: number_format($price,$currencyVars[0]['decimalPlaces'],'.',',') number_format(0.00,$currencyVars[0]['decimalPlaces'],'.',',') That's it. Plus, if you wanted to use european notation which swaps the comma and period, then simply swap their positions in the number_format function call. Note that those two code fragments are in the long return lines in that function. I tried to copy/paste them here, but the stupid auto line breaks broke it. If you'd like, I've included a link to the modified file you can download and simply upload to your /includes directory (you will have to unzip it first). Updated Functions File :dizzy: Quote Link to comment Share on other sites More sharing options...
Guest Posted October 11, 2005 Share Posted October 11, 2005 Oh, if you'd like to read more about this handy function, here's a link to it: http://us2.php.net/manual/en/function.number-format.php :dizzy: Quote Link to comment Share on other sites More sharing options...
Guest bigfoot6155 Posted October 11, 2005 Share Posted October 11, 2005 Thank you for the code but now when i added the new page, i get this error: MySQL Error Occured 1146: Table 'rsjo_ccrt1.CubeCart_cats_lang' doesn't exist QUERY = SELECT cat_master_id as cat_id, cat_name FROM CubeCart_cats_lang WHERE cat_lang = 'en' Quote Link to comment Share on other sites More sharing options...
Guest bigfoot6155 Posted October 11, 2005 Share Posted October 11, 2005 It looks like I fixed it. I changed the lang to german and then back to english. maybe that modified the code to make it all work. 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.