As you build your store using Zen Cart, your total number of products will. In the beginning you can make price changes to all your products easily. As the number of products grows, however, making a price update across all products will be extremely tedious and take a long time.
Making a price adjustment for all your products at once must be done by accessing the database directly. You will need to access the database using a tool like phpMyAdmin, which is found in your cPanel dasbhboard. Follow the instructions below as we demonstrate how to make a mass price increase or decrease for your Zen Cart store using phpMyAdmin.
How to perform a bulk price update for Zen Cart using phpMyAdmin.
- Log into your cPanel dashboard.
- Next, find your Databases category and click on the phpMyAdmin tool icon.
- This leads to the the phpMyAdmin dashboard. From here, locate the database for your Zen Cart installation from the left sidebar. Clicking on the database name will connect the phpMyAdmin to that database so you can work with the tables. In our example, the database name is zenc593.
- After clicking on the database name, the right hand panel displays the list of tables for your ZenCart database. Look above the list and you will see a set of tabs. From here, click on the tab labeled SQL.
- This leads you to the SQL Query constructor. Here is where you will create the SQL query to make the price adjustments. The table and column you will be editing is the zen_products and products_price, respectively. Listed below are a few samples that show price increases and decreases done by either a specific amount or a percentage.
Sample code to increase all prices by twenty percent (20%).
UPDATE zen_products SET products_price = products_price*1.20
Sample code to decrease all prices by 15 cents (.25).
UPDATE zen_products SET products_price = products_price-.15
Sample code to increase all prices by fifty cents (.15).
UPDATE zen_products SET products_price = products_price+0.50
Sample code to decrease all prices by ten percent (10%)
UPDATE zen_products SET products_price = products_price*.90
- Once you enter the query code, click on the Go button in the lower right hand corner to activate the command and make the price change for the products.
- Once the change is sucessful, you will be presented with a success message at the top of the page. This means prices are now adjusted as desired. As you can see below, we have a before and after shot below showing the effects of the sql query. In our case, we decreased the price by 10%.
Before | After |
|
|
We value your feedback!
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
new! - Enter your name and email address above and we will post your feedback in the comments on this page!