Jump to content

[Resolved] Direct DB access?


cutecube

Recommended Posts

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?

 

Link to comment
Share on other sites

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;

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...