Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

formatPrice strips decimals #5019

Closed
dinhtungdu opened this issue Oct 28, 2021 · 0 comments · Fixed by #5219
Closed

formatPrice strips decimals #5019

dinhtungdu opened this issue Oct 28, 2021 · 0 comments · Fixed by #5219
Assignees
Labels
block: mini-cart Issues related to the Mini-Cart block. type: bug The issue/PR concerns a confirmed bug.

Comments

@dinhtungdu
Copy link
Member

To reproduce

Steps to reproduce the behavior:

  1. Go to WooCommerce > Settings.
  2. Set the number of decimals separator to 2.
  3. Save changes.
  4. Add a block using formatPrice such as Mini Cart block to the page.
  5. Remove all products from the cart if any.
  6. See the error

Expected behavior

A clear and concise description of what you expected to happen.
The formatted price should always contain decimals as set in the WooCommerce settings.

Screenshots

Storefront mini cart with formatted by wc_price (above) vs Mini Cart block using formatPrice (below):

image

Environment

WordPress (please complete the following information):

  • Core version: 5.8.1
  • Gutenberg version (if installed): 2d6a363
  • WooCommerce version: 5.7.1
  • WooCommerce Blocks version: 6.2.0-dev
  • Site language: English
  • Any other plugins installed: WooCommerce Stripe Gateway 5.5.0
@dinhtungdu dinhtungdu added the type: bug The issue/PR concerns a confirmed bug. label Oct 28, 2021
@dinhtungdu dinhtungdu changed the title formatPrice strips decimals if the price is integer formatPrice strips decimals Oct 28, 2021
@nielslange nielslange added the block: mini-cart Issues related to the Mini-Cart block. label Nov 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: mini-cart Issues related to the Mini-Cart block. type: bug The issue/PR concerns a confirmed bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants