e.g.
I have 400 products with a specific price.
Now my wholesale increased prices for all products.
Have I to increase all 400 products prices one by one?It's a hard long job!
So I'm looking for something that do this automaticaly for all products in stock.
I have 400 products with a specific price.
Now my wholesale increased prices for all products.
Have I to increase all 400 products prices one by one?It's a hard long job!
So I'm looking for something that do this automaticaly for all products in stock.
The easiest way is to run a very simple query on the database using, for example, phpmyadmin.
It would simply be something like:
UPDATE product SET price = (price * 1.05)
(product is the table name which would be slightly different if you specified a pre-fix such as oc_product)
It would simply be something like:
UPDATE product SET price = (price * 1.05)
(product is the table name which would be slightly different if you specified a pre-fix such as oc_product)
Last edited by mystifier on Fri Sep 03, 2010 5:27 pm, edited 1 time in total.
Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products
Price is defined as decimal(15,4) and formatted by currency so it should be okay but I guess
UPDATE product SET price = ROUND(price * 1.05, 2)
is cleaner, rounding to the nearest whole cent/penny.
UPDATE product SET price = ROUND(price * 1.05, 2)
is cleaner, rounding to the nearest whole cent/penny.
Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products
It was an example. In your case, use 1.03
It is not a mod; just a query to run on the database.
It is not a mod; just a query to run on the database.
Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products
1.03 is 3%, 30% is 1.30
As for the rounding and formatting, mysql will take care of all that anyway (and it actually rounds it up when you put it in)
As for the rounding and formatting, mysql will take care of all that anyway (and it actually rounds it up when you put it in)
Code: Select all
mysql> INSERT INTO `tmp` VALUES ('5.0000');
Query OK, 1 row affected
mysql> SELECT num FROM `tmp`;
+-----+
| num |
+-----+
| 5 |
+-----+
1 row in set
mysql>
Who is online
Users browsing this forum: No registered users and 298 guests