Forums / Setting Up Categories, Products, Attributes / Bulk update of prices needed - which table to update thru back end?

Bulk update of prices needed - which table to update thru back end?

Views: 1,405

Results 1 to 6 of 6
11 Apr 2013, 6:14 PM
#1
one_tall_man avatar

one_tall_man

Zen Follower

Join Date:
Feb 2009
Posts:
125
Plugin Contributions:
0

Bulk update of prices needed - which table to update thru back end?

I tried to query my DBs _products table but product_price did not make much sense - there was for example only 1 product with $2.99 but I know for certain that I have tons of such.

Thank you!

My install: was Vanilla 1.3.9h, now 1.5.5b, Apache 2.4, PHP 7.0.6, MySQL 5.5.8 64b, Windows 7 64b, 8GB RAM, i3 3.3gHz
Modules: [Payment=Paypal] [Shipping=Canada Post 1.5.3 merged] [nonCAPTCHA]

11 Apr 2013, 6:56 PM
#2
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Bulk update of prices needed - which table to update thru back end?

have you tried ezpopulate or apsona from the plugins

12 Apr 2013, 8:49 AM
#3
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Bulk update of prices needed - which table to update thru back end?

You can use SQL queries via INSTALL SQL PATCHES under tools...

BUT...

You must be careful !

There is no "fallback" when using SQL (which is why a DB backup is advised before you install "patches").

It requires a good understanding of SQL - but once you get your head round it, it is quite a useful "tool".

For example, if you wanted to CHANGE all products where the price is 2.99 , to 3.99 ...

... the following SQL will do it:

UPDATE products SET products_price = 3.99 WHERE products_price = 2.99;

Other CONDITIONALS can apply...

UPDATE products SET products_price = 3.99 WHERE products_id = 555; (will change product with ID 555)

It helps to know FIELD NAMES and TYPES in the applicable TABLES, and for "products", these are:

products_id int(11) NOT NULL auto_increment,
products_type int(11) NOT NULL default '1',
products_quantity float NOT NULL default '0',
products_model varchar(32) default NULL,
products_image varchar(64) default NULL,
products_price decimal(15,4) NOT NULL default '0.0000',
products_virtual tinyint(1) NOT NULL default '0',
products_date_added datetime NOT NULL default '0001-01-01 00:00:00',
products_last_modified datetime default NULL,
products_date_available datetime default NULL,
products_weight float NOT NULL default '0',
products_status tinyint(1) NOT NULL default '0',
products_tax_class_id int(11) NOT NULL default '0',
manufacturers_id int(11) default NULL,
products_ordered float NOT NULL default '0',
products_quantity_order_min float NOT NULL default '1',
products_quantity_order_units float NOT NULL default '1',
products_priced_by_attribute tinyint(1) NOT NULL default '0',
product_is_free tinyint(1) NOT NULL default '0',
product_is_call tinyint(1) NOT NULL default '0',
products_quantity_mixed tinyint(1) NOT NULL default '0',
product_is_always_free_shipping tinyint(1) NOT NULL default '0',
products_qty_box_status tinyint(1) NOT NULL default '1',
products_quantity_order_max float NOT NULL default '0',
products_sort_order int(11) NOT NULL default '0',
products_discount_type tinyint(1) NOT NULL default '0',
products_discount_type_from tinyint(1) NOT NULL default '0',
products_price_sorter decimal(15,4) NOT NULL default '0.0000',
master_categories_id int(11) NOT NULL default '0',
products_mixed_discount_quantity tinyint(1) NOT NULL default '1',
metatags_title_status tinyint(1) NOT NULL default '0',
metatags_products_name_status tinyint(1) NOT NULL default '0',
metatags_model_status tinyint(1) NOT NULL default '0',
metatags_price_status tinyint(1) NOT NULL default '0',
metatags_title_tagline_status tinyint(1) NOT NULL default '0',

As I say... SQL commands/queries are totally UNFORGIVING... get it wrong and you can do serious damage to the DB.

Always backup before running sql.

20 years a Zencart User

12 Apr 2013, 1:26 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Bulk update of prices needed - which table to update thru back end?

If you do a global change on the products_price like this, it is a good idea to go to the Tools ... Store Manager ... and run:

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

as manually changing the prices is skipping a step in updating the field products_price_sorter ...

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 Apr 2013, 4:37 PM
#5
one_tall_man avatar

one_tall_man

Zen Follower

Join Date:
Feb 2009
Posts:
125
Plugin Contributions:
0

Re: Bulk update of prices needed - which table to update thru back end?

Figured I was looking at a wrong DB on a wrong server, problem solved, thanks everyone!

My install: was Vanilla 1.3.9h, now 1.5.5b, Apache 2.4, PHP 7.0.6, MySQL 5.5.8 64b, Windows 7 64b, 8GB RAM, i3 3.3gHz
Modules: [Payment=Paypal] [Shipping=Canada Post 1.5.3 merged] [nonCAPTCHA]

8 Dec 2013, 10:02 PM
#6
maria82g avatar

maria82g

New Zenner

Join Date:
Feb 2009
Posts:
81
Plugin Contributions:
0

Re: Bulk update of prices needed - which table to update thru back end?

I want to change all prices from $22 to $25 I am using this
UPDATE products SET products_price = 25 WHERE products_price = 22; ,

but prices are not changing.... umm any idea?