Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

productcollection - addToWishlist and addToCart buttons not working for items loaded after 'load more' #985

Open
jbaix opened this issue Aug 29, 2023 · 0 comments

Comments

@jbaix
Copy link

jbaix commented Aug 29, 2023

Expected Behaviour

addToWishlist and addToCart buttons should work the same way for all items, those loaded from the server and after the 'load more' click event.

Actual Behaviour

For items loaded after the 'load more' click event, the buttons are not configured with the appropriate handlers, and the user is redirected to the product details page.

Reproduce Scenario (including but not limited to)

Configure a category page with 'Load more' option enabled.

Steps to Reproduce

Open a category page with products.
Click on the addToCart, on any of the initial products loaded from the server side. The product is added to the cart.
Click on the 'Load more' button.
Click on the addToCart, on any of the products added to the list. The user is redirected to the product details page.

(repeat same steps for addToWishlist)

Platform and Version

Last AaaCS instance. CIF 2.12.2

Sample Code that illustrates the problem

No custom code involved.

Logs taken while reproducing problem

No logs in the browser developer tools

Additional notes

When the new items are appended to the galleryItems, no event handler is added to the addToWishlist and addToCart buttons. Please check ui.apps\src\main\content\jcr_root\apps\core\cif\components\commerce\productcollection\v2\productcollection\clientlibs\js\productcollection.js, line 139:
galleryItems.append(...moreItems);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant