TransWikia.com

Magento 2 - Get custom attribute of child products of a configurable

Magento Asked by Jackom on August 30, 2020

I tried to get value of my custom attribute of child products in product details of a configurable but without success.

This is my code but not work:

$simple_collection = $_product->getTypeInstance()->getUsedProducts($_product);
foreach($simple_collection as $simple_product){
echo $simple_product->getResource()->getAttribute('my_custom_attribute')->getFrontend()->getValue($simple_product);
}

Thanks for any help

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP