From bfc2cccfa9e266083b5a4f6a4f2585f8fb94d6f7 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sat, 5 Feb 2022 17:47:14 +0100 Subject: [PATCH] Update CanBeBought.php --- src/CanBeBought.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CanBeBought.php b/src/CanBeBought.php index cb529d0..b2138cc 100644 --- a/src/CanBeBought.php +++ b/src/CanBeBought.php @@ -3,6 +3,7 @@ namespace Gloudemans\Shoppingcart; use Money\Money; +use Money\Currency; trait CanBeBought { @@ -38,7 +39,7 @@ trait CanBeBought public function getBuyablePrice(): Money { if (($price = $this->getAttribute('price')) && ($currency = $this->getAttribute('currency'))) { - return new Money($price, $currency); + return new Money($price, new Currency($currency)); } }