Jump to content
Sign in to follow this  
u2017

Как отвязать все товары от категории?

Recommended Posts

Как отвязать все товары от категории? В подкатегориях товар должен остаться.

Руками не вариант, много.... Может для этого есть sql запрос?

Share this post


Link to post
Share on other sites

Выбрать все товары из категории и после $this->db->query("DELETE FROM `" . DB_PREFIX . "product_to_category` WHERE product_id = '" . (int)$product_id . "' AND category_id = '". $category_id ."'");

Share this post


Link to post
Share on other sites

@u2017

или 

или удалить эту категорию и создать заново ))))

Share this post


Link to post
Share on other sites

Чет вы, народ, усложняете)
SQL: "DELETE FROM oc_product_to_category WHERE category_id = (id нужной категории)"
oc_ перфикс таблицы, если отличается пишите свой
Запрос в PhpMyAdmin

  • +1 1

Share this post


Link to post
Share on other sites

baster789, воспользовался вашим sql запросом, всё ok. Спасибо.

 

nexus, bitrixlviv, вам тоже спасибо.

 

Share this post


Link to post
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
You are posting as a guest. If you have an account, please sign in.
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.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

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.