Disable hover effect on product image thumbnails

  • Posts: 52
  • Thank you received: 2
11 years 1 week ago #132819

Hi,

I am trying to change the way that the thumbnails are displayed under the main product image on the product page.

I need the hover effect to be disabled when hovering over the thumbnail images and for the thumbnail images to be displayed as the main image when the user clicks on the thumbnail.

How can I do this?

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

  • Posts: 12953
  • Thank you received: 1778
11 years 1 week ago #132877

Hi,

You'll probably be able to do that by :
- Going to "Hiakshop->Display->Views"
- Editing the "show_block_img" file of the "product" view of your front-end template
- Change this line :

$attr = 'onclick="return window.localPage.openImage(\'hikashop_main_image\');"';
by :
// $attr = 'onclick="return window.localPage.openImage(\'hikashop_main_image\');"';
- And this line :
$attr = 'onmouseover="return window.localPage.changeImage(this, \'hikashop_main_image'.$variant_name.'\', \''.$img->url.'\', '.$img->width.', 
By :
$attr = 'onclick="return window.localPage.changeImage(this, \'hikashop_main_image'.$variant_name.'\', \''.$img->url.'\', '.$img->width.', 

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

  • Posts: 52
  • Thank you received: 2
11 years 1 week ago #132909

That works perfectly...

The only issue I'm having now is that when I click on the main image which has been replaced with the thumbnail, it comes up with an enlargement of the default image: s293983206.websitehome.co.uk/elevateshop...k-claudia-court-shoe

Is there anything I can add to the code to fix this?

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 1 week ago #132916

Hi,

Please remove the comment in order to keep

$attr = 'onclick="return window.localPage.openImage(\'hikashop_main_image\');"';
Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 52
  • Thank you received: 2
11 years 1 week ago #132917

Hi,

I've just removed it, but the large image seems not to be clickable at all now? :(

s293983206.websitehome.co.uk/elevateshop...ck-charlize-stiletto

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

  • Posts: 52
  • Thank you received: 2
11 years 1 week ago #133021

Hi,
Is there any way I can make the images enlarge on click, once they are in the main product box. At the moment when I click on it, it comes up with a pop up enlargement of the default image. See here s293983206.websitehome.co.uk/elevateshop...ck-charlize-stiletto

I've tried to edit the PHP within the show_block_image file, but with no success.

Thanks in advance

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 1 week ago #133267

Hi,

You didn't made the modification I asked you.
Please do not comment this line:

$attr = 'onclick="return window.localPage.openImage(\'hikashop_main_image\');"';
Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 52
  • Thank you received: 2
11 years 1 week ago #133288

Hello,

I did take the // away, but when it was un-commented it did not work at all when I clicked on the main image to enlarge it. :-(

See here: s293983206.websitehome.co.uk/elevateshop...k-claudia-court-shoe

