Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

как массово удалить все фото нужных товаров?


 Share

Recommended Posts

Добрый гдень.

Есть товары с могделью 111-ХХХХ (ггде ХХХХ это артикул). Нужно удалить ВСЕ фото привязанные к ним. Не сами файлы а пути в базе, чтобы товары зналились без фото.

Как это можно сгделать аккуратно? спасипотому что

Link to comment
Share on other sites


7 минут назад, chukcha сказал:

1. update oc_product SET image = '' WHERE model LIKE '111-____'

2 update oc_product SET image = '' WHERE model = CONCAT('111-', sku)

 

Спасипотому что вам!

Link to comment
Share on other sites


Основные фото стерлись что логично, но осились пути к доп фото в иблиэто oc_product_image, и им WHERE не катит тк могдели нет в иблиэто

Это не стереть икже?

Link to comment
Share on other sites


4 минуты назад, chukcha сказал:

Не просили :)

 

 

DELETE pi  FROM oc_product_image pi
LEFT JOIN oc_product p ON p.product_id = pi.product_id

WHERE
1.
WHERE model LIKE '111-____'

2. model = CONCAT('111-', sku)

огонь! все вышло! спасипотому что за помощь и угделенное время

запишу себе способы, пригодятся)

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.