When building an online store and using programs such as Zen Cart, the number of products you carry can increase exponentially over time. Most of the time, things like price changes will be done on an individual product level or at most small groups. However, there may be times when you need to make a price change for all products in your store. For example, you may want to have a store-wide sale, or perhaps your suppliers go up ten percent and you need to reflect that price change in your store.
Making a mass price increase is not a default behavior in Zen Cart and generally must be done by accessing the database directly. To access the database you will need a tool such as the phpMyAdmin program that is found in your cPanel account. The following tutorial will demonstrate how to make a mass price increase or decrease for your Zen Cart store using phpMyAdmin.
Performing a bulk price increase in phpMyAdmin for Zen Cart.
- Log into your cPanel dashboard.
- Look for your phpMyAdmin tool icon. This is located in the Databases category of the cPanel.
- Once in the phpMyAdmin dashboard, look to the left hand panel and locate the database for your Zen Cart installation. Click on the database name to go to the next screen. In this example, you can see our particular database is named zenc860.
- This opens up the list of tables in the right hand panel for your ZenCart database. Above the list is a set of tabs. Click on the tab labeled SQL to enter the SQL query constructor.
- Now that you are in the SQL Query construction screen you will need to add the particular query to adjust the prices. The table you will be editing is the zen_products table. The exact column you will modify is the products_price column. Below are a few samples that show price increases and decreases done by either a specific amount or a percentage.
Sample code to decrease all prices by twenty percent (20%).UPDATE zen_products SET products_price = products_price*.80
Sample code to decrease all prices by 25 cents (.25).UPDATE zen_products SET products_price = products_price-.25
Sample code to increase all prices by fifteen cents (.15).UPDATE zen_products SET products_price = products_price+0.15
Sample code to increase all prices by ten percent (10%)UPDATE zen_products SET products_price = products_price*1.10
- After entering the query code, click on the Go button in the lower right hand corner. This will activate the command and make the price change for all products in the table.
- If the query is successful, you will be presented with a success message at the top of the page. Your prices are now adjusted. We have a before and after shot below showing the effects of the sql query on our ipod product as we raised the price by ten percent.