1
votes

I've a problem with the magento wishlist. My store has 4 diffrent languages (DE/EN/FR/IT). All works great but in the wishlist the product name and description are displayed in the wrong language (in Italien) no matter if the store language is set to English, French etc. I know there's a simliar thread here Magento Not Translating Wishlist Product Name and Description

But the suggestion to remove $product = $this->_getData('product'); doesn't solve the problem. It only changes product name and description to the default language, which is German.

//SOLUTION//

I finally got it. I know it's not the most perfect solution but it works. In /app/code/core/Mage/Wishlist/Model/Item.php at public function getProduct() i removed this line $product = $this->_getData('product'); and added the following:

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

Then I changed: $product = Mage::getModel('catalog/product') ->setStoreId($this->getStoreId()) ->load($this->getProductId()); to:

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

1 Answers

0
votes

Thanks for your solution. To avoid multiple product reload, I've changed that code to:

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