Support » Plugin: Markup by Attribute for WooCommerce » removing decimal

  • Resolved martong91

    (@martong91)


    Hello, thanks for the plugin.
    I would like to remove decimals from frontend, it looks weird in my currency.
    Is it possible?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mark Tomlinson

    (@marktomlinson)

    I am not sure what you are asking. Can you give me an example?

    The plug-in uses WooCommerce currency settings. Is there a difference between how WooCommerce displays the amount and how the plug-in displays the markup?

    Sure, I attach a screenshot about my issue. Actually first WooCommerce displayed decimals too but I used this php code in function.php
    add_filter( ‘woocommerce_price_trim_zeros’, ‘__return_true’ );

    My currency don’t use decimals so it’s looks weird.
    Here is an imgur link for example: https://imgur.com/a/6rd60Hg

    Plugin Author Mark Tomlinson

    (@marktomlinson)

    Oh, I see. Since the Markup by Attribute plugin uses the WooCommerce currency formatting settings, may I suggest another approach that will remove the trailing zeros from both the price and the markup?

    Go to WooCommerce >> Settings >> General and scroll to the bottom. The last option should be the number of decimals. Set this to zero. This should immediately change the way the price and the markup are displayed.

    If you’ve already set the prices, the markup descriptions will contain the trailing zeros. You can eliminate them by using the Set regular price function again.

    Hope this works for you.

    Yeah tried that before but it always went back to ‘2’. Anyway I found the issue: the Currency switcher plugin blocked the basic woocommerce decimal setting and I had to change the decimals in the currency switcher setting. My bad. Everything is good now, thanks for the help.

    • This reply was modified 4 months, 1 week ago by  martong91.
    Plugin Author Mark Tomlinson

    (@marktomlinson)

    Good to hear! Thanks for your interest in Markup by Attribute.

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