I
I
Ivan Medvedev2020-06-08 10:57:02
SQL
Ivan Medvedev, 2020-06-08 10:57:02

How to bulk replace the SKU of Opencart products?

There is a task to replace the SKU of products in a certain category. There are more than 1000 such products on the search. Handles sorting through everything is a dreary business. How to speed up the process? Maybe there is some query in the database or some module?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Tsvetkov, 2020-06-08
@tsklab

UPDATE товаров SET SKU = заменить WHERE категории = определенной

R
roman-ermolin, 2020-06-08
@roman-ermolin

1) Get a list of product ids of the desired category:
SELECT `product_id` FROM `oc_product_to_category` WHERE `category_id` = '1111'
2) Next
UPDATE `oc_product` SET `sku` = '2222' WHERE `product_id` = '$id'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question