Adyen / adyen-magento2-hyva

MIT License
7 stars 4 forks source link

require.js and hyva theme #27

Closed pmarjan-onestic closed 8 months ago

pmarjan-onestic commented 8 months ago

A couple of things that illustrate the circumstances:

A. Hyva theme does not load require.js. Thus, when landing on the success page in Hyva theme we see an error like: require is not defined

B. Adyen_Payment frontend/layout/checkout_onepage_success.xml must not be overwritten when working in Hyva success page (for the Adyen Giving related purposes)

Switching store views must be supported, no matter how unlikely this setup might be.


@RokPopov @candemiralp

if we look at this file

vendor/adyen/module-payment/view/frontend/templates/checkout/success.phtml

so it will not throw that require is not defined error when Hyva theme is active, what do you think we could do?

I could not think of anything to do in Adyen_Hyva, but for example, edit this from Adyen_Payment, with maybe surround all require usages with something like

  if (typeof require == 'function') {
    require(['Magento_Customer/js/customer-data'], function (customerData) {
        'use strict';

        customerData.reload(['cart'], true);
    });
  }
pmarjan-onestic commented 8 months ago

After a joined discussion:

This issue is therefore closed.