Skip to main content
3 of 3
added 1456 characters in body
Amit Bera
  • 77.7k
  • 20
  • 124
  • 239

Goto admin>System>Configuration>Checkout>Shopping Cart>Configurable Product Image make it Product Thumbnail Itself this make child product image Instead of sending

$_item->getProductId()
send $_item
and put somelogic
$_item

for configurable product $_Item>getSku give child product a other time give main products. so just child product using item sku

I guess you have used third party extension so i have change some change according my concept change

Step1:instead of send product send all item object

findColorImage($_item->getProductId(),$product_base,'color', 'image');

to

findColorImage($_item,$product_base,'color', 'image'); 

Step2: some change on function

public function findColorImage($item, $arr, $key, $type)
{
    /* $value  set here*/
    $value=$item->getProductId();
    
    $found = '';
    if(isset($arr[$key])) {
        $total = count($arr[$key]);
        if($total>0)
        {
            for($i=0; $i<$total;$i++)
            {
                if($value == ucwords($arr[$key][$i]))//if it matches the color listed in the attribute
                {
                    $found = $arr[$type][$i];//return the image src
                }
            }
        }
    }
    
    if ($found == '') {
        if (isset($arr['image'])){
            $found = $arr['image'][0];
        }
    }
    /*  for configurable product send child product image */
    if($item->getProductTypeId="configurable"){
        $ChildProduct=Mage::getModel('catalog/product')->loadByAttribute('sku',$item->getSku());
        $found=Mage::helper('catalog/image')->init($ChildProduct, 'thumbnail');
        
    }
    return $found;
}
Amit Bera
  • 77.7k
  • 20
  • 124
  • 239