1

I want get attribute by [attribute_group_code]. Please help me. My code is as follows:

<?php $product = $this->getProduct(); $attributeSetId = $product->getAttributeSetId(); $groupCollection = $this->groupCollectionFactory->create() ->setAttributeSetFilter($attributeSetId) ->setSortOrder() ->load(); foreach ($groupCollection as $group) : $attributes = $product->getAttributes(); echo "<pre>"; print_r ($group->getData()); echo "</pre>"; ?> Return : Array ( [attribute_group_id] => 21 [attribute_set_id] => 4 [attribute_group_name] => Operate [sort_order] => 3 [default_id] => 0 [attribute_group_code] => operate [tab_group_code] => ) // Get attrubte value , label <?php endforeach; ?> 

Thank you.

1 Answer 1

0

I just want to get these attribute groups (operate) values. based on ['attribute_group_code']. Because when creating the group attribute in admin, I will not know the id of the group attribute, so I only rely on the attribute_group_code. Thank you for your support

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.