image replace main product image rather than popup

  • Posts: 38
  • Thank you received: 2
9 years 4 months ago #240376

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.5.1

Hi everyone

My apologies if this has been asked before. I've searched but can't find an answer.

When you have multiple images for a product is it possible to click on an image and it replace the main product image rather than having a popup?

Many thanks.

Please Log in or Create an account to join the conversation.

  • Posts: 84312
  • Thank you received: 13701
  • MODERATOR
9 years 4 months ago #240403

Hi,

Yes. You need to change the code:

							$attr = 'title="'.$this->escape(@$image->file_description).'" onmouseover="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.'" title="'.$this->escape(@$image->file_description).'" alt="'.$this->escape(@$image->file_name).'" src="'.$img->url.'"/>';
							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'));
							}
to:
							$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).'\');"';
							echo '<img class="'.$classname.'" title="'.$this->escape(@$image->file_description).'" alt="'.$this->escape(@$image->file_name).'" src="'.$img->url.'"/>';
in the file show_block_img via the menu Display>Views.

The following user(s) said Thank You: JasonJJBW

Please Log in or Create an account to join the conversation.

  • Posts: 38
  • Thank you received: 2
9 years 4 months ago #240446

Hi Nicolas

Many thanks for your reply. This works a treat however I still get the image popup and there are now two thumbnails of each image.

Is there a way of disabling the image popup and having just one thumbnail for each image please?

Thank you for your help and time.

Please Log in or Create an account to join the conversation.

  • Posts: 38
  • Thank you received: 2
9 years 3 months ago #240465

Hi Nicolas

I've managed to disable the image popup, I just need to sort out the thumbnail images as there's two per image.

Thanks.

Please Log in or Create an account to join the conversation.

  • Posts: 38
  • Thank you received: 2
9 years 3 months ago #240467

Hi Nicolas

Just found the issue and sorted it.

Again, many thanks for your help and time, It's very much appreciated.

The following user(s) said Thank You: Jerome

Please Log in or Create an account to join the conversation.

Time to create page: 0.062 seconds
Powered by Kunena Forum