Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. $category = Mage::getModel('catalog/category')->load(176);
  2. $productCollection = $category->getProductCollection();
  3. foreach($productCollection as $p){
  4.  
  5. Mage::getSingleton('catalog/category_api')
  6. ->removeProduct(176,$p->getId());
  7. }
  8.  
  9. $category = Mage::getModel('catalog/category')->load(176);
  10. $category->setPostedProducts(array());
  11. $category->save();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement