Magento 1.9 - 获取所有包含加售的产品
Magento 1.9 - Get all products that contain upsell
我如何获得所有包含/包含加售产品的产品。
谢谢
<?php
$_products = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('id');
foreach ($_products as $product){
$_product = Mage::getModel('catalog/product')->load($product);
if (count($_product->getUpSellProductIds()) > 0) :
echo $_product->getName()." has upsell products.";
endif;
?>
我如何获得所有包含/包含加售产品的产品。
谢谢
<?php
$_products = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('id');
foreach ($_products as $product){
$_product = Mage::getModel('catalog/product')->load($product);
if (count($_product->getUpSellProductIds()) > 0) :
echo $_product->getName()." has upsell products.";
endif;
?>