Skip to main content

Disable img popup and thumbnails on details page

More
11 years 6 months ago - 11 years 6 months ago #196315 by thirdhatch
-- 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: 11 years 6 months ago by thirdhatch. Reason: specifying which version of 2.4.0

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

More
11 years 6 months ago #196359 by Xavier
Hi,

In the view "product / show_block_img" please replace:
Code:
$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:
Code:
$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.

More
11 years 6 months ago #196414 by thirdhatch
Excellent - thank you!!!

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

More
6 years 5 months ago #317423 by oxido
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.

More
6 years 5 months ago #317424 by nicolas
Hi,

In the same file, you can change the code:
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:
Code:
echo $html;
The following user(s) said Thank You: oxido

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

More
6 years 5 months ago - 6 years 2 months ago #317442 by oxido
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
Code:
$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
Code:
$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: 6 years 2 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.188 seconds
Powered by Kunena Forum