HI Nicolas:
I know this thread is old, but I trying to do something very similar.
Except I want to keep the popup on the main image.
But when I try to do so, I lose the ability to scroll through all the images as the arrows won't appear .
(most likely because it isn't referencing the thumbnails)
The code is a bit complex and it hard to know hat is going on, so I haven't been able to figure it out myself.
So here's what I managed to do so far:
So my thumbnails now change the main image - and I changed the onmouseover to onclick, and that all works.
$attr = 'title="'.$this->escape(@$image->file_description).'" onclick="return window.localPage.changeImage(this, \'hikashop_main_image'.$variant_name.'\', \''.$img->url.'\', '.$img->width.', '.$img->height.', \''.str_replace("'","\'",@$image->file_description).'\', \''.str_replace("'","\'",@$image->file_name).'\');"';
$html = '<img class="'.$classname.' '.$thumbStyle.'" '.$attr.' alt="'.$this->escape(@$image->file_name).'" src="'.$img->url.'"/>';
echo $html;
When I click on the main image though, It does popup, but it only fetches the first image.
So there are no arrows to scroll through the gallery of images anymore.
(see attachement)
SO , if I switch the thumbnail code back to the original, it works.
From this:
BAck to this:
if(empty($variant_name)) {
echo $this->popup->image($html, $img->origin_url, $id, $attr, array('gallery' => 'hikashop_main_image'));
} else {
echo $this->popup->image($html, $img->origin_url, $id, $attr, array('gallery' => 'hikashop_main_image_VARIANT_NAME'));
}
But of course if I do that, th e popups appear when I click the thumbnails, which I don't want.
Any idea how I might get it work ?
Thanks in advance.