When I select a child product of a configurable product, and add it to the cart the correct simple child product image is displayed in the cart.
However if I add the same child product to the wishlist
, the parent configurable product image is displayed.
I found the setting in Magento back end that controlled which image would be displayed in the cart, but I couldn't find a similar setting for the wishlist
.
I also have been trying to fix this situation by changing the code in
app/design/frontend/customtheme/default/template/wishlist/item/column/image.phtml.
However I have been unsuccessful.
Any help would be appreciated! Thanks
This is the code I have done so far; however now I don't have any image being displayed in my Wishlist
. The file I am modifying is
app/design/frontend/customtheme/default/template/wishlist/item/column/image.phtml
and code is below
<?php
$item = $this->getItem();
$product = $item->getProduct();
$item_s = Mage::getModel('wishlist/item')->loadWithOptions($item->getId(), 'simple_product')->getOptionsByCode();
$simple_product = $item_s['simple_product']->getData();
$simple_product_id = $simple_product_data['product_id'];
$simple_product_attr = Mage::getModel('catalog/product')->load($simple_product_id);
?>
<a class="product-image" href="<?php echo $this->getProductUrl($item) ?>" title="<?php echo $this->escapeHtml($product->getName()) ?>">
<img src="<?php echo $this->helper('catalog/image')->init($simple_product_attr ,'small_image'); ?>" alt="<?php echo $this->escapeHtml($product->getName()) ?>" />
</a>
Also here is the code with extraneous code removed:
$item = $this->getItem();
$product = $item->getProduct();
$item_s = Mage::getModel('wishlist/item')
->loadWithOptions($item->getId(), 'simple_product')
->getOptionsByCode();
$simple_product = $item_s['simple_product']->getData();
$simple_product_id = $simple_product_data['product_id'];
$simple_product_attr = Mage::getModel('catalog/product')
->load($simple_product_id);
<img src="<?php echo $this->helper('catalog/image')
->init($simple_product_attr ,'small_image'); ?>" />