Zen Cart Logo
Forums / General Questions / Increase price on all products universally?

Increase price on all products universally?

Views: 23,313

Results 21 to 40 of 79
17 Apr 2009, 4:21 PM
#21
ajeh avatar

ajeh

Oba-san

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

Increase price on all products universally?

There isn't an easy way to do that on subcategories with a select statement ...

There are some add-ons that might help you ...

18 Apr 2009, 4:55 PM
#22
time111 avatar

time111

New Zenner

Join Date:
Sep 2008
Posts:
95
Plugin Contributions:
0

Re: Increase price on all products universally?

Ajeh:

There isn't an easy way to do that on subcategories with a select statement ...

There are some add-ons that might help you ...

Ok I just got confused, what is Master Category and Subcategory.

~ Time

18 Apr 2009, 5:15 PM
#23
ajeh avatar

ajeh

Oba-san

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

Re: Increase price on all products universally?

master_categories_id is a field in the products table ...

A subcategory is a category that the product is in, but there is no reference to it in the products table ...

You could probably work out a SELECT statement with JOINS to figure out what products are in a given subdirectory based on the products_to_categories table ... but for a single SELECT to update all products in a category and its subcategories would take some coding ...

2 May 2009, 9:55 AM
#24
virtualstudios avatar

virtualstudios

New Zenner

Join Date:
May 2009
Posts:
1
Plugin Contributions:
0

Re: Increase price on all products universally?

HEy this did not seem to work for me..

UPDATE products SET products_price = products_price * 1.15;

to increase by 15% infact it did not increase prices at all...

any ideas?

thanks for you help

Scotty

3 May 2009, 3:34 PM
#25
ajeh avatar

ajeh

Oba-san

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

Re: Increase price on all products universally?

Make sure that both your files:
/includes/configure.php
/admin/includes/configure.php

are using the same database ...

Check if you use prefixes on the database table names ...

I tried that same thing and all my prices changed ... :unsure:

12 May 2009, 3:42 PM
#26
snowy2007 avatar

snowy2007

Zen Follower

Join Date:
Mar 2008
Posts:
100
Plugin Contributions:
0

Re: Increase price on all products universally?

Does anyone have any idea how to get this working for products priced by attribute please?

EDIT: Just had a look at the DB - does anyone think that the following statement would work the same for attribute prices (to increase by 35%) :

UPDATE products_attributes SET options_values_price = options_values_price * 1.35;

Oh.... and if I were to create a new field in products_attributes called, say, OLD_options_values_price, what would the SQL statement be to copy the existing options_values_price values into the new field (before I run the price increase) ?

12 May 2009, 3:52 PM
#27
snowy2007 avatar

snowy2007

Zen Follower

Join Date:
Mar 2008
Posts:
100
Plugin Contributions:
0

Re: Increase price on all products universally?

Re second part of my previous post regarding copying all fields values into another - would this be the correct statement :

UPDATE products_attributes SET OLD_options_values_price = options_values_price;

12 May 2009, 7:07 PM
#28
ajeh avatar

ajeh

Oba-san

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

Re: Increase price on all products universally?

Backup your database first ...

Add the new field but use lowercase on the field name ...

Then you update the new field as you stated:

UPDATE products_attributes SET old_options_values_price = options_values_price;

Then, update the current options_values_price:

UPDATE products_attributes SET options_values_price = options_values_price * 1.35;

15 May 2009, 12:14 PM
#29
snowy2007 avatar

snowy2007

Zen Follower

Join Date:
Mar 2008
Posts:
100
Plugin Contributions:
0

Re: Increase price on all products universally?

Ajeh:

Backup your database first ...

Add the new field but use lowercase on the field name ...

Then you update the new field as you stated:

Then, update the current options_values_price:

Thanks for the confirmation Ajeh - Added the new fields to both tables. Copied over the current prices in both just in case. Updated the prices and it works a treat for both normal products and products priced by attribute.

Just gonna convert the SQL statements to a php script now so I can do it as and when without using phpMyAdmin.

15 May 2009, 8:24 PM
#30
ajeh avatar

ajeh

Oba-san

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

Re: Increase price on all products universally?

Thanks for the update that this worked for you ... :smile:

17 Jan 2011, 9:15 PM
#31
troll avatar

troll

New Zenner

