Description
Describe the bug
After the PS 1.7.7 beta 2 release, a new bug appeared on product page, after adding a product in cart and closing the modal, the content of the hook in question is appended to the current state
Expected behavior
The content of the hook displayAfterProductThumbs should be replaced if changed and not appended.
Steps to Reproduce
Steps to reproduce the behavior:
- Add some content to the displayAfterProductThumbs hook.
- Go to the product page.
- Add product to the cart.
- Close the modal window.
- The content is appended.
For details, watch the video: https://drive.google.com/file/d/1RN935L0wX0HxWcB2l9lY141mpytH4OLz/view
I think the problem is in themes/_core/js/product.js
:
if (
$(prestashop.selectors.product.imageContainer).html()
!== $newImagesContainer
.find(prestashop.selectors.product.imageContainer)
.html()
) {
$(prestashop.selectors.product.imageContainer).replaceWith(
data.product_cover_thumbnails,
);
}
Additional information
- PrestaShop version: 1.7.7 beta 2
- PHP version: N/A
Activity
Hlavtox commentedon Nov 25, 2020
@denys202 Open
themes/classic/templates/catalog/_partials/product-cover-thumbnails.tpl
and move{hook h='displayAfterProductThumbs'}
above the last</div>
. It will fix it.I will make a PR.
hibatallahAouadni commentedon Nov 26, 2020
Hello @denys202
I managed to reproduce your issue only with PS1.7.7.0-rc.1, it worked normally with PS1.7.6.9 , see the attached screen records below:
- 1.7.7.0-rc.1:
https://drive.google.com/file/d/1Vp3WN5M9busKAKK-ySEYgGmX78Z5fU_B/view
- 1.7.6.9:
https://drive.google.com/file/d/1t6_diYPsFBedZDWRC6n7Ijx5nm3WOAfo/view
PS: In my case, I add to the content presta photo.
I’ll add this to the debug backlog so that it’s fixed.
If you have already fixed it on your end or if you think you can do it, please do send us a pull request!
Thank you
[-]displayAfterProductThumbs hook content is dublicated after adding a product in the cart[/-][+]displayAfterProductThumbs hook content is duplicated after adding a product in the cart[/+]10 remaining items