Magento中获取特定属性值
<?php echo $_product->getResource()->getAttribute('attr')->getFrontend()->getValue($_product); ?>
//or
<?php echo $_product->getAttributeText('attr'); //string or array ?>
attr就是属性的名字,要想显示其他属性值只需要把attr换成你需要的属性值。
<?php echo $_product->getResource()->getAttribute('attr')->getFrontend()->getValue($_product); ?>
//or
<?php echo $_product->getAttributeText('attr'); //string or array ?>
attr就是属性的名字,要想显示其他属性值只需要把attr换成你需要的属性值。