Forums / Setting Up Categories, Products, Attributes / mass price change for all products in a specific category

mass price change for all products in a specific category

Started by chaiavi on 8 Dec 2010, 1:18 PM · Views: 18,167

Results 1 to 20 of 22
8 Dec 2010, 4:48 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: mass price change for all products in a specific category

If all of those Products use that Category's categories_id as their master_categories_id ...

You can backup your database and then run:

UPDATE products SET products_price = products_price * 1.15 WHERE master_categories_id = XX;

where XX is the master_categories_id for these Products ...

Then, go to the Tools ... Store Manager ... and run the:

Update ALL Products Price Sorter
to be able to sort by displayed prices: Update

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Dec 2010, 10:17 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: mass price change for all products in a specific category

Thanks for the update that this was able to do the Product Price increase that you needed ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Dec 2010, 2:56 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: mass price change for all products in a specific category

You can run the same command from the Zen Cart Admin in the Tools ... Install SQL Patches ...

Otherwise, you would need to customize the code to build this in as something more user friendly ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

24 Jan 2011, 1:32 AM
#7
xeontranq avatar

xeontranq

New Zenner

Join Date:
Feb 2010
Posts:
27
Plugin Contributions:
0

Re: mass price change for all products in a specific category

i had to update my hole store buy 11% , i used obisan's code ```php
UPDATE products SET products_price = products_price * 1.11


note this will do ALL products in the store 

tyvm obi for showing me the way :)
24 Jan 2011, 12:41 PM
#8
liizz avatar

liizz

New Zenner

Join Date:
Jan 2011
Posts:
58
Plugin Contributions:
0

Re: mass price change for all products in a specific category

Hi,

Where to make the modifs in the code?

Which line more precisely because I need to add a tax on a specific category for particular products??

Is it in the script 'categories.php'?

Am a newbie to Zen Cart..:smile:

Thanks

Liizz

27 Jan 2011, 2:26 AM
#9
groupv avatar

groupv

New Zenner

Join Date:
Sep 2010
Posts:
13
Plugin Contributions:
0

Re: mass price change for all products in a specific category

liizz:

Hi,

Where to make the modifs in the code?

Which line more precisely because I need to add a tax on a specific category for particular products??

Is it in the script 'categories.php'?

Am a newbie to Zen Cart..:smile:

Thanks

Liizz

Hi Liizz - No to add tax to all your items or items from a category you can do another SQL query on your database - I am not good at SQL, but it would look something like this:

UPDATE products SET products_tax_class_id = 1 WHERE master_categories_id = XX

Where xx is the category you want to update all products :clap:

Remember - always backup before doing any SQL queries :)

Good Luck,

Ryan

27 Jan 2011, 9:20 AM
#10
dragoon09 avatar

dragoon09

New Zenner

Join Date:
Sep 2010
Location:
Cahokia, IL
Posts:
19
Plugin Contributions:
0

Re: mass price change for all products in a specific category

If you use a spreadsheet program like Excel or Open Office you can do it real simple, its called Paste Special - I just learned about it.

In an empty cell (anywhere on that active sheet is fine) enter the percentage you wish to increase prices by i.e 1.35 for 35% or 1.11 for 11% etc.
Now Click CTRL C (Copy) over the cell you just created
Highlight the cells/column you wish to change
Click on EDIT -> PASTE SPECIAL
In that screen select MULTIPY
CLick OK
Your Done!

I would suggest trying it out on fresh spreadsheet to get a handle on what you're doing.:clap:

If I can find the link to that forum page I will respond back and post it. Otherwise, you should be able to find it in a google search: Paste Special (open office or excel)

Matt Doty
https://www.MoodBoosters.net
"It's better to be a Smart A$$ than a Dumb A$$

30 Jan 2011, 8:44 AM
#11
liizz avatar

liizz

New Zenner

Join Date:
Jan 2011
Posts:
58
Plugin Contributions:
0

Re: mass price change for all products in a specific category

Hi.

Thanks for your post..

@dragoon09:

I need to copy all the products' data from MySQL & paste it in Excel..

Bt the rate at which these products may vary..

I have created a category for 'Computer Hardware' and there are different models & make.. The prices will vary based on the models as no fixed rate has been applied..

Plz give any suggestions

Thanks
Liizz

