From 99220e7486190296b46926899dc85ee5f5797b36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=2E=20Nagy=20Gerg=C5=91?= Date: Fri, 27 Oct 2023 22:17:04 +0200 Subject: [PATCH] fix --- src/Models/Cart.php | 2 ++ src/Models/Item.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Models/Cart.php b/src/Models/Cart.php index ced7de7b..f1e7783b 100644 --- a/src/Models/Cart.php +++ b/src/Models/Cart.php @@ -155,7 +155,9 @@ public function toOrder(): Order $this->order()->associate($this->order)->save(); } + $this->order->items()->delete(); $this->order->items()->createMany($this->items->toArray()); + $this->order->address->fill($this->address->toArray())->save(); $this->order->shipping->fill($this->shipping->toArray())->save(); $this->order->shipping->address->fill($this->shipping->address->toArray())->save(); diff --git a/src/Models/Item.php b/src/Models/Item.php index 10bdc937..31d548e6 100644 --- a/src/Models/Item.php +++ b/src/Models/Item.php @@ -61,6 +61,8 @@ class Item extends Model implements Contract * @var array */ protected $fillable = [ + 'buyable_id', + 'buyable_type', 'name', 'price', 'properties',