Created
December 13, 2016 17:58
-
-
Save wpeliteplugins/3ca1db514a61124ed7b82fc86da62377 to your computer and use it in GitHub Desktop.
Rounding Discount or Fees to nearest .99 cents - WooCommerce Payment Gateways Discount and Fees
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('woo_gatway_df_amount', 'woo_amount_to_99_cents' ); | |
function woo_amount_to_99_cents( $amount ) { | |
$amount = number_format( round( $amount, 0 ) - 0.01, 2 ); // round to 99 cents | |
return $amount; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Copy & Paste above code to your theme functions.php file