mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-23 15:41:24 +00:00
Update CanBeBought.php
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
namespace Gloudemans\Shoppingcart;
|
namespace Gloudemans\Shoppingcart;
|
||||||
|
|
||||||
use Money\Money;
|
use Money\Money;
|
||||||
|
use Money\Currency;
|
||||||
|
|
||||||
trait CanBeBought
|
trait CanBeBought
|
||||||
{
|
{
|
||||||
@@ -38,7 +39,7 @@ trait CanBeBought
|
|||||||
public function getBuyablePrice(): Money
|
public function getBuyablePrice(): Money
|
||||||
{
|
{
|
||||||
if (($price = $this->getAttribute('price')) && ($currency = $this->getAttribute('currency'))) {
|
if (($price = $this->getAttribute('price')) && ($currency = $this->getAttribute('currency'))) {
|
||||||
return new Money($price, $currency);
|
return new Money($price, new Currency($currency));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user