我正试图让我的magento商店列出特定衬衫的尺寸,但它只返回一个数字而不是大,中等。以下是我的代码。
<?php if($_product->getSize()): ?>
<p>Size: <?php echo $_product->getSize();?> </p>
<?php endif; ?>
答案 0 :(得分:0)
您需要使用$_product->getAttributeText('size')
,该属性可能不是 size ,才能获得$_product->getAttributes()
的输出列表视图。