Disable img popup and thumbnails on details page

  • Posts: 17
  • Thank you received: 0
9 years 11 months ago #196315

-- HikaShop version -- : 2.4.0 (latest 2.4.0 update)
-- Joomla version -- : 3.4.1

Hello I am having a similar situation to this one

Desired behavior:

  • The product images in the category/product listing view are rendered as thumbnails
  • The product detail page does not use an image popup, instead the product detail page displays the image in its original size (the original uploaded image)

I have tried following the instructions here but the result is that the product page does not show a popup, but still renders the thumbnail and not the original image.

Please help!

Last edit: 9 years 11 months ago by thirdhatch. Reason: specifying which version of 2.4.0

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

  • Posts: 13201
  • Thank you received: 2322
9 years 11 months ago #196359

Hi,

In the view "product / show_block_img" please replace:

									$html = '<img id="hikashop_main_image'.$variant_name.'" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle" title="'.$this->escape(@$image->file_description).'" alt="'.$this->escape(@$image->file_name).'" src="'.$img->url.'"/>';
									if(!empty($this->element->badges))
										$html .= $this->classbadge->placeBadges($this->image, $this->element->badges, '0', '0',false);

									echo $this->popup->image($html, $img->origin_url, null, $attr);
By:
									$html = '<img id="hikashop_main_image'.$variant_name.'" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle" title="'.$this->escape(@$image->file_description).'" alt="'.$this->escape(@$image->file_name).'" src="'.$img->origin_url.'"/>';
									if(!empty($this->element->badges))
										$html .= $this->classbadge->placeBadges($this->image, $this->element->badges, '0', '0',false);

									echo $html;

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

  • Posts: 17
  • Thank you received: 0
9 years 11 months ago #196414

Excellent - thank you!!!

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

  • Posts: 238
  • Thank you received: 29
  • Hikashop Business
4 years 11 months ago #317423

How can i do the same think for the thumbnails?
Just to remove the popup, i want the main image to be changed on click / mouseover. but i don't want to use the popup.

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

  • Posts: 83409
  • Thank you received: 13502
  • MODERATOR
4 years 11 months ago #317424

Hi,

In the same file, you can change the code:

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:
echo $html;

The following user(s) said Thank You: oxido

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

  • Posts: 238
  • Thank you received: 29
  • Hikashop Business
4 years 11 months ago #317442

Thx nicolas, the mouse over or the click didn't work on the images after that change, but i did fix for that.
This is the full code changed

NOTICE!
This is not working with variants, if you have different images on your variant's, the script is not gonna update the big image with the one you mouse over or thoch (on mobiles)


From this

$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 this
$onMouseOver = "return window.localPage.changeImage(this, 'hikashop_main_image', '".$img->url."', $width,  $height, '', '02');";
$html = '<a href="javascript:void(0);" onmouseover="'.$onMouseOver.'"><img class="'.$classname.'" title="'.$this->escape(@$image->file_description).'" alt="'.$this->escape(@$image->file_name).'" src="'.$img->url.'"/> </a>';
				
echo $html;

Last edit: 4 years 8 months ago by oxido.
The following user(s) said Thank You: nicolas

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

Time to create page: 0.080 seconds
Powered by Kunena Forum