Join Date:
Nov 2009
Posts:
42
Plugin Contributions:
0

Re: Increase price on all products universally?

Ajeh, Thanks for teaching this simple price-change strings! Very helpful! :smile:

I have now learned how to make an all over price change:

UPDATE products SET products_price = products_price * 1.35; 

How to make changes by master category id:

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

And how to change the price of attribute priced items:

UPDATE products_attributes SET options_values_price = options_values_price * 1.35; 

The last one affect all attribute priced items.
Is there a nice way to make this happen to only a attribute group?
Say by group name?

Thanks for all your nice and patient answers in this community! :yes:
/Jan

17 Jan 2011, 10:35 PM
#32
ajeh avatar

ajeh

Oba-san

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

Re: Increase price on all products universally?

Can you define what you mean by an attribute group? :unsure:

18 Jan 2011, 9:14 AM
#33
troll avatar

troll

New Zenner

Join Date:
Nov 2009
Posts:
42
Plugin Contributions:
0

Re: Increase price on all products universally?

Sorry.
I think the term is "option group" in the English admin.
I give all attributes a name, and that name is then sorted into "option groups".
(Overview found under the fourth button in admin-products-dropdown.)

I'm thinking, if I an attribute name is specific to what item they lay under. Then It would be possible to update the price for only that "attribute group"?...

Looks like the ID nr. they are given in "option group" sorting is NOT unique, but their name is!..

Or said in another way.
How do I change a single item price, when that is a bunch of attribute priced items without doing this one by one?

I have read something about copying, but I don't understand that one...

Hope this make any sense... :blink:

18 Jan 2011, 2:35 PM
#34
ajeh avatar

ajeh

Oba-san

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

Re: Increase price on all products universally?

As a more real life example ...

Are you trying to change the Price on all
Option Name: Color

Or, Are you trying to change the Price on all
Option Name: Color
Option Value Red

18 Jan 2011, 3:10 PM
#35
troll avatar

troll

New Zenner

Join Date:
Nov 2009
Posts:
42
Plugin Contributions:
0

Re: Increase price on all products universally?

In your example that would be
Option Name: Color

That is in my admin-translation called "Variantgroup"... :unsure:

Actually, what I am aiming at, is to change all variables for a single products ID.

Here is the actual example in my shop.

18 Jan 2011, 3:27 PM
#36
ajeh avatar

ajeh

Oba-san

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

Re: Increase price on all products universally?

So what you really want to do is change all the Attribute Prices for:
products_id 186
options_id 22

and you want to increase all of the:
options_values_price

by an amount or a percentage?

18 Jan 2011, 3:36 PM
#37
troll avatar

troll

New Zenner

Join Date:
Nov 2009
Posts:
42
Plugin Contributions:
0

Re: Increase price on all products universally?

Correct!

I guess the only option would be percentage, as the price is different for different attributes!?

Or am I wrong here?
Thinking of it, I might have read somewhere of an addon?...
-To be able to correct price to amounts without decimals, and even to an amount of ex. 199 instead of 200 would be awesome!

18 Jan 2011, 3:44 PM
#38
ajeh avatar

ajeh

Oba-san

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

Re: Increase price on all products universally?

Change all options_id 22 Option Values to $3.50 for products_id 186 ...

UPDATE products_attributes SET options_values_price = 3.50 WHERE products_id = 186 and options_id = 22;

Change all options_id 22 Option Values to current price plus $1.00 for products_id 186 ...

UPDATE products_attributes SET options_values_price = options_values_price + 1.00 WHERE products_id = 186 and options_id = 22;

Change all options_id 22 Options Values to current price plus 10% for products_id 186 ...

UPDATE products_attributes SET options_values_price = options_values_price * 1.10 WHERE products_id = 186 and options_id = 22;

NOTE: be sure to backup your database before attempting any of these ...

18 Jan 2011, 3:53 PM
#39
troll avatar

troll

New Zenner

Join Date:
Nov 2009
Posts:
42
Plugin Contributions:
0

Re: Increase price on all products universally?

Fantastic Ajeh - Oba-San :hug:

I'll try this out!
Sorry you had to drag it out of me... :P

18 Jan 2011, 3:54 PM
#40
ajeh avatar

ajeh

Oba-san

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

Re: Increase price on all products universally?

Not a problem ... let us know how this ends up working for you ... :smile: