fernandokerber Posted August 16, 2012 Share Posted August 16, 2012 (edited) Hi! I have about 500 products in my store and all of them have the same price ($5) Buying Over 30 unities the price should be $3 And over 200 unities the price should be $2,50 I cant create 500 rules (one in each product edit page) for over 30 unities buying. And 500 more rules (one in each product edit page) for over 200 unities buying. How can I do that? I was thinking about run an SQL query right there in phpmyadmin... But I dont know what tables I need to change. Any help, please? thank you in advance EDIT: well, i found the ps_specific_price in phpMyAdmin... and that is my query: <?php $db_host = "localhost"; $db_username = "root"; $db_password = ""; $db_name = "rgs"; $connection = mysql_connect($db_host,$db_username,$db_password) or die(mysql_error()); $databse = mysql_select_db($db_name, $connection) or die(mysql_error()); for ($i = 1; $i <= 600; $i++) { $query = "INSERT INTO `rgs`.`ps_specific_price` (`id_specific_price`, `id_product`, `id_shop`, `id_currency`, `id_country`, `id_group`, `price`, `from_quantity`, `reduction`, `reduction_type`, `from`, `to`) VALUES ('$i', '$i', '0', '0', '0', '0', '3.000000', '30', '0.000000', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00')"; mysql_query($query, $connection); } mysql_close(); ?> Do you think I can run this query? It worked like a charm in my tests ... but i dont know if it is dangerous Edited August 16, 2012 by fernandokerber (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now