产品的属性是一个非常重要的功能,我们经常会用到。在这篇文章中我将总结的一些产品属性信息的输出方法跟大家分享一下。

1、获取属性集合

$attribute = $_product->getResource()->getAttribute(‘attribute_code’); 

2、获取属性类型

$attribute->getAttributeType(); 

3、获取属性Label

 $attribute->getFrontendLabel(); 

4、获取属性默认值

$attribute->getDefaultValue(); 

5、获取属性设置值

$attribute->getFrontend()->getValue($_product); 

6、检查属性是否可见

$attribute->getIsVisible(); 

7、检查属性是否是必填项

$attribute->getIsRequired();

360magento提供专业的基于magento系统的电商网站开发服务,如有需求或相关咨询,请与我们联系