huggettm Posted February 8, 2018 Share Posted February 8, 2018 is there a way to set all products to be discounted by 5% when purchasing one or more? I know it can be done manually - but we have over 5000 skus. Quote Link to comment Share on other sites More sharing options...
Lastwolf Posted February 8, 2018 Share Posted February 8, 2018 (edited) Some SQL queries seems the easiest to me, I tested this out on my old database and it didn't seem to set anything on fire, was 1107 records done in around 2 seconds. I'd make backups beforehand though, I'm mostly a liability when allowed near the database directly. Baring in mind this will do some weird stuff to any existing data that you have the price_quantity sheet, I just deleted all the data that was in there before hand cause it didn't matter to me, your mileage may vary. INSERT `CubeCart_pricing_quantity` (`price`, `product_id`) SELECT `price`, `product_id` FROM `CubeCart_inventory` UPDATE `CubeCart_pricing_quantity` SET `quantity` = 2 UPDATE `CubeCart_pricing_quantity` SET `price` = `price` * 0.95 Edited February 8, 2018 by Lastwolf Quote Link to comment Share on other sites More sharing options...
huggettm Posted February 8, 2018 Author Share Posted February 8, 2018 Thanks, but it didnt like that Error Static analysis: 5 errors were found during analysis. Unexpected token. (near "`price`" at position 36) Unexpected beginning of statement. (near "`price`" at position 36) Unexpected beginning of statement. (near "`product_id`" at position 45) A new statement was found, but no delimiter between it and the previous one. (near "UPDATE" at position 119) This type of clause was previously parsed. (near "UPDATE" at position 178) SQL query: INSERT `CubeCart_pricing_quantity` (`price`, `product_id`) SELECT `price`, `product_id` FROM `CubeCart_inventory` UPDATE `CubeCart_pricing_quantity` SET `quantity` = 2 UPDATE `CubeCart_pricing_quantity` SET `price` = `price` * 0.95 MySQL said: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPDATE `CubeCart_pricing_quantity` SET `quantity` = 2 UPDATE `CubeCart_pric' at line 4 Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 8, 2018 Share Posted February 8, 2018 Somehow, the queries have been strung together. Please try one at a time. Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted February 9, 2018 Share Posted February 9, 2018 On 2/8/2018 at 5:01 PM, bsmither said: Somehow, the queries have been strung together. Please try one at a time. There is no ";" at the end of your queries and if all are copied and pasted together then will be executed as one (or at least attempted) Quote Link to comment Share on other sites More sharing options...
Lastwolf Posted February 12, 2018 Share Posted February 12, 2018 I get scared, so I don't like to do multiple queries at once. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.