简体   繁体   English

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

[英]MAGENTO 1.7 - List.phtml displaying an unwanted “No” next to product name

This is what it looks like: 这就是它的样子: “没有”

And this is my code: 这是我的代码:

           <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>

Strangely the "no" only appears in the english version. 奇怪的是,“不”只出现在英文版中。 We modified the list.phtml to show the company or manufacturer or vineyard. 我们修改了list.phtml以显示公司或制造商或葡萄园。

You are checking if some attribute is "Nein" and display it if not. 您正在检查某些属性是否为“Nein”,如果没有则显示。 This attribute seems to be translated to "No" in English. 此属性似乎在英语中翻译为“否”。

You check if you value is equal to 'Nein' if different to 'Nein' you show it. 如果与你所显示的'Nein'不同,你可以检查你的价值是否等于'Nein'。

In the english version it's not 'Nein' it's no so it always show. 在英文版本中它不是'Nein'它不是所以它总是显示。

You should change it in your files or use the translation feature of Magento. 您应该在文件中更改它或使用Magento的翻译功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM