[英]MAGENTO 1.7 - List.phtml displaying an unwanted “No” next to product name
這就是它的樣子:
這是我的代碼:
<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以顯示公司或制造商或葡萄園。
您正在檢查某些屬性是否為“Nein”,如果沒有則顯示。 此屬性似乎在英語中翻譯為“否”。
如果與你所顯示的'Nein'不同,你可以檢查你的價值是否等於'Nein'。
在英文版本中它不是'Nein'它不是所以它總是顯示。
您應該在文件中更改它或使用Magento的翻譯功能。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.