Jump to content

Adding Commas


Guest bigfoot6155

Recommended Posts

Guest tbladecki

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,????

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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:

Link to comment
Share on other sites

Guest bigfoot6155

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'

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...