Jump to content

[SOLVED] Wrong image zoom on product page


MiguelPS

Recommended Posts

Hi everyone,

I'm having a lot of trouble with a weird issue whose problem I can't seem to locate.

I'm running Prestashop 1.7.2.2 and the problem happens like this:

1 - If I visit any of my product pages and, without clicking anything first, I click on the magnifying glass to zoom the default product image, a random (I think it's random, because I haven't been able to locate a common pattern) image of a completely different product shows up on the zoomed modal window. However, the main product image (not zoomed in) is the correct one.

2 - If, before clicking on the magnifying glass, I click on any of the thumbnails, or select another product combination, the zoomed image is always the right one.

I'm using combinations for all of my products, and the default combination has an image set.

I'm getting no JavaScript errors on the console.

It looks like the JavaScript that binds the modal content (zoomed image) with the right image works whenever I click on anything (for example, clicking on any thumbnail, selecting a different color...) but, when the page loads, it doesn't initialize correctly and binds the magnifying glass to a totally different picture.

Any help or ideas would be greatly appreciated, since this issue is really driving me crazy.

Thanks in advance!

Edited by MiguelPS (see edit history)
Link to comment
Share on other sites

  • MiguelPS changed the title to [SOLVED] Wrong image zoom on product page

I finally found out what was going on. Turns out a product carousel module was overwriting my main $product variable just before outputting the modal window code, in product.tpl, so the product and images shown on "image zoom" were those of the last product on that carousel...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...