lorro

WooCommerce - Round prices up

Apr 7th, 2021
326
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // WooCommerce - Round prices up
  2. add_filter( 'wc_price', 'my_price', 3, 60 );
  3. function my_price( $return, $price, $args ) {
  4.   // $return = price with currency symbol
  5.   // $price = price as a number
  6.   // $args = array (inc tax, exc tax)
  7.   $price = number_format( ceil( $price ), 2 );
  8.   $cs = get_woocommerce_currency_symbol(); // default currency symbol
  9.   return $cs.$price;
  10. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×