2013-04-16 2 views
1

magento wishlist에 문제가 있습니다. 내 가게에는 4 가지 언어 (DE/EN/FR/IT)가 있습니다. 상점 언어가 내가 여기를 닮아 스레드 Magento Not Translating Wishlist Product Name and DescriptionMagento 위시리스트의 언어가 잘못되었습니다

가 알고 영어, 프랑스어 등 로 설정되어있는 경우에 상관없이 모든 잘 작동하지만 위시리스트에 제품 이름과 설명 (이탈리아에서) 잘못된 언어로 표시됩니다

그러나 $product = $this->_getData('product');을 제거해도 문제가 해결되지 않습니다. 제품 이름과 설명이 기본 언어 인 독일어로만 변경됩니다.

// 해결책 //

나는 마침내 그것을 얻었다. 가장 완벽한 솔루션은 아니지만 작동하는 것입니다. /app/code/core/Mage/Wishlist/Model/Item.php에서 public function getProduct() 에서 이런 $product = $this->_getData('product'); 라인을 제거하고, 첨가 된 다음이어서

$store_id = Mage::app()->getStore()->getStoreId(); 

I 변경됨 : $product = Mage::getModel('catalog/product') ->setStoreId($this->getStoreId()) ->load($this->getProductId()); 에 :

$product = Mage::getModel('catalog/product') 
      ->setStoreId($store_id) 
      ->load($this->getProductId()); 

답변

0

해결책 주셔서 감사합니다. 여러 제품을 다시로드하지 않으려면 해당 코드를 다음으로 변경했습니다.

public function getProduct() { 
$product = null; 
$current_store_id = Mage::app()->getStore()->getStoreId(); 

if (!$this->getProductId()) { 
    Mage::throwException(Mage::helper('wishlist')->__('Cannot specify product.')); 
} 

if($this->_getData('last_store_id') != $current_store_id){ 
    $product = Mage::getModel('catalog/product') 
    ->setStoreId($current_store_id) 
    ->load($this->getProductId()); 
} else { 
    $product = $this->_getData('product'); 
} 

$this->setData('product', $product); 
$this->setData('last_store_id', $current_store_id); 

/** 
* Reset product final price because it related to custom options 
*/ 
$product->setFinalPrice(null); 
$product->setCustomOptions($this->_optionsByCode); 
return $product;} 
관련 문제