Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Magento(1.6 社区版)中,我如何找到产品属性集的值?
例如,有一个产品具有名为 T 恤的属性集,具有性别、衬衫尺寸和颜色等属性。从 $_product 对象开始,我如何找到属性的值,例如 Mens、Green、Large?
您可以尝试以下方法:
$attributes = Mage::getModel('catalog/product_attribute_api')->items($_product->getAttributeSetId()); foreach($attributes as $_attribute){ var_dump($_product->getData($_attribute['code'])); }