Tuesday, 20 February 2018

How to assign products in category by programmability in magento

How to assign products in category by programmability in magento

To Add Product to Category:
Mage::getSingleton('catalog/category_api')->assignProduct($category->getId(),$p‌​roduct->getId());

To Remove product from category:
Mage::getSingleton('catalog/category_api')->removeProduct($category->getId(),$p‌​roduct->getId());

No comments:

Post a Comment