如何获得所有拥有/包含追加销售产品的产品。
谢谢
答案 0 :(得分:0)
<?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;
?>