當我拿到的產品集合搭配:Magento的 - 加入group_price產品集合
$collection = Mage::getModel('catalog/product')->getCollection();
我得到一個group_price關鍵,但它是空的。 (產品有group_price)
Array
(
[entity_id] => 1
[entity_type_id] => 4
[attribute_set_id] => 2
[type_id] => simple
[sku] => 00000
......
[group_price] => Array
(
)
......
)
如果我加載產品,我可以得到group_price數據提供:
$product_id = '1';
$product = Mage::getModel('catalog/product')->load($product_id);
$group_price = $product->getData('group_price');
我嘗試不同的查詢使用join()方法或joinTable()或joinLeft()與表'catalog_product_entity_group_price'但沒有成功。
如何使用連接查詢將group_price數據加入集合?
我想避免迭代集合來加載每個產品並獲取group_price。