PAYONE-GmbH / magento-2

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

Customer Data is not initialized on invalidate call #464

Closed a-litvin closed 1 year ago

a-litvin commented 2 years ago

In _view/frontend/templates/redirectreturn.phtml in line 33 we have a customerData::invalidate call: customerData.invalidate(['cart', 'checkout-data']); Now sure about how it works in clear Magento, but we have an issue in our Magento 2.4.3 and Amasty One Step Checkout. The reason is that customerData object is not initialized at this moment, that means, a storage is also not initialized and customer-data.js fails on line 178 on storage.remove call.

The issue may be fixed by wrapping the code by customerData.getInitCustomerData().done() construction. It might look like:

if (typeof customerData.getInitCustomerData === "function") { customerData.getInitCustomerData().done(function () { redirectCancellation(customerData, checkoutData); }); } else { redirectCancellation(customerData, checkoutData); }

hreinberger commented 2 years ago

Hi and thanks for raising this issue. We'll have a look at it! Disclaimer: This could take a while, we're a bit low on Magento dev resources right now. Also, would you be willing to try out any code changes we may implement in Amasty Checkout for us? We try to be as compatible as possible, but have limited testing capabilities with third party plugins.

FatchipRobert commented 2 years ago

Hello @a-litvin , based on your comment I developed a change here: https://github.com/PAYONE-GmbH/magento-2/pull/466

Does this fix your issue?

a-litvin commented 2 years ago

Hi @FatchipRobert

As I remember the fix we did on our site is exactly the same :)

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.