mollie / magento2-subscriptions

BSD 2-Clause "Simplified" License
3 stars 5 forks source link

Mollie\Subscriptions\Observer\CustomerLogin\PreventDuplicateSubscriptionProductsInCart relies on observer execution order #25

Closed Sental closed 1 year ago

Sental commented 1 year ago

Describe the bug The cart for a customer is only available on the customer_login event after the observer \Magento\Checkout\Observer\LoadCustomerQuoteObserver. Observers do not have an execution order so they can be fired in a different order. When Mollie\Subscriptions\Observer\CustomerLogin\PreventDuplicateSubscriptionProductsInCart is fired before the Magento observer the customer has no cart so a \Magento\Framework\Exception\NoSuchEntityException is thrown.

Used versions

To Reproduce Steps to reproduce the behavior: After you have purchased a subscription while logged in.

  1. Add a subscription product to your basket
  2. Log into your account
  3. You may see a no such entity with customerId = ... exception

Expected behavior A clear and concise description of what you expected to happen. On log in if a duplicate subscription product is in the cart it should be removed.

Actual behavior A clear and concise description of what actually happens. A no such entity with customerId message is generated and the duplicate subscription product stays in the cart.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

Frank-Magmodules commented 1 year ago

Hi @Sental ,

We are happy to share that we've just released the new 1.6.1 version where we have fixed this issue. Thank you for opening this issue and for your patience. We are closing this issue now but please feel free to reopen the issue if you need any help on this.