商品の入手方法属性グループマゼンタ2 アトリビュートセットマゼンタの商品属性別商品属性を取得する2
$attributes = $product->getAttributes();
foreach ($attributes as $attribute) {
$attribute->getCode();
}
参考: 私は私はあなたが以下のようにすべての属性を取得することができ、将来の
商品の入手方法属性グループマゼンタ2 アトリビュートセットマゼンタの商品属性別商品属性を取得する2
$attributes = $product->getAttributes();
foreach ($attributes as $attribute) {
$attribute->getCode();
}
参考: 私は私はあなたが以下のようにすべての属性を取得することができ、将来の
あなたは、単に$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 />';
}
}
により、すべての製品属性を取得
でより多くの属性を追加することができるようにグループを使用して一覧ページの属性を示したいと思います。 https://magento.stackexchange.com/questions/98945/magento-2-how-can-i-get-all-product-attributes-and-get-the-value-yes-no