按magento 2中的产品属性组获取产品属性

瓦卡尔

如何属性集中获取magento 2中的产品属性组我想通过使用组列表页面上显示属性,以便将来可以添加更多属性

卡萨尔·萨蒂(Qaisar Satti)

您只需按以下方式获取所有产品属性 $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 />';
            }

    }

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章