Update CartItem.php

This commit is contained in:
Patrick
2022-02-05 21:25:09 +01:00
committed by GitHub
parent 230fd57c92
commit 47f436b999

View File

@@ -264,12 +264,12 @@ class CartItem implements Arrayable, Jsonable
'id' => $this->id, 'id' => $this->id,
'name' => $this->name, 'name' => $this->name,
'qty' => $this->qty, 'qty' => $this->qty,
'price' => $this->price, 'price' => self::formatMoney($this->price),
'weight' => $this->weight, 'weight' => $this->weight,
'options' => $this->options->toArray(), 'options' => $this->options->toArray(),
'discount' => $this->discount, 'discount' => self::formatMoney($this->discount),
'tax' => $this->tax, 'tax' => self::formatMoney($this->tax),
'subtotal' => $this->subtotal, 'subtotal' => self::formatMoney($this->subtotal),
]; ];
} }
@@ -288,7 +288,7 @@ class CartItem implements Arrayable, Jsonable
/** /**
* Generate a unique id for the cart item. * Generate a unique id for the cart item.
*/ */
private function formatMoney(Money $money) : string private static function formatMoney(Money $money) : string
{ {
return (new DecimalMoneyFormatter(new ISOCurrencies()))->format($money); return (new DecimalMoneyFormatter(new ISOCurrencies()))->format($money);
} }