mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-11 18:54:33 +00:00
Update CartItem.php
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user