How to remove all catalog products in Magento

前端 未结 6 1488
一个人的身影
一个人的身影 2021-02-04 17:42

I\'ve trying to import a products list to magento. In the firsts test, I got success, but the products were not showing up in back or front office.

After redo the impor

6条回答
  •  伪装坚强ぢ
    2021-02-04 18:19

    Delete products with a SQL query is not the Magento way and I recommend not doing it. It may cause database corruption or problems with the foreign key indexes/constraints as stated here.

    Everybody interested in using a correct, safe and also fast way to alter things in Magento should ALWAYS use Magento's ORM functions.

    In this case this would be in a php script.

    Mage::getModel('catalog/product')->getCollection()->delete();
    

    This is the only safe way in Magento.

提交回复
热议问题