Latest Articles
So far this was never an issue, there were problems with uploading modules via the installer because of the ftp connection but you could allways install ocmods without any issue. However, some .. Read More
People had this issue so many times I thought I would write a bit about it. The  types of issues with opencart's 2.x modification system that I identified so far are: 1. Old Vqmod .. Read More
This small tutorial will show you how to manually add custom links to the default top menu in opencart. If you dont want to go trough all the hustle and would like to be able to completly customize.. Read More
To enable seo urls in opencart navigate in admin to system > settings , edit the store and on the server tab of the store settings you will find "Use SEO urls", set it to yes. So far e.. Read More
All Articles

Modify all product prices by a percentage in opencart

If you need to chnage all the product prices by a percentage at once, here is an easy way to do that.

From your control panel, lauch phpmyadmin and select the database that your store currently uses.

Go to the sql tab and run the query that applies to you.

If you want to raise all your prices by a percentage (Example: 22.5%), run the query:

update product set price = round(price*1.225,2)

If you want to drop all your prices by a percentage (Example: 15%), run the query:

update product set price = round(price/1.15,2)

If the tables of you opencart database use a preffix (ex: in the table list, the table name would looklike: preffix_product instead of just product), dont forget to apply the preffice to the product table in the query too.

Posted by Flo

5 Comments To "Modify all product prices by a percentage in opencart"

Cosmin On 25 Jan 2017
hello , the code works, it modifies the prices, but on the home page in the latest added and in the best sellers module it displays the same unmodified prices ... Reply to this comment
Flo On 28 May 2013
That would be: update product set price = round(price/1.05,2) Reply to this comment
Andres On 28 May 2013
If I want modify price in p.ex -5% how make the query? Reply to this comment
Flo On 22 Nov 2012
This is not for discounts, this would modify the actual prices. For discount by 20% to all products, U suggest you use a coupon code and place the info about it on homepage so the user could use the coupon page on cart page and apply the discount you want. Reply to this comment
Gina On 22 Nov 2012
Hi, i am not conversant in anyway with this application. i sell baby clothing and i have a web designer set up my opencart website. Could you kindly guide me on how to achieve the above explanation. wher do i run the query and where do i find the dates. I need to set up 20% discoumnt for all my products but i don't know how to achieve this. Many tks in advance for your help. Gina Reply to this comment

Write a comment

Your Name:


Enter the code in the box below:

Your Comment:
Note: HTML is not translated!