Jump to content

Close button on product image modal

Recommended Posts


how I can add "Close" button to product image pop-up on product page? I know that I have too edit product-images-modal.tpl file, I've added [X] image (close button) - with normal <img src> tag, but when I click it nothing happens, and when I click near to this image modal is closing. Should I give any directive to img src tag? Something like #close-modal?


Thanks for help.

Share this post

Link to post
Share on other sites


Probably you need a directive as you mention or add a JS code. Something like this:



Share this post

Link to post
Share on other sites

Hi, I know this topic is quite old but I was also looking for the solution and it turned out to be super easy. Prestashop default product modal uses Bootstrap Modal under the hood. You can easily add Bootstrap-like button to close the modal without additional JS code to handle this event:

<button type="button" class="close" data-dismiss="modal" aria-label="Close">
   <span aria-hidden="true">×</span>

This piece of code is from the official Bootstrap docs.

Best regards.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More