我在 Magento 中使用 Iptrack 扩展。根据 IP 检测,将显示产品的以下规格(如果适用);规格 - 它是产品的属性。
如果 IP 来自英国或美国且语言为英语:显示所有 I 和 G 规格
其他 IP 和语言:显示所有 M 和 G 规范
这就是属性的来源attributes.phtml:
<?php
    $_helper = $this->helper('catalog/output');
    $_product = $this->getProduct()
?>
<?php if($_additional = $this->getAdditionalData()): ?>
    <h2><?php echo $this->__('Additional Information') ?></h2>
    <table class="data-table" id="product-attribute-specs-table">
        <col width="25%" />
        <col />
        <tbody>
        <?php foreach ($_additional as $_data): ?>
            <tr>
                <th class="label"><?php echo $this->htmlEscape($this->__($_data['label'])) ?></th>
                <td class="data"><?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
            </tr>
        <?php endforeach; ?>
        </tbody>
    </table>
    <script type="text/javascript">decorateTable('product-attribute-specs-table')</script>
<?php endif;?>
倾倒$_data里面foreach给我喜欢
array(3) { ["label"]=> string(19) "Diameter D (inches)" ["value"]=> string(7) "2 11/16" ["code"]=> string(4) "i062" } Diameter D (inches)
一个循环。
也许有人遇到同样的问题?谢谢你。