Forums / General Questions / Round prices to nearest dollar.

Round prices to nearest dollar.

Locked

Views: 2,884

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
4 Oct 2010, 7:52 PM
#1
bestbridalprices avatar

bestbridalprices

New Zenner

Join Date:
Jun 2008
Posts:
9
Plugin Contributions:
0

Round prices to nearest dollar.

I'm using Zen Cart 1.3.8a & PHP Version 5.2.6-1+lenny8.

Can anyone tell me how to round prices to the nearest dollar for all products in a category?

I assume with SQL this is pretty easy, but have had no luck figuring out how.

All the threads on the forum about this were unanswered.
Thanks in advance!

5 Oct 2010, 11:23 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Round prices to nearest dollar.

Just in one category ? You would have to write code to do that.

If you want to do it for all products, you can set the decimal places of your default currency to 0 (or leave it blank).

7 Oct 2010, 3:12 PM
#3
bestbridalprices avatar

bestbridalprices

New Zenner

Join Date:
Jun 2008
Posts:
9
Plugin Contributions:
0

Re: Round prices to nearest dollar.

stevesh:

Just in one category ? You would have to write code to do that.

If you want to do it for all products, you can set the decimal places of your default currency to 0 (or leave it blank).

We got it figured out.

update products set products_price = round(products_price, 0), products_price_sorter = round(products_price_sorter, 0) 

where products_id in (select distinct products_id from products_to_categories where categories_id = XXX);

Thanks for the help.