Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed May 3, 2024
1 parent 6d57582 commit 16a2210
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Models/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Cone\Bazar\Bazar;
use Cone\Bazar\Database\Factories\CartFactory;
use Cone\Bazar\Exceptions\CartException;
use Cone\Bazar\Interfaces\Buyable;
use Cone\Bazar\Interfaces\Models\Cart as Contract;
use Cone\Bazar\Traits\Addressable;
use Cone\Bazar\Traits\InteractsWithDiscounts;
Expand Down Expand Up @@ -191,9 +190,9 @@ public function scopeExpired(Builder $query): Builder
*/
public function toOrder(): Order
{
$this->lineItems->each(function (Buyable $buyable): void {
if (! $buyable->buyable($this->order)) {
throw new CartException(sprintf('Unable to add [%s] item to the order.', get_class($buyable)));
$this->lineItems->each(function (Item $item): void {
if (! $item->buyable->buyable($this->order)) {
throw new CartException(sprintf('Unable to add [%s] item to the order.', get_class($item->buyable)));
}
});

Expand Down

0 comments on commit 16a2210

Please sign in to comment.