Please help :(

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 1 week ago #133351

Hi,

Yes, know the page is correct. But it wasn't during my last test.

So you can know change in the "show_block_img" view:

window.localPage.openImage = function(id) {
  if(!window.localPage.images[id])
    window.localPage.images[id] = document.getElementById('hikashop_first_thumbnail');
  window.localPage.images[id].click();
  return false;
};
By:
window.localPage.openImage = function(id) {
  if(!window.localPage.images[id])
    window.localPage.images[id] = document.getElementById('hikashop_first_thumbnail');
  SqueezeBox.fromElement(window.localPage.images[id],{parse:'rel'});
  return false;
};
Because you change the "hover" by "click" and because when you click on the main image it is like you clicked on the lastest selected thumbnail, it is like nothing happened.
So instead we will call the current thumbnail JS library.
( Note: that code is not compatible with Shadowbox )

Regards,

PS : We reply to all message in the forum, as fast as we can.
Sending me private message won't make me answer faster. But if you do it all the time, it could become the opposite effect.
Your are not the only person to put some question in our forum, so please wait like the others.
We know when we have to reply to a thread, the all support team know it.


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: Lexnia, digglescreative

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

  • Posts: 52
  • Thank you received: 2
11 years 1 week ago #133368

You're an absolute star!! Thank you sooo much....works perfectly now :cheer:

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

  • Posts: 158
  • Thank you received: 5
9 years 6 months ago #202021

Hello Jerome, has the code changed since this was last posted as I tried it on my HikaShop deployment and I still get the hover effect? I've read the whole thread several times and tried various combinations of the code changes in show_block_image.php and nothing seems to make any difference? I'm looking at the file in the folder /components/com_hikashop/views/product/tmpl.

Thanks

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 6 months ago #202028

Hi,

The main part code hasn't changed since the last time.
Even if the line isn't exactly the same, you still have a line which set the variable "$attr" to add the "onmouseover" content.
The goal is still to remove "onmouseover" by "onclick".

After that, you have to be sure that you're editing the view for the right front-end template.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 2
  • Thank you received: 0
9 years 2 months ago #214560

I followed this instruction and the onmouseover effect is still happening. I just want it to not replace main image with moused over thumbnails. I comment out that line but when I look at the page source it's loading the onmouseover.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 2 months ago #214561

Hi,

Are you sure that you made an override for the right front-end template ?
www.hikashop.com/support/support/documen...ize-the-display.html

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 2
  • Thank you received: 0
9 years 2 months ago #214608

That is what I did. Didn't notice each template you have loaded for Joomla gets their own. One thing of note... Only commenting out that line changes onclick so that nothing was happening so I changed the script per your post. With mootools as the popup window it only opened the zoomed in image for the main and none of the thumbs (click on any thumb and main would load instead) but it did work with shadowbox (external).

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 2 months ago #214659

Hi,

That's right, since the patch was proposed (almost 2 years), the script in the product page has changed.
Did you also apply the patch in the post #133351 ?
Because the functions "openImage" changed, like the addition of the parameter "variant".

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 256
  • Thank you received: 2
6 years 11 months ago #284546

I followed this guide and the images are swapping over when clicking on the child images however when you click on the large image its only enlarging the main first image not the image thats being displayed.

The guide displays some php code to swap out however this code doesn't exist in the latest version of Hikashop under 'show_block_img'

I cant find this code
window.localPage.openImage = function(id) {
if(!window.localPage.images[id])
window.localPage.images[id] = document.getElementById('hikashop_first_thumbnail');
window.localPage.images[id].click();
return false;
};

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

  • Posts: 82868
  • Thank you received: 13378
  • MODERATOR
6 years 11 months ago #284548

Hi,

The code is a bit different now but it's still there:

window.localPage.openImage = function(id, variant_name, e) {
	if(!variant_name) variant_name = '';
	if(!window.localPage.images[id])
		window.localPage.images[id] = document.getElementById('hikashop_first_thumbnail' + variant_name);

	e = e || window.event;
	e.stopPropagation();
	e.cancelBubble = true;
	window.Oby.cancelEvent(e);
	window.localPage.images[id].click();
	return false;
};
it's right at the end of the view file.

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

  • Posts: 256
  • Thank you received: 2
6 years 11 months ago #284676

Hello, I have altered the script to this

e = e || window.event;
e.stopPropagation();
e.cancelBubble = true;
window.Oby.cancelEvent(e);
SqueezeBox.fromElement(window.localPage.images[id],{parse:'rel'});
//window.localPage.images[id].click();//
return false;

however it still only displays the first product image when enlarging any thumbnail.

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

  • Posts: 82868
  • Thank you received: 13378
  • MODERATOR
6 years 11 months ago #284678

Hi,

Hard to help without more context.
We would need to know what code you put/change where exactly and a link to the page with the issue to be able to understand the situation.

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

Time to create page: 0.127 seconds
Powered by Kunena Forum