klaviyo / magento2-klaviyo

38 stars 51 forks source link

Ajax request 404 which is causing several major issues in cart #194

Closed jlenzstaysafe closed 2 years ago

jlenzstaysafe commented 2 years ago

Add a product to cart then go to the cart page. If you notice, the ajax request for "reclaim/checkout/reload" is going to a 404. This is just one issue. Next, you may notice that when that 404 ajax request finishes, it contains headers with cookies. Now, go ahead and add any random coupon code so you receive an error notice. Now keep adding random coupon codes to generate more error messages. You will notice the messages just keep accumulating with each page refresh while on the cart page. This is because your extension's 404 is returning the old messages after magento is trying to clear them on page load.

So, in other words: 1) On page load, Magento clears the messages cookie in local browser 2) Then, your module's 404 ajax request returns from the server which contains the old message cache, which then just re-adds it to the local browser cookie

jlenzstaysafe commented 2 years ago

I submitted a PR to fix this: https://github.com/klaviyo/magento2-klaviyo/pull/195

cykolln commented 2 years ago

This fix has been merged in, and will be released within the next week.

cykolln commented 2 years ago

This has been released in version 4.0.5