PAYONE-GmbH / magento-2

PAYONE Payment Extension for Magento 2
28 stars 56 forks source link

fix: Load quote only when checkoutConfig is available #414

Closed ptylek closed 2 years ago

ptylek commented 2 years ago

I have installed Amazon Pay extension which uses error processor in amazon-button.js which is loaded in minicart (and thus on every page).

As PAYONE extension applies mixin for error-processor, it requires static files from Checkout such as method list and quote. So whenever amazon-button loads, for example on PDP, quote tries to execute quoteData = window.checkoutConfig.quoteData, which returns in error because window.checkoutConfig is not available for PDP. There is no such error in Cart or Checkout.

It would be the best if any other extension using error processor could use original file without mixin, and the mixin from PAYONE would be only applied when in Cart or Checkout.

If you have any better suggestions how to fix this issue, please contribute to this Pull Request.

janteuber commented 2 years ago

Thank you @ptylek for your effort. We checked your code and merged it.