I have a category "new" that I want to assign to, via a daily cron, the most recent 120 products. I am trying to override the product ids assigned to a category. Is there an easy way , like :
$category->setProductIds(array())
it works like this
$category = Mage::getModel('catalog/category')->load($categoryID);
$product_array = $category->getProductsPosition()
... make changes ... format : $item[$product_id] => $position_in_category
$category->setPostedProducts($product_array);
$category->save();
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments