I need to get all the attribute group id associated with the product.
Code:
$product_coll = $block->getProduct($product_id);
$pattr = $product_coll->getAttributeSetId();
$attrCodes = $block->getProductAttrData($pattr);
foreach($attrCodes as $attrCode)
{
echo $attrCode->getDefaultFrontendLabel().'<br>';
$code = $attrCode->getAttributeCode().'<br>';
echo $product_coll->getData($code).'<br>';
echo $block->getProductAttrValue($product_id, $code).'<br>';
}
I want to filter the attribute with it's group or group name "product details".
Any help appreciated.
Best Answer
Block function
In html file