Viewing 15 replies - 1 through 15 (of 28 total)
  • Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Only .00 cent values, or all?

    Thread Starter talonhead

    (@talonhead)

    All. No decimal places for cents…only on Checkout and Cart.

    Thread Starter talonhead

    (@talonhead)

    And I do realize you can remove those decimal places in Settings…but that also removes the “cents” from the Cart and Checkout….which is what I do NOT want.

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    I don’t understand for what purpose. If you don’t want cent values, why are your products not rounded?

    Thread Starter talonhead

    (@talonhead)

    I guess you don’t understand. my product prices ARE rounded…but shipping calculations with carrier APIs do NOT round…and I would like the “cents” added at that point.

    See what I’m saying?

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Well you could technically round those too if you wanted via code, but I don’t see how this affects the rest of the store. Thats only shown on cart and checkout.

    For consistency’s sake it would be best to round all.

    Thread Starter talonhead

    (@talonhead)

    But I don’t want to round shipping. It just isn’t worth it to do (I’ve tried it). Shipping rates that are returned need to have the decimal places…which in turn will reflect in the Total.

    Plus, you don’t “round” when it comes to State tax. You just don’t do that.

    So can this be done?

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    The best thing I can think of would be to:

    1. Show prices in the catalog excl. tax.
    2. Round all prices so they end with .00
    3. There is a snippet to hide .00

    add_filter( 'woocommerce_price_trim_zeros', '__return_true' );

    Then during cart the cents appear as normal.

    Thread Starter talonhead

    (@talonhead)

    But wouldn’t that hide .00 for ALL pages? I still want returned shipping rates to show .00 as well as State tax amount in Checkout. Thanks Mike for your promptness!

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Yes, but you’re state taxes are not going to be a nice round ‘.00’ so it doesn’t matter ??

    Thread Starter talonhead

    (@talonhead)

    lol Well, that is the point…to hide .00 from ALL pages…EXCEPT the Cart and Checkout. State tax and Shipping rates I want to show .00.

    Sounds like you have a solution.

    How do I go about it to give it a try?

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Add the above snippet I posted to your theme functions.php to start.

    Thread Starter talonhead

    (@talonhead)

    Beginning? End? In the Child? I’m not a code guy. I know where to add CSS but when it comes to php, I need a little help in that area.

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Some have a comment where to place it – it varies per theme.

    Thread Starter talonhead

    (@talonhead)

    I put this snippet into my Child theme function.php file. See screenshot to make sure it was placed correctly. https://prntscr.com/bhglab

    It’s not doing anything on the site.

    I did leave the settings like this on the “settings” page: https://prntscr.com/bhglul

    Thoughts?

Viewing 15 replies - 1 through 15 (of 28 total)
  • The topic ‘Remove the "cents" from site?’ is closed to new replies.