4 Feb 2011, 5:48 AM
#12
dragoon09 avatar

dragoon09

New Zenner

Join Date:
Sep 2010
Location:
Cahokia, IL
Posts:
19
Plugin Contributions:
0

Re: mass price change for all products in a specific category

The only I could suggest is to break it down by category or type or however and Sort it that way.

With Paste Special, you can control what gets changed by what you have highlighted, so if you can Sort the Data to make selections easier do it that way.

But if most of your items require different rates, then there isn't much else you can do but one by one.

Matt Doty
https://www.MoodBoosters.net
"It's better to be a Smart A$$ than a Dumb A$$

23 Mar 2012, 1:15 PM
#13
cyberian37 avatar

cyberian37

New Zenner

Join Date:
Dec 2010
Location:
Well... across all the world, a while here then there...
Posts:
13
Plugin Contributions:
0

Re: mass price change for all products in a specific category

Hi guys, does anyone know how to mass update products, but only in case if manufacturer = canon ? I'm playing with it but can't find a solution. :frusty:

Thank you.

12 Feb 2015, 2:44 PM
#14
voluntaryist_only avatar

voluntaryist_only

New Zenner

Join Date:
Sep 2010
Posts:
60
Plugin Contributions:
0

Re: mass price change for all products in a specific category

Ajeh:

UPDATE products SET products_price = products_price * 1.15 WHERE master_categories_id = XX;

hi ajeh, can i just ask, will this hack work with zc 1.5.1 thanks,

regards vo ;-)
12 Feb 2015, 2:52 PM
#15
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: mass price change for all products in a specific category

As that is just straight SQL, it can work with any version ...

NOTE: Be sure to backup your database before attempting it and then when done, go to the Tools ... Store Manager ... and update the:

Update ALL Products Price Sorter
to be able to sort by displayed prices:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

12 Feb 2015, 3:18 PM
#16
voluntaryist_only avatar

voluntaryist_only

New Zenner

Join Date:
Sep 2010
Posts:
60
Plugin Contributions:
0

Re: mass price change for all products in a specific category

thanks ajeh,
I am not worthy :bow: thanks for that

regards,

vo :smile:

2 May 2019, 8:52 PM
#17
aquaticaddiction avatar

aquaticaddiction

New Zenner

Join Date:
Apr 2008
Posts:
30
Plugin Contributions:
0

Re: mass price change for all products in a specific category

Can this be modified at all to increase by X percent if price is over X amount of dollars?

3 May 2019, 11:13 AM
#18
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,129
Plugin Contributions:
56

Re: mass price change for all products in a specific category

AquaticAddiction:

Can this be modified at all to increase by X percent if price is over X amount of dollars?
Sure, to update a set of products' prices by 11% if a product's price is greater than $7.59, you'd enter this (***after *backing up your database) in your admin's Tools->Install SQL Patches:

UPDATE products SET products_price = products_price * 1.11 WHERE products_price > 7.59;
5 May 2019, 12:45 AM
#19
aquaticaddiction avatar

aquaticaddiction

New Zenner

Join Date:
Apr 2008
Posts:
30
Plugin Contributions:
0

Re: mass price change for all products in a specific category

lat9:

Sure, to update a set of products' prices by 11% if a product's price is greater than $7.59, you'd enter this (***after *backing up your database) in your admin's Tools->Install SQL Patches:

UPDATE products SET products_price = products_price * 1.11 WHERE products_price > 7.59;


Excellent, thank you. Now, just to add another wrench in the works - if I wanted to specify a specific category (Ex 79) to get a price increase could I do something to the effect of

UPDATE products SET products_price = products_price * 1.01 WHERE master_categories_id = 79 WHERE products_price > 300.00;

5 May 2019, 2:02 AM
#20
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: mass price change for all products in a specific category

AquaticAddiction:

Excellent, thank you. Now, just to add another wrench in the works - if I wanted to specify a specific category (Ex 79) to get a price increase could I do something to the effect of

UPDATE products SET products_price = products_price * 1.01 WHERE master_categories_id = 79 WHERE products_price > 300.00;

Something "like" but different. In that case would AND the two criteria.

UPDATE products SET products_price = products_price * 1.01 WHERE master_categories_id = 79 AND products_price > 300.00;


If you wanted to modify additional fields (not just to update products_price), the field along with assignment would be separated by a comma.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...