Using fresh installation of commerce 2.x-dev. If you complete order as guest checkout - cart is not emptied (and no new cart created) after order has been completed.

Steps to reproduce

  1. Browse to site as anonymous users
  2. Add some products to you cart
  3. Complete order checkout as Guest Checkout

Expected result:

After order has been completed, new empty cart should be created with new order number.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mitrpaka created an issue. See original summary.

mglaman’s picture

Assigned: Unassigned » mglaman

Looks like our block view doesn't have a filter to make sure only draft orders are shown (whoops.) Writing test now to verify.

mglaman’s picture

Status: Active » Needs work
FileSize
816 bytes

Confirmed. Ran the "place" transition in CartBlockTest. Text remains after transition. Working on fix.

mglaman’s picture

This is because we never say "this is no longer a cart"! We need to remove the cart status flag when an order is no longer a draft / is placed.

mglaman’s picture

Status: Needs work » Needs review
FileSize
10.3 KB

PR: https://github.com/drupalcommerce/commerce/pull/502

Adds hook to remove cart flag on placed transition. Adds kernel test to verify.. which uncovers a fun core bug. Also tests browser and block display.

  • mglaman authored 957a670 on 8.x-2.x
    Issue #2802097 by mglaman, mitrpaka: Checkout as a guest - cart not...
mglaman’s picture

Status: Needs review » Fixed

Merged!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.