I have changed the product code for products I already have and sold.
Now, The new orders are shown with the correct code but in old orders, the product code still remains the same as the old one. Is there anyway to have it changed?
I checked cscart_order_details table and found the products in each order. Is there any bad impact or corruption if I change the product code to the new one? Will it get corrected the way I want? How I change these codes (more than 1000 orders) in one command?
I found this but I am not sure if it will work correctly:
UPDATE table_name
SET field_name = replace(same_field_name, 'unwanted_text', 'wanted_text')
Sure, please give more details about your task. E.g.
UPDATE cscart_products SET product_code = product_id * 1000;
Hello,
In cscart_order_details, I need to change the product code based on the product ID.
For example, I have 4 products, all of them has no product code. I need to give them a code but it will be depending of the Product ID. So I want to give the code XYZ to the product ABC which has an ID# 12345 and so on.
I used the product ID because it is the only common thing between the products in that table.