If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / I want to change all my prices at once

I want to change all my prices at once

Locked

Started by ilsita on 27 Oct 2009, 6:22 PM · Views: 1,336

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
27 Oct 2009, 6:22 PM
#1
ilsita avatar

ilsita

New Zenner

Join Date:
Sep 2009
Posts:
89
Plugin Contributions:
0

Post #1 by ilsita

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.

27 Oct 2009, 6:58 PM
#2
peytonrm avatar

peytonrm

New Zenner

Join Date:
Jun 2008
Location:
Morrisville, NC
Posts:
47
Plugin Contributions:
0

Post #2 by peytonrm

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.

"Whether you think you can or think you can't, you're right" - Henry Ford

27 Oct 2009, 7:53 PM
#3
ilsita avatar

ilsita

New Zenner

Join Date:
Sep 2009
Posts:
89
Plugin Contributions:
0

Post #3 by ilsita

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.

28 Oct 2009, 11:43 AM
#4
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Post #4 by rodg

ilsita:

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

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

30 Oct 2009, 12:24 AM
#5
ilsita avatar

ilsita

New Zenner

Join Date:
Sep 2009
Posts:
89
Plugin Contributions:
0

Post #5 by ilsita

RodG:

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.