Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Cart not clearing on order success #28

Open
hcmlopes opened this issue Apr 13, 2021 · 0 comments
Open

Cart not clearing on order success #28

hcmlopes opened this issue Apr 13, 2021 · 0 comments

Comments

@hcmlopes
Copy link

After checkout, when redirected to the /order-success route the clearTheCart() function is not getting triggered.

There are 2 listening events being registered on the beforeMount hook, however these events are not triggering this function even though I see the respective mutations and the event being fired during page load.

The event does not show up in the vue devtools and maybe this is because of SSR or some other obscure reason but I would like to understand what's happening here.

In the mean time I just called the function directly in the beforeMount hook to clear the cart no matter what when the user visits this page as such.

  beforeMount () {
    this.clearTheCart()
    this.$bus.$on('application-after-loaded', (payload) => {
      if (document.getElementById('thank_you_external') != null) {
        this.clearTheCart()
      }
    })
    this.$bus.$on('cart-after-itemchanged', (payload) => {
      if (document.getElementById('thank_you_external') != null) {
        this.clearTheCart()
      }
    })
  },
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant