MAGENTO 1.7 - List.phtml在产品名称旁边显示不需要的“否”

时间:2013-02-28 15:31:09

标签: php magento

这就是它的样子: "no"

这是我的代码:

           <div class="product-name">
               <h22><?php echo (($_product->getResource()->getAttribute('hersteller')->getFrontend()->getValue($_product) && $_product->getResource()->getAttribute('hersteller')->getFrontend()->getValue($_product) != "Nein") ? $_product->getResource()->getAttribute('hersteller')->getFrontend()->getValue($_product) : ''); ?>
               <?php echo (($_product->getResource()->getAttribute('weingut')->getFrontend()->getValue($_product) && $_product->getResource()->getAttribute('weingut')->getFrontend()->getValue($_product) != "Nein") ? $_product->getResource()->getAttribute('weingut')->getFrontend()->getValue($_product) : ''); ?>
               <?php echo (($_product->getResource()->getAttribute('ob_hersteller')->getFrontend()->getValue($_product) && $_product->getResource()->getAttribute('ob_hersteller')->getFrontend()->getValue($_product) != "Nein") ? $_product->getResource()->getAttribute('ob_hersteller')->getFrontend()->getValue($_product) : ''); ?></h22></div>

奇怪的是,“不”仅出现在英文版中。我们修改了list.phtml以显示公司或制造商或葡萄园。

2 个答案:

答案 0 :(得分:1)

您正在检查某些属性是否为“Nein”,如果没有则显示。此属性似乎在英语中翻译为“否”。

答案 1 :(得分:1)

如果与你所显示的'Nein'不同,你检查你的价值是否等于'Nein'。

在英文版中,它不是'Nein'它不是,所以它总是显示出来。

您应该在文件中更改它或使用Magento的翻译功能。