2014-03-31 91 views
0

我修改了一下category-list.tpl,讓它看起來像我想的那樣。Prestashop不按語言翻譯產品

當我切換到不同的語言時會出現問題,因爲它會更改類別名稱,但不會更改產品名稱。

CODE:

{if isset($products)} 
    <!-- Products list --> 
    <div class="wrapper" itemscope itemtype="http://schema.org/EducationEvent"> 
      <ul class="accordion"> 
         <li class="nav-dropdown"> 
          <input type="radio" name="accordion" id="{$subcategory.name}" /> 
          <label for="{$subcategory.name}"> 
          <span class="subcat"><h1>{$subcategory.name}</h1></span> 
          <span class="descsubcat">{$subcategory.description|truncate:250:'...'}</span> 
          <br /> 
          </label> 
        <div class="cursos"> 
        {foreach from=$products item=product name=products} 
        {if $products != ''} 
        <div class="float_left"> 
        <div itemprop="name" class="titcurs"><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.name}"><h2>{$product.name|escape:'htmlall':'UTF-8'}</a></h2></div> 
        <div itemprop="description"><p class="product_desc"><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}" >{$product.description_short|strip_tags:'UTF-8'|truncate:600:'...'}</a></p></div> 
        </div> 
        {/if} 
        {/foreach} 
      </li> 
     </ul> 
     </div> 
     {/if} 

忽略所述第一代碼的某些部分。這是什麼顯示產品:

{foreach from=$products item=product name=products} 
        {if $products != ''} 
        <div class="float_left"> 
        <div itemprop="name" class="titcurs"><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.name}"><h2>{$product.name|escape:'htmlall':'UTF-8'}</a></h2></div> 
        <div itemprop="description"><p class="product_desc"><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}" >{$product.description_short|strip_tags:'UTF-8'|truncate:600:'...'}</a></p></div> 
        </div> 
        {/if} 
        {/foreach} 

有什麼意義?爲什麼分類翻譯,而不是產品?

在此先感謝

回答

0

解決了它。

上Category.tpl,我有以下參數的行:

{include file="./product-list-cat.tpl" products=$subcategory_object->getProducts('1','1','100')} 

,並取代它:

{include file="./product-list-cat.tpl" products=$subcategory_object->getProducts($cart->id_lang,'1','100')} 

剛剛修改:getProducts('1','1','100')getProducts($cart->id_lang,'1','100') ,所以它使得產品顯示爲多語言。