0

我必须使用相关产品获取产品列表,该产品作为相关产品添加到简单产品中。我通过了反向查询。

请帮我。谢谢

4

2 回答 2

0

You can pass product id for which you require related product.

E.g You need related product for a particular product (Say $_product)

You can get related product ids by

 $_product->getRelatedProductIds()

You can see array of ids by :

 print_r($_product->getRelatedProductIds()); 

I hope this will help you.

Regards, Manju

于 2013-07-29T09:33:52.123 回答
0

我找到了我的答案。

$collection = Mage::getModel('catalog/product_link')
                ->getCollection();
$related_products = $collection->getData();

foreach ($related_products as $_product){
$_product = Mage::getModel("catalog/product")->load($_product['linked_product_id']);
}

它为我工作。

于 2013-07-29T10:04:40.970 回答