bazar icon indicating copy to clipboard operation
bazar copied to clipboard

\Bazar\Events\CheckoutProcessed , not decrement quantity

Open bobitza opened this issue 3 years ago • 0 comments

  • Bazar Version: last
  • Laravel Version: 8.2
  • PHP Version: 7.4
  • Database Driver & Version: #

Description:

\Bazar\Events\CheckoutProcessed didn't decrement quantity, i make debug and find that when you checkout you make $item->buyable null, and then you call CheckoutProcessed that condition in CheckoutProcessed doesn't meet if (($model = $item->buyable) instanceof Stockable && $model->inventory->tracksQuantity()) {

Reproduce: Call Cart::checkout('cash'); and see if item quantity is decremented, you can see in photo after checkout everything is null, but you set null before call checkoutprocessed

image

bobitza avatar Feb 28 '22 09:02 bobitza