Advertisement
lorro

WooCommerce - Round prices up

Apr 7th, 2021
488
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement