Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Oct 27, 2023
1 parent 2e26e48 commit 99220e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Models/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 2 additions & 0 deletions src/Models/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class Item extends Model implements Contract
* @var array<string>
*/
protected $fillable = [
'buyable_id',
'buyable_type',
'name',
'price',
'properties',
Expand Down

0 comments on commit 99220e7

Please sign in to comment.