Closed (fixed)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Cart
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Dec 2016 at 17:28 UTC
Updated:
26 Mar 2017 at 22:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
bojanz commentedCartProvider needs to check for both the cart boolean and the "draft" state to be sure.
We also need to expand commerce_cart_commerce_order_presave(), it currently does the right thing when the order is placed, but doesn't account for cancelled orders (which also need the cart removed).
Comment #3
mglamanhttps://github.com/drupalcommerce/commerce/pull/608
The ::finalizeCart method does exactly what I need it to do. Just feels weird calling it on cancel due to naming.
Comment #5
bojanz commentedCommitted the final version of this.
Includes mglaman's test improvements (CartManagerTestTrait), my addition of the missing CartProvider::clearCaches() (every service with a static cache needs a method to clear it), as well as the extended cart validation and test coverage.
We tried to add a cancelCart() method as a parallel to finalizeCart() but it didn't make much sense because in most cases the cart isn't cancelled by the cart owner, but by another user.