Skip to main content
7 votes
Accepted

Add additional select attributes to grouped product's child collection

For adding additional attributes for child in grouped product, add code like this to a Plugin/Model/Product/Type/GroupedPlugin.php file in your extension (this example assumes your extension is ...
Andrew S's user avatar
6 votes

Show Grouped product price in catalog view as sum of associated products in grouped product

I just had the same requirement. For a quick solution copy theme file Magento_GroupedProduct\templates\product\price\final_price.phtml to your custom theme and sum prices in template with <?php ...
skymeissner's user avatar
6 votes
Accepted

Remove SKU only for grouped products

Create catalog_product_view_type_grouped.xml under your module like below path: app/code/Vendor/Module/view/frontend/layout/catalog_product_view_type_grouped.xml OR create under app/design/...
Sukumar Gorai's user avatar
5 votes

Get Grouped Products Associated Child Product Custom Attribute

[Not sure if it's the correct way] Take a look at vendor/magento/module-grouped-product/Model/Product/Type/Grouped.php public function getAssociatedProducts($product) { ... ->...
Khoa TruongDinh's user avatar
4 votes

how to get min/max regular price for a grouped product in list.phtml?

I know this question has been asked while ago, but I'm gonna answer it anyway if it helps anyone. So one thing you could try is following which would work in some instances, $_product->...
Thanu's user avatar
  • 151
4 votes

Magento-2 override template for Group product in my module

This is what I end up doing to override the vendor/magento/module-grouped-product/view/frontend/templates/product/view/type/grouped.phtml template from Magento_GroupedProduct module. Created new ...
Diwaker's user avatar
  • 453
4 votes
Accepted

How to add group product into the cart individually?

Try below code. It should work. <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ // @codingStandardsIgnoreFile /** * Grouped product data ...
Yash Shah's user avatar
  • 2,503
4 votes
Accepted

Get Grouped Products Associated Child Product Custom Attribute

Create di.xml file here in your custom module app/code/Vendor/Module/etc/di.xml Content for this file is.. <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
Kishan Savaliya's user avatar
3 votes
Accepted

Grouped products with no associated products - code not working

You missed the below filter in the product collection ->addAttributeToSelect('*') The name attribute of the products doesn't come with the below line of code. $products = Mage::getModel('...
Sukeshini's user avatar
  • 9,965
3 votes

Magento products packs (assortiment) with size and stock control - like 3-pack or 6-pack

You could create the "6 pack" product as a bundle with one required dropdown option, call it "size". Add the S, M and L simple products as selections for this option with a default qty of 6 and "...
Fabian Schmengler's user avatar
3 votes

Apply catalog rule to grouped product

If the product added to the cart is child of a grouped, we have to look for the category of the grouped and not of the simple. For this, I have done the next: Create one file Vendor/Module/etc/di....
raumatbel's user avatar
  • 1,255
3 votes
Accepted

How to redirect simple products to the parent grouped product?

Here is a workaround did. I created a text attribute and allowed it to be searchable on the front-end. Then I added the SKU's of the associated simple products to that attribute on the grouped product ...
Will Cousin's user avatar
3 votes
Accepted

Grouped product (simple product sorting on price) Magento 2

Override public function getAssociatedProducts($product) of this file: vendor/magento/module-grouped-product/Model/Product/Type/Grouped.php in this function you have to remove setPositionOrder() ...
Satish Dubariya's user avatar
2 votes

Handling grouped product attributes

Why not create an attribute that tells it what attributes to show? I ended up creating a module that loads the value of two text attributes for grouped products that are attribute code strings. ...
asherrard's user avatar
  • 226
2 votes
Accepted

Magento2 cannot override class Magento\GroupedProduct\Model\Product\Type\Grouped?

Modifying the file app/code/Best/CustomGrouped/etc/module.xml to load my custom module after the core module worked for me. <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
Sukeshini's user avatar
  • 9,965
2 votes

How to get details of single products of a grouped product in observer

Try below code : public function catalogProductTypePrepare($observer) { $quote = Mage::getSingleton('checkout/session')->getQuote(); $product = $observer->getEvent()->...
Manashvi Birla's user avatar
2 votes

Magento2 How to Check any simple product is a child of grouped product

Product relations in Magento is stored in catalog_product_relation table. So you can check if the particular simple product has any data present in the table to check if it has any parent product. ...
Venkatesh's user avatar
2 votes
Accepted

Get custom product attribute by product-id in Grouped Product

I done with this code: $my_attr = $this->getProduct()->getResource()->getAttributeRawValue($_item->getId(),'attribute_code',$_item->getId()); I added this code in app\design\frontend\Company\...
Sharma's user avatar
  • 123
2 votes

M2- How to get thumbnails of associated products on a grouped product from image cache

Just overwrite the file in the custom theme app/design/frontend/Vendor/Theme/Magento_GroupedProduct/templates/product/view/type/grouped.phtml and paste the code in your phtml file <?php $block-&...
Divya 's user avatar
  • 412
2 votes
Accepted

Magento 2 Plugin Not Extending Model - Finally Solved It

After many many days of banging my head on a wall, I've finally solved it. I had two modules set up originally: Mynamespace\Grouped\ Mynamespace\Plugingrouped Nothing I did would make the plugin ...
wjp_bill's user avatar
  • 330
2 votes
Accepted

Display thumbnail of child images in grouped product page

Copy the following file: vendor/magento/module-grouped-product/view/frontend/templates/product/view/type/grouped.phtml to: app/design/frontend/Vendor/theme/Magento_GroupedProduct/templates/...
Sukumar Gorai's user avatar
2 votes

Difference between Configurable vs Grouped Product?

Configurable Product: 1.It is like a ‘’simple product’’ with its multiple attributes. 2.You cannot add multiple associated products of configurable product to cart 3.With Magento 2 configurable ...
surbhi agr's user avatar
2 votes
Accepted

product reviews - "around" plugin extend CollectionFactory query to show children reviews

try again with the plugin approach and replace $target->_select->join( with $target->getSelect()->join( and $target->getReviewEntityTable(); with $target->getTable('review_entity'...
Marius's user avatar
  • 198k
2 votes
Accepted

How to get associated product Id's from grouped product Id?

Try this $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $parent_pro = $objectManager->create('Magento\Catalog\Model\Product')->load($productId); $_children = $parent_pro-...
Msquare's user avatar
  • 9,173
2 votes
Accepted

main.CRITICAL: Exception: Deprecated Functionality: array_key_exists(): Using array_key_exists() on objects is deprecated

Since PHP 7.4 the function array_key_exists allows only array and doesn't support ArrayObject anymore The method getPost from Request returns \Laminas\Stdlib\Parameters which extends from ArrayObject ...
Victor Tihonchuk's user avatar
1 vote
Accepted

Geting list of associated products of group product

You assign all product to one variable $associatedProducts, you should use array instead of it. Try to get them in such way $associatedProducts = array(); $products = Mage::getModel('catalog/product')...
olkuznw's user avatar
  • 146
1 vote
Accepted

How to get grouped products in a product collection Magento 2

protected $productCollectionFactory; public function __construct( ... \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory .... ) { .... $this-&...
Keyur Shah's user avatar
  • 18.1k
1 vote

Get custom product attribute by product-id in Grouped Product

I'm interested too in the question. The problem is that you can use the above code for "default" attributes, but not for custom attributes. This works: <?php if ($_hasAssociatedProducts): ?> ...
ALT's user avatar
  • 11
1 vote
Accepted

How to get short description of grouped product

$_assosicatedProducts does not holds all the informations like short description. $_item holds only following informations Array ( [entity_id] => 33 [attribute_set_id] => 13 [...
Mike's user avatar
  • 1,148
1 vote

Magento2 How to Check any simple product is a child of grouped product

Via object manager $parentId = 1234; $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $childIds = $objectManager->create('Magento\GroupedProduct\Model\Product\Type\Grouped')...
Joel Davey's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible