Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $attributeSetId = 20;//your_attributeSetId
- $attributeSet = $this->objectManager->create('MagentoEavApiAttributeSetRepositoryInterface');
- $attributeSetRepository = $attributeSet->get($attributeSetId);
- $attribute_set_name = $attributeSetRepository->getAttributeSetName();
- $attributeGroupCollection = $this->objectManager->get ( 'MagentoEavModelEntityAttributeGroup' )->getCollection ();
- $attributeGroupCollection->addFieldToFilter ( 'attribute_group_name', $attribute_set_name );
- $attributeGroupCollection->addFieldToFilter ( 'attribute_set_id', $attributeSetId );
- $attributeGroupId = '';
- foreach ( $attributeGroupCollection as $attributeGroup ) {
- $attributeGroupId = $attributeGroup->getId ();
- break;
- }
- $attributeCollection = $this->objectManager->get ( 'MagentoEavModelEntityAttribute' )->getCollection ();
- $attributeCollection->setAttributeSetFilter ( $attributeSetId );
- $attributeCollection->setAttributeGroupFilter ( $attributeGroupId );
- echo "<pre>";
- print_r($attributeCollection->getData());
- $attributeSetId = 20;//your_attributeSetId
- $productAttributesManagement = $this->objectManager->create('MagentoCatalogApiProductAttributeManagementInterface');
- $productAttributes = $productAttributesManagement->getAttributes($attributeSetId);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement