SHARE
TWEET

Untitled

a guest Jun 19th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $attributeSetId = 20;//your_attributeSetId
  2.     $attributeSet = $this->objectManager->create('MagentoEavApiAttributeSetRepositoryInterface');
  3.     $attributeSetRepository = $attributeSet->get($attributeSetId);
  4.     $attribute_set_name = $attributeSetRepository->getAttributeSetName();
  5.     $attributeGroupCollection = $this->objectManager->get ( 'MagentoEavModelEntityAttributeGroup' )->getCollection ();
  6.     $attributeGroupCollection->addFieldToFilter ( 'attribute_group_name', $attribute_set_name );
  7.     $attributeGroupCollection->addFieldToFilter ( 'attribute_set_id', $attributeSetId );
  8.     $attributeGroupId = '';
  9.     foreach ( $attributeGroupCollection as $attributeGroup ) {
  10.         $attributeGroupId = $attributeGroup->getId ();
  11.         break;
  12.     }
  13.     $attributeCollection = $this->objectManager->get ( 'MagentoEavModelEntityAttribute' )->getCollection ();
  14.     $attributeCollection->setAttributeSetFilter ( $attributeSetId );
  15.     $attributeCollection->setAttributeGroupFilter ( $attributeGroupId );
  16.  
  17.     echo "<pre>";
  18.     print_r($attributeCollection->getData());
  19.      
  20. $attributeSetId = 20;//your_attributeSetId
  21. $productAttributesManagement = $this->objectManager->create('MagentoCatalogApiProductAttributeManagementInterface');
  22. $productAttributes = $productAttributesManagement->getAttributes($attributeSetId);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top