I am trying to get the child product image of a configurable product that was added to cart by the customer.
For example, if the customer added a pair of red shoes to the cart I would like to show that color in the shopping cart.
I have set "Show product Thumbnail Itself"
The problem is this function from a colour swatch extension
public function findColorImage($value, $arr, $key, $type)
{
$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];
}
}
return $found;
}
in the template colorselectorplus/cart/item/default.phtml
findColorImage($_item->getProductId(),$product_base,'color', 'image'); ?>
Which is being called from Helper/Data.php for some reason it only returns the Base image for the product and ignores the correct image for the colour.
I've tried changing image
to use thumbnail
but I'm not having any joy...
Has any other developer come across this issue with this extension and managed to fix it?
I'd don't mind even a hot fix right now...