How to assign products in category by programmability in magento
To Add Product to Category:
Mage::getSingleton('catalog/category_api')->assignProduct($category->getId(),$product->getId());
To Remove product from category:
Mage::getSingleton('catalog/category_api')->removeProduct($category->getId(),$product->getId());
To Add Product to Category:
Mage::getSingleton('catalog/category_api')->assignProduct($category->getId(),$product->getId());
To Remove product from category:
Mage::getSingleton('catalog/category_api')->removeProduct($category->getId(),$product->getId());
No comments:
Post a Comment