Hi,
For the product page, I would recommend you to override for the view "product | show_block_img" but for the product listing, it will be a little bit different.
When displaying a product listing (view "product | listing_img_title" or other "listing_img_..." views) ; you just have access to one single image.
In the file "components/com_hikashop/views/product/view.html.php" please replace
foreach($images as $image){
if($row->product_id==$image->file_ref_id) {
if(!isset($row->file_ref_id)){
foreach(get_object_vars($image) as $key => $name){
$rows[$k]->$key = $name;
}
}
break;
}
}
into
foreach($images as $image){
if($row->product_id != $image->file_ref_id)
continue;
if(!isset($row->file_ref_id)) {
foreach(get_object_vars($image) as $key => $name){
$rows[$k]->$key = $name;
}
} else {
if(empty($row->images))
$row->images = array();
$row->images[] = $image;
}
}
So you will have access to other images in the product listing views and you could retrieve the second image of a product using
$img = null;
if(!empty($this->row->images[0]))
$img = $this->image->getThumbnail($this->row->images[0]->file_path, array('width' => $this->image->main_thumbnail_x, 'height' => $this->image->main_thumbnail_y), $image_options);
if(!empty($img) && $img->success)
echo '<img class="hikashop_product_listing_image" title="'.$this->escape(@$this->row->images[0]->file_description).'" alt="'.$this->escape(@$this->row->images[0]->file_name).'" src="'.$img->url.'"/>';
Note : The view.html.php patch I proposed has vocation to be included in HikaShop if it's good for you.
Regards,