Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2008
    Posts
    9
    Plugin Contributions
    0

    Default 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!

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default 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).

  3. #3
    Join Date
    Jun 2008
    Posts
    9
    Plugin Contributions
    0

    Default Re: Round prices to nearest dollar.

    Quote Originally Posted by stevesh View Post
    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.
    Code:
    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.

 

 

Similar Threads

  1. Sale Price: Round off to nearest 5 cents
    By cocolala in forum Setting Up Specials and SaleMaker
    Replies: 2
    Last Post: 9 Jan 2012, 03:57 AM
  2. Round currency to dollar but still display 2 decimal places
    By shirster in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 0
    Last Post: 17 May 2011, 05:23 AM
  3. Can I round prices to the nearest 5 cents?
    By xeontranq in forum General Questions
    Replies: 0
    Last Post: 3 May 2010, 04:47 AM
  4. ??? how to round taxes up or down to nearest 5 or 10 cent increment
    By nan in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 0
    Last Post: 14 Feb 2008, 03:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR