ISSUE-28814 - Ensure MSRP info on gesture always works #31903
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description (*)
When MSRP is enabled and a product is set to show price on gesture, the MSRP javascript relies on an MSRP popup template being present on the page (<script data-role="msrp-popup-template" type="text/x-magento-template">). If that template is not present, there is a js error and the info popup won't be shown on click.
The MSRP module adds the popup template to layout handles where products are expected (category view, product view, cart, etc.). However, products can be added to virtually any page via CMS content / widgets, so any page outside the expected list will not have gesture functionality.
This PR removes the popup from specific layout handles and instead adds it to default so it's rendered on every page. However, an ifconfig attribute is added to the popup block so that it will only be processed if MSRP is enabled.
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
There were several options to fix this issue:
In the end, none of these seemed like good solutions compared to just adding the block to every page.
Additional note: Issue #28814 mentions a second case where MAP gesture doesn't work; any time the same MAP product is displayed twice on the same page. I was unable to reproduce that use case.
Contribution checklist (*)