When I get the product collection with :
$collection = Mage::getModel('catalog/product')->getCollection();
I get a group_price key but it’s empty. (product have group_price)
Array
(
[entity_id] => 1
[entity_type_id] => 4
[attribute_set_id] => 2
[type_id] => simple
[sku] => 00000
......
[group_price] => Array
(
)
......
)
And if I load the product I can get the group_price data with :
$product_id = '1';
$product = Mage::getModel('catalog/product')->load($product_id);
$group_price = $product->getData('group_price');
I tried different query with join() or joinTable() or joinLeft() with table ‘catalog_product_entity_group_price’ but without success.
How to join group_price data to the collection with a join query ?
I would like to avoid iterating the collection to load each product and get the group_price.
2
Answers
Try to set the product in foreach loop and then get group price
I extended product collection class and added this function