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

JS errors caused by applepay script on product page #36

Closed
fkruidhof opened this issue Jun 23, 2020 · 2 comments
Closed

JS errors caused by applepay script on product page #36

fkruidhof opened this issue Jun 23, 2020 · 2 comments

Comments

@fkruidhof
Copy link

fkruidhof commented Jun 23, 2020

The applepay block and template that are used on the productpage ads window.checkoutconfig and fills it with custom config without loading the entire checkoutconfig.
This interferes with other modules that check and rely on window.checkoutconfig (such ass Swissup Firecheckout) and can lead to JS errors that break the page.

this can not be prevented by turning off applepay, because the script is loaded even if applepay is turned off (which a simple check could prevent)

@edwinbos
Copy link

Latest version (1.23.2) is also giving me problems on the product page.
Apple Pay template is always loaded, which loads applepay/pay.js that in the end is loading Magento_Checkout/js/model/totals.js.

In Magento_Checkout/js/model/totals.js it throws an error:
Uncaught TypeError: Cannot read property 'items' of undefined totals.js:16
because quote.totals().items doesn't exist in this context

For know removing the Apple Pay template from the catalog_product_view.xml is resolving the problem:
<referenceBlock name="buckaroo_magento2.product.info.applepay" remove="true" />

For a structural solution the error should be solved and if Apple Pay is not used by the merchant the template and JavaScript should't be loaded in the first place.

@Buckaroo-Rens
Copy link
Collaborator

Included in latest release v1.24.0.

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

3 participants