yii2-cart
yii2-cart copied to clipboard
Unable to have a float/decimal value in Cart item price
The CartItemInterface.php uses int data type for price value:
public function getPrice(): int;
I believe that more correct would be to have this value float/double to support decimal values in prices. In version <1.4 it was originally untyped function, so it was no problem.
I propose changing the signature to float.
Yes, I agree with this. It is not clear why getPrice() must return an integer.
How is it supposed to work with an item that costs 0.5€ or 0.25$ ?