0

When I get the product collection with :

$collection = Mage::getModel('catalog/product')->getCollection();

I get the group_price key but it's empty.

 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 = Mage::getModel('catalog/product')->load($product_id);
$group_price = $product->getData('group_price');

I tried different query with joinField() or joinTable() 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.

1 Answer 1

0

Use ->addAttributeToSelect('group_price')

1
  • I use ->addAttributeToSelect() with some attributes, eg 'color'. This add the value to the collection.. unfortunately not for 'group_price'
    – vhanahrni
    Commented Jul 23, 2017 at 11:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.