Update CartItem.php

This commit is contained in:
Patrick
2022-02-05 21:24:19 +01:00
committed by GitHub
parent 7fdda80bd3
commit 230fd57c92

View File

@@ -10,6 +10,8 @@ use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Contracts\Support\Jsonable;
use Illuminate\Support\Arr;
use Money\Money;
use Money\Formatter\DecimalMoneyFormatter;
use Money\Currencies\ISOCurrencies;
use ReflectionClass;
/**
@@ -283,6 +285,14 @@ class CartItem implements Arrayable, Jsonable
return json_encode($this->toArray(), $options);
}
/**
* Generate a unique id for the cart item.
*/
private function formatMoney(Money $money) : string
{
return (new DecimalMoneyFormatter(new ISOCurrencies()))->format($money);
}
/**
* Generate a unique id for the cart item.
*/