Skip to content

displayAfterProductThumbs hook content is duplicated after adding a product in the cart #22113

Closed
Listed in
@denys202

Description

@denys202
Contributor

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:

  1. Add some content to the displayAfterProductThumbs hook.
  2. Go to the product page.
  3. Add product to the cart.
  4. Close the modal window.
  5. 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

Hlavtox commented on Nov 25, 2020

@Hlavtox
Contributor

@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

hibatallahAouadni commented on Nov 26, 2020

@hibatallahAouadni
Contributor

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

added
1.7.7.0Affects versions
BugType: Bug
FOCategory: Front Office
MinorSeverity: minor bug > https://build.prestashop.com/news/severity-classification
ReadyStatus: Issue is ready to be worked on
on Nov 26, 2020
changed the title [-]displayAfterProductThumbs hook content is dublicated after adding a product in the cart[/-] [+]displayAfterProductThumbs hook content is duplicated after adding a product in the cart[/+] on Nov 26, 2020
added
Nice-to-haveKanban prioritization: issue could be included in next version
on Nov 27, 2020

10 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

1.7.7.0Affects versionsBugType: BugFOCategory: Front OfficeFixedResolution: issue closed because fixedHookMinorSeverity: minor bug > https://build.prestashop.com/news/severity-classificationNice-to-haveKanban prioritization: issue could be included in next versionPR availableSolution: issue is being addressedRegressionType: regression

Type

No type

Projects

No projects

Relationships

None yet

    Development

    Participants

    @Progi1984@Hlavtox@marionf@hibatallahAouadni@LouiseBonnard

    Issue actions

      displayAfterProductThumbs hook content is duplicated after adding a product in the cart · Issue #22113 · PrestaShop/PrestaShop