• Resolved glitterdoll303

    (@glitterdoll303)


    Hi thanks again for your amazing work on this plugin! Is it possible to show the target and donations so far without the cents field? Having the extra zeros on the end makes the target look bigger than it is so it would be great to have for example target: 2000 instead of 2000.00 . If there is a code solution I could try that. thanks very much!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jonas

    (@flinnn)

    There is no simple solution yet other than setting the WooCommerce decimal places to 0 (which will also affect all other places where a price is displayed). But I can add an extra filter for you if that helps ??

    Best, Jonas

    Thread Starter glitterdoll303

    (@glitterdoll303)

    Thanks very much Jonas! So because other things I have on my site don’t need decimals but the taxes do, I can’t set woocommerce decimals to 0. But I found this filter for prices only, so I think this will work. Thanks again for your support!

    /**
    * Trim zeros in price decimals in functions.php
    **/
    add_filter( 'woocommerce_price_trim_zeros', '__return_true' );
    Plugin Author Jonas

    (@flinnn)

    Good solution, thank you for reporting it. ?? I added it to the documentation: https://www.wc-donation.com/documentation/advanced/remove-trailing-zeros-from-prices-in-woocommerce/

    Best,
    Jonas

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.