2016-09-01 10 views
4

商品の入手方法属性グループマゼンタ2 アトリビュートセットマゼンタの商品属性別商品属性を取得する2

$attributes = $product->getAttributes(); 
foreach ($attributes as $attribute) { 
    $attribute->getCode(); 
} 

参考: 私は私はあなたが以下のようにすべての属性を取得することができ、将来の

答えて

2

あなたは、単に$product->getAttributes();

$productAttributes=$product->getAttributes(); 
     $group_id=9; 
     $attributeSetId=4; 
     foreach ($productAttributes as $attribute) { 
      if ($attribute->isInGroup($attributeSetId, $group_id)) { 
      echo $attribute->getFrontendLabel().' : '.$attribute->getFrontend()->getValue($product).'<br />'; 
      } 

    } 
により、すべての製品属性を取得
関連する問題