Skip to content

Instantly share code, notes, and snippets.

@gareth-gillman
Created March 21, 2018 18:30
Show Gist options
  • Save gareth-gillman/e7ddb974debe2e91b291350231066253 to your computer and use it in GitHub Desktop.
Save gareth-gillman/e7ddb974debe2e91b291350231066253 to your computer and use it in GitHub Desktop.
Round Woocommerce Subtotal to the next integer
function gg_round_subtotal( $cart_subtotal; ) {
$cart_subtotal; = round( $cart_subtotal );
return $cart_subtotal;
}
add_action( 'woocommerce_before_calculate_totals', 'gg_round_subtotal', 10, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment