2014-10-11 22 views
1

我有2種語言(EN和RU)的Magento商店設置,並且我沒有修改任何後端代碼,顯示tagId顯示產品列表的頁面。按標籤顯示標題的Magento產品列表以錯誤的語言顯示標題

對於俄語標籤,整個頁面以俄語顯示,除了列表中產品的標題,由於某些原因,這些標題仍以英文顯示。有問題的產品有兩種語言的翻譯。

我試着在core /Mage/Tag/Model/Tag.php和/Mage/Tag/Model/Block/Product/List.php中設置storeId,但沒有運氣,默認代碼設置商店標識在/Mage/Tag/Model/Block/Product/Result.php這樣的:

protected function _getProductCollection() 
{ 
    if(is_null($this->_productCollection)) { 
     $tagModel = Mage::getModel('tag/tag'); 
     $this->_productCollection = $tagModel->getEntityCollection() 
      ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes()) 
      ->addTagFilter($this->getTag()->getId()) 
      ->addStoreFilter(Mage::app()->getStore()->getId()) 
      ->addMinimalPrice() 
      ->addUrlRewrite() 
      ->setActiveFilter(); 
     Mage::getSingleton('catalog/product_status')->addSaleableFilterToCollection($this->_productCollection); 
     Mage::getSingleton('catalog/product_visibility')->addVisibleInSiteFilterToCollection(
      $this->_productCollection 
     ); 
    } 

    return $this->_productCollection; 
} 

我搜索過這個問題無處不在,但到處都找不到任何類似的情況。

任何幫助,將不勝感激

回答

1

我通過調試我/app/design/frontend/package/theme/template/catalog/product/list.phtml固定它。我意識到,如果我在「foreach」收集之後得到產品名稱,那麼確定,但之後的某些行不是。

問題是與裝載media_gallery屬性自定義功能:

$product->load('media_gallery') 

我解決了改變成:

$product = Mage::getModel('catalog/product')->load($product->getId()); 

我希望它能幫助你,或者至少你可以調試list.phtml並獲得產品失去其屬性的地方。