Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2009
    Posts
    95
    Plugin Contributions
    0

    Default I want to change all my prices at once

    Hi, I have a feeling that what I want to do can't really be done without just doing it in my csv, but thought I'd ask first...

    My distributor's retail prices are figures like, "$13.17, $29.24, etc" and I'd like to round these figures off, to $14, $30, etc... It's just an aesthetic thing, I guess. For some reason, I just want to see nice clean numbers.

    Can I do this in mysql somewhere, so that I don't have to open each product, change, save, open.... 12,000 times?

    Thank you!

    ilsita
    Zen-cart 1.3.8a * Template premium1c, * my zen-cart(nsfw!!): Tunti Enterprises.

  2. #2
    Join Date
    Jun 2008
    Location
    Morrisville, NC
    Posts
    50
    Plugin Contributions
    0

    Default Re: I want to change all my prices at once

    Sure. In SQL, you can do something like this:

    UPDATE products SET products_price = FLOOR(products_price);

    That will always round down. You can do:
    UPDATE products SET products_price = CEILING(products_price);

    To round up. If you have any table prefixes, you will have to add that to the name of the table in the query obviously.

    I didn't test this, so you should run it locally to check before doing it in production.

    Hope that helps.

  3. #3
    Join Date
    Sep 2009
    Posts
    95
    Plugin Contributions
    0

    Default Re: I want to change all my prices at once

    Oh that's awesome. Yeah, I want to do a ceiling function... I'll give it a shot and report back.
    Zen-cart 1.3.8a * Template premium1c, * my zen-cart(nsfw!!): Tunti Enterprises.

  4. #4
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: I want to change all my prices at once

    Quote Originally Posted by ilsita View Post
    It's just an aesthetic thing, I guess. For some reason, I just want to see nice clean numbers.

    Can I do this in mysql somewhere
    Tough question.

    If you only want to *see* "nice clean numbers" then you are best off identifying *where* you want to see them and modifying the page(s) responsible for the display.

    If you want to *change* the numbers, then mysql is certainly the way to go.

    Personally, I'd be leaving the database itself alone, and modifying the display where needed instead. In fact zencart has code to format currencies, and rounding can be considered as just another currency 'format', No need to mess the 'accuracy' of the database for aesthetic reasons.

    Just something to think about.

    Cheers
    Rod

  5. #5
    Join Date
    Sep 2009
    Posts
    95
    Plugin Contributions
    0

    Default Re: I want to change all my prices at once

    Quote Originally Posted by RodG View Post

    Personally, I'd be leaving the database itself alone, and modifying the display where needed instead. In fact zencart has code to format currencies, and rounding can be considered as just another currency 'format', No need to mess the 'accuracy' of the database for aesthetic reasons.

    Just something to think about.

    Cheers
    Rod
    Thank your for this suggestion, Rod. I'm going to look into this right now...
    Zen-cart 1.3.8a * Template premium1c, * my zen-cart(nsfw!!): Tunti Enterprises.

 

 

Similar Threads

  1. v151 Want to add verbiage to all prices
    By Jonathan Grant in forum General Questions
    Replies: 6
    Last Post: 29 Jan 2015, 11:42 PM
  2. Changes All Product Prices at Once by Percent
    By BK Services in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 19 Jun 2014, 10:25 AM
  3. Change Product Quantity in All Products at once
    By LadyMorgana in forum Customization from the Admin
    Replies: 6
    Last Post: 12 Nov 2010, 07:05 PM
  4. I want to have all options in a product to be displayed at once as s,m,l are three
    By fasabpk in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 5 Apr 2009, 05:59 PM

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