Get more for your money each Wednesday with big savings on selected extensions. Shop this week's deals.
Product Icon

Product Add-Ons for WooCommerce

Trending
by Woo
Offer add-ons like gift wrapping, special messages or other special options for your products.

Remove cents on front end if there are none

I think people should be able to format the add-on prices on the front end. If an add on costs $5, i would rather it show $5 instead of $5.00. The extra .00 just takes up unnecessary space, especially when the website is scaled down for mobile responsiveness

Author

soluxelifestyle

Current Status

Closed

Last updated: April 19, 2023

1 comment

Log in to comment on this feature request.

  1. jaskyt8 says:
    Product Developer May 31, 2024 10:57 am

    Hey there,

    Thank you for reaching out!

    The number of decimals that show up in frontend prices is determined by the WooCommerce > Settings > General > Currency options > Number of decimals option: https://d.pr/i/aiYqht.

    If this is set to 2, then all prices in your store will show up with 2 digits. If a price is not a decimal, then 0 digits will be added instead. This also happens if you create a Simple Product and assign a non-decimal price to it.

    To remove trailing zeros from prices, you may use the following PHP snippet:

    add_filter( 'woocommerce_price_trim_zeros', '__return_true' );

    To install PHP snippets like the above, I recommend using the Code Snippets plugin: https://wordpress.org/plugins/code-snippets/

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.