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',