cutecube Posted February 29, 2016 Share Posted February 29, 2016 I have over 250 items in my shop with most having some discount applied. I'd like to access the database directly with sql and remove ALL discounts. Manually, if I remove the discount from one item, and click 'save', I don't know what process CC goes through to update the necessary fields in the db. Questions: If I zero out the discount field of all products in the db, will CC handle everything else automatically? e.g. recalculate the final price, remove items from the 'sale' section, etc.? If not, which db field(s) do I have to modify directly with sql to remove all discounts from all products? I really don't want to edit every item manually. Is there an easier way to accomplish this? Quote Link to comment Share on other sites More sharing options...
keat Posted February 29, 2016 Share Posted February 29, 2016 I'm not sure what you mean by discounts, are these sale prices or price breaks. If you remove just one item and watch the results, you'll see the sql command in green at the top. You can copy this and paste it into the sql tab. Then you'll need to modify it slightly to make it do what you want. Change the product_id at the end to >1 and it will run the query on all products. I'll assume that you are wanting to remove the sale prices from all items, then use this. UPDATE `your-database-name`.`CubeCart_inventory` SET `sale_price` = '0.00' WHERE `CubeCart_inventory`.`product_id` >1; Quote Link to comment Share on other sites More sharing options...
cutecube Posted February 29, 2016 Author Share Posted February 29, 2016 Yes, that's exactly what I want to do. Sorry I wasn't clear by my use of 'discounts'. I just want to remove all 'sale' prices. Thanks for clearing that up. Also, thanks for the sql statement. Quote Link to comment Share on other sites More sharing options...
bsandall Posted February 29, 2016 Share Posted February 29, 2016 product_id > 1 will skip the product with id 1, if it exists. If you want to affect ALL rows, just remove the WHERE clause entirely: UPDATE CubeCart_inventory SET sale_price=0.00; Quote Link to comment Share on other sites More sharing options...
cutecube Posted February 29, 2016 Author Share Posted February 29, 2016 Got it. Thanks. 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.