• Resolved TeclaL

    (@teclal)


    Hello there,

    I would like to insert prices exclusive of taxes and displaying them on the shop and product page inclusive of taxes. I am able to do so.
    My problem is that the final prices displayed on the front-end is something like this: €192,76 while I would like it to be rounded so to be like this: €193,00
    I read that I can make it €193 moving the number of decimal from 2 to 0. But I do not want it to be without decilams.
    Is there a way to round up the taxes and make the final price rounded but with decimals?

    Thank you
    T

Viewing 2 replies - 1 through 2 (of 2 total)
  • Try this snippet:

    add_filter( 'wc_price', 'my_price', 3, 60 );
    function my_price( $return, $price, $args ) {
      // $return = price with currency symbol
      // $price = price as a number
      // $args = array (inc tax, exc tax)
      $price = number_format( ceil( $price ), 2 );
      $cs = get_woocommerce_currency_symbol(); // default currency symbol
      return $cs.$price;
    }
    laceyrod

    (@laceyrod)

    Automattic Happiness Engineer

    Hi there,

    Since we haven’t heard back from you, and this thread has been inactive for a bit, I’m going to mark it as Resolved now for the overall health of the forums. Please feel free to open a new one if you have any further questions.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Round prices’ is closed to new replies.