Magento - load only configurable products

后端 未结 6 1513
北荒
北荒 2020-12-01 05:10

I have the following code:

$_productCollection = $this->getLoadedProductCollection();

foreach ($_productCollection as $_product)
{
  if ($_product->_d         


        
6条回答
  •  执念已碎
    2020-12-01 05:18

    The way you're doing this requires all products to be loaded before you parse through and filter them. This is probably closer to what you're looking for:

    $_productCollection = $this ->getLoadedProductCollection()
                                ->addAttributeToFilter('type_id','configurable');
    

提交回复
热议问题