• Resolved maipiusenza

    (@maipiusenza)


    Is there a function I can write to force the multiplier to round prices with some rule?
    For example, to 0,50 €
    So if I have an original price of 12,50 and a multiplier of 1.15, the final price will be 14,50 and not 14,38.

    Thanks
    Nadia

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter maipiusenza

    (@maipiusenza)

    I’ve found how to round it adding the formula to:

    add_filter(‘woocommerce_product_get_price’, ’rounded_price’, PHP_INT_MAX, 2 );

    and to:
    woocommerce_product_get_regular_price
    woocommerce_product_variation_get_regular_price
    woocommerce_product_variation_get_price
    woocommerce_variation_prices_price
    woocommerce_variation_prices_regular_price
    woocommerce_get_variation_prices_hash (different function)

    But it doesn’t affect the woocommerce mini cart widget, any tip to change it too?

    Thanks

    Plugin Support priyankajagtap

    (@priyankajagtap)

    Hi @maipiusenza,

    I am sorry for the delayed response to this.

    I have forwarded your query to the development team as it is technical. I will get back to you on the same as soon as the developer lets me know about this. I hope that is fine.

    Regards,
    Priyanka

    Plugin Support priyankajagtap

    (@priyankajagtap)

    Hi @maipiusenza,

    Sorry for the delay caused in this case.

    I have checked this with the developer. You can display the correct rounded price in the mini cart widget using the below filter.
    add_filter('woocommerce_product_get_price', 'rounded_price', PHP_INT_MAX, 2 );

    Please check the same and let me know if you have any questions.

    Regards,
    Priyanka

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