Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to have a float/decimal value in Cart item price #32

Open
lumikcz opened this issue Mar 26, 2019 · 1 comment
Open

Unable to have a float/decimal value in Cart item price #32

lumikcz opened this issue Mar 26, 2019 · 1 comment

Comments

@lumikcz
Copy link

lumikcz commented Mar 26, 2019

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.

@Slayvin
Copy link

Slayvin commented Jan 19, 2021

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$ ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants