如何根据类别过滤添加到心愿单中的magento产品
问题描述:
答
注:没有测试。这里没有什么袖珍手段。
// ID of the category you wish to filter by
$category_id = 35;
// Instantiate a category model and load it
$_category = Mage::getModel('catalog/category')->load($category_id);
// Grab the wishlist collection
$_wishlistCollection = Mage::helper('wishlist')->getWishlistItemCollection();
// Filter it by category as you would any normal collection
$_wishlistCollection->addCategoryFilter($_category);
然后做你的正常收集迭代。