1

*$parent_category* には N 個の子カテゴリがあります。*$excluded_child_category* に属するものを除いて、*$parent_category* からすべての製品を取得するにはどうすればよいですか?

親カテゴリを取得する方法は次のとおりです。

$collection = Mage::getModel( 'catalog/category' )->load( $parent_category_id )->getProductCollection();
4

1 に答える 1

1

このようなことを試してみてください

Mage::getModel( 'catalog/category' )->load( $parent_category_id )->getProductCollection()->addFieldToFilter('entity_id', array('nin' => array('your category id')));
于 2013-03-25T04:40:34.240 に答える