Hello Friends,
Get specific attribute collection by attribute group id in product page. Use below code. First get your group id and attribute_set_id in eav_attribute_group table.
Then use this code.
//$_product is current product object
$productAttributes = $_product->getAttributes();
$group_id = 104; //Past Your Attribute Group Id
$attributeSetId = 16; //Past Your Attribute Set Id
foreach ($productAttributes as $attribute) {
if ($attribute->isInGroup($attributeSetId, $group_id)) {
if ($attribute->getFrontend()->getValue($_product)) {
echo 'Attribute Label: '.$attribute->getFrontendLabel().'<br>';
$valueArray = explode(",",$attribute->getFrontend()->getValue($_product));
foreach ($valueArray as $valuesArray) {
echo 'Attribute Value: '.$valuesArray;
echo '<br>';
}
}
}
}
Informative post. Thanks for sharing.
ReplyDeletepopup plugin for WordPress
This comment has been removed by the author.
ReplyDeleteIm no expert, but I believe you just made an excellent point. You certainly fully understand what youre speaking about, and I can truly get behind that. kardinal stick
ReplyDelete