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

Inconsistent Variable Type When Item in Cart has a Sale that Makes the Price 0. #1539

Closed
simeon-smith opened this issue Jun 25, 2020 · 2 comments
Assignees

Comments

@simeon-smith
Copy link

Description
I have an item with a sale on it. The item is $10. The sale is for $10. This makes the item 0. When then item is added to the cart the "totalAsCurrency" variable from getting the cart via JSON is the integer of 0. When the price is not zero it would be a string with the dollar sign in front. i.e. "$10.00".

To Reproduce
How, and what happened?

  1. Have a variant with a sale that makes the item price 0.
  2. Add then item to the cart.
  3. Check the totalAsCurrency value. It is an integer of 0.
  4. Add an item to the cart that doesn't have a sale price of 0.
  5. Check the totalAsCurrency value. It is a string.

Expected behavior
What did you expect to happen?
The totalAsCurrency value should always be a string with the currency symbol in front of it.

Additional info

  • Craft version: 3.4.25
  • Commerce version: 3.1.10
  • PHP version: 7.4
  • Database driver & version: 8.0.20
  • Other Plugins & versions: N/A
@lukeholder
Copy link
Member

Will be fixed in combination with #1541

@lukeholder
Copy link
Member

Fixed in 3.1.11

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

No branches or pull requests

3 participants