/*-----------Remove product From assign category Start------------- */
$productId=5;
$product=Mage::getModel("catalog/product")->load($productId);
$productIdss=$product->getId();
$all_cats = $product->getCategoryIds($productIdss);
foreach($all_cats as $_catId)
{
$product=Mage::getSingleton('catalog/category_api')->removeProduct($_catId,$productIdss);
}
/*-----------Remove product From assign category End------------- */
$productId=5;
$product=Mage::getModel("catalog/product")->load($productId);
$productIdss=$product->getId();
$all_cats = $product->getCategoryIds($productIdss);
foreach($all_cats as $_catId)
{
$product=Mage::getSingleton('catalog/category_api')->removeProduct($_catId,$productIdss);
}
/*-----------Remove product From assign category End------------- */
Comments
Post a Comment