conedevelopment / bazar

Bazar is an e-commerce package for Laravel applications.
https://root.conedevelopment.com
MIT License
421 stars 56 forks source link

\Bazar\Events\CheckoutProcessed , not decrement quantity #194

Closed bobitza closed 11 months ago

bobitza commented 2 years ago

Description:

\Bazar\Events\CheckoutProcesseddidn'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