Skip to content

Instantly share code, notes, and snippets.

@wpeliteplugins
Created December 13, 2016 17:58
Show Gist options
  • Save wpeliteplugins/3ca1db514a61124ed7b82fc86da62377 to your computer and use it in GitHub Desktop.
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
<?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;
}
@wpeliteplugins
Copy link
Author

Copy & Paste above code to your theme functions.php file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment