How to bring the attribute value of the simple product associated with bundle or configurable product on product detail page
-
16-10-2019 - |
Question
We are building a website having bundles product. I want to display the attributes of the simple product associated with bundle product on bundle product detail page. I guess it is possible as if name and price can be retrieved attributes too can be.
I was searching through bundle/catalog/product/view/type/bundle/option
but didn't find any solution. I tried using getAttributeName
, getAttributeText
etc they didn't work.
I know the answer is somewhere around there. Can anyone guide me on this.
Thanks
Solution
You can get the list of bundled product and then do whatever you want with them (e.g. load model, get attributes etc.):
$product->getTypeInstance(true)->getChildrenIds($product->getId(), false);
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange