You can add the code to the woo-donations.php file in the plugins/woo-donations folder.
For add to cart, go to line 138, this is the on_cart_page.
Line 139:
global $woocommerce;
Add below:
$amount1 = floatval( preg_replace( ‘#[^\d.]#’, ”, $woocommerce->cart->get_cart_total() ) );
$amount2 = ceil($amount1);
$amount3 = $amount2-$amount1;
Then line 155… find:
class=”wdgk_donation” placeholder=”Ex. ‘.get_woocommerce_currency_symbol().’200″>
Add after the 200″ value=”‘.$amount3.'”>
so should be
class=”wdgk_donation” placeholder=”Ex. ‘.get_woocommerce_currency_symbol().’200″ value=”‘.$amount3.'”>
If will for example take a cart total of 10.50, round it up to next whole number (11) and then does round up subtract the cart total.. to give the round up difference for the donation.
You can update the code on the other lines if using donations on checkout.
Hope that helps