diff --git a/src/Models/Product.php b/src/Models/Product.php index 72905aa2..18e052e8 100644 --- a/src/Models/Product.php +++ b/src/Models/Product.php @@ -148,9 +148,10 @@ public function toItem(Itemable $itemable, array $attributes = []): Item return $variant->toItem($itemable, $attributes); } - return $this->items()->make(array_merge($attributes, [ + return $this->items()->make(array_merge([ 'name' => $this->name, 'price' => $this->getPrice($itemable->getCurrency()), - ]))->setRelation('buyable', $this); + 'quantity' => 1, + ], $attributes))->setRelation('buyable', $this); } } diff --git a/src/Models/Variant.php b/src/Models/Variant.php index e17eb04f..4717d867 100644 --- a/src/Models/Variant.php +++ b/src/Models/Variant.php @@ -110,9 +110,10 @@ public function getPrice(?string $currency = null): ?float */ public function toItem(Itemable $itemable, array $attributes = []): Item { - return $this->items()->make(array_merge($attributes, [ + return $this->items()->make(array_merge([ 'name' => sprintf('%s - %s', $this->product->name, $this->alias), 'price' => $this->getPrice($itemable->getCurrency()), - ]))->setRelation('buyable', $this); + 'quantity' => 1, + ], $attributes))->setRelation('buyable', $this); } }