I am trying to get the image of child (associated product) of a configurable product on wishlist page. Currently, parent image is shown which is not desired.
What I already have done:
In this file, I have been trying to get it:
/template/wishlist/item/column/image.phtml
//my code
if ($product->getHasOptions()) { // mean it is configurable product
$my_options = new Mage_Wishlist_Block_Customer_Wishlist_Item_Options();
$my_config_options = $my_options->getConfiguredOptions();
if ($my_config_options) {
//try to find some link to the image
}
But it is not helping out. My above code may not be good enough, but I am just trying to reflect that I did try it myself.
Best Answer
This what I used to get simple product image to show in wishlist instead of configurable product image. You need to get the simple/child product ID of associated product and then get its attributes, in this case image.
echo
$simple_product_img_url
into the html imgsrc
attribute.