One of the problems that comes of having a large inventory is making changes on a large scale.  Unfortunately, this is not easily done within the default interface provided by Prestashop.  For example, if you need to change all of your inventory pricing by 10%, then you would have to change each item individually.  If your inventory items numbered in the hundreds or thousands, then this could quickly become too tedious a task without some type of automation.  Fortunately, this can be accomplished using a SQL query.  In order to make the query, you will need to have access to the MySQL database using a database client like phpMyadmin (available in the Cpanel interface).  The following article will walk you through the process of creating a SQL query to update your entire inventory in the PrestaShop database.

 

Creating the SQL Query for a Mass Price Update

  1. Login to the Cpanel
  2. Scroll down the Cpanel interface until you find the DATABASES section.  Click on phpMyAdmin to continue.List of databases in phpMyAdmin
  3. When the phpMyAdmin interface opens, the list of database will be in a column on the left (as per the screenshot at right).  Scroll through this list of databases until you find the database associated with your PrestaShop 1.5 installation. If you need help finding your database name, go to Locating the Database Name Prestashop 1.5 store.
  4. Click on your database once you find it.  This will change the screen view to show the tables that make up the structure of the Prestashop database.
  5. At the top of the phpMyAdmin interface you will see the tab labeled SQL.  Click on this tab in order to build the query.
  6. The following listed code samples provide you the code that you can enter in order to make your bulk price changes:

    To Decrease the price:

    Decease by a fixed amount of currency (code example decreases all prices by 25 cents):

    UPDATE ps_product_shop SET price = price-.25
    UPDATE ps_product SET price = price-.25

    Decrease by a percentage (code example decreases all prices by 25%)

    UPDATE ps_product_shop SET price = price / 1.25
    UPDATE ps_product SET price = price / 1.25


    To Increase the price:

    Increase by a fixed amount of currency (code example increases prices by $1.00)

    UPDATE ps_product_shop SET price = price+1.00
    UPDATE ps_product SET price = price+1.00

    Increase by a percentage (code example increases prices by 10%)

    UPDATE ps_product_shop SET price = price*1.10
    UPDATE ps_product SET price = price*1.10

    Select the code that best meets your needs and enter this code into the SQL query window that you opened in Step 5.
  7. After you have finished entering the code, click on the GO button in the bottom right of the screen.  Note that this will change the prices for all of your products.


In order to see the effect on the prices check out the screenshots below.  The screenshots show the increase in price by $1.00:

Original Price for featured products Screenshot shows increase in price




Did you find this article helpful?

Login to comment.

Your Opinion Matters

... but we need to know what you're thinking!

I'm Arnel Custodio, your friendly Community Support technician, and I wrote the article you're looking at now. I like to think it's perfect, but I'm sure you have some suggestions. Please, let me know what they are!

Feedback
Your Email Address
Because we'd like to talk with you!

Have a Question?

If you need some help, submit your question to our Community! We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)

Recent Questions

  1. my email is being rejected
  2. Can I run the FiverrScript on my hosting
  3. SQL database password

Support Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.