2
votes

Hoping i can get a solution for the following undesired behavior: I'm running Wordpress 4.5.3 with Woocommerce 2.6.4. I also have installed WooCommerce Payment Gateway Based Fees 2.2.16. This plugin allows me to add PayPal fees at checkout time.

I'm also as a default not allowing cash checkout.

The problem I have is that if a user uses a coupon that makes their total zero...I would have expected intuitively that i) PayPal fees would not be showing ii) you could simply place the order to checkout.

Neither is happening.

So I instead decided to enable cash checkout and automatically disable it -- ( using unset(), could not figure out a way of setting a gateway only unsetting ) -- if the cart total was equal to the PayPal fee using this hook: woocommerce_available_payment_gateways. This would at least allow them to checkout without the only option being the PayPal gateway.

Problem is that I have still not figured out how to stop the PayPal fees from showing and being added to the total.

Any guidance / help much appreciated

2
You check WooCommerce Payment Gateway Based Fees plugin and thir doc ?, may be there is any kind of rule to show fees or notmollie

2 Answers

2
votes

In the plugin, there is option Maximum Value to allow you to deactivate the product fee if the product price exceeds a certain amount . Please read https://docs.woocommerce.com/document/payment-gateway-based-fees/

After check this plugin. there is no option for minimum amount. but you can make fee 0 if total amount is 0. open the file woocommerce-additional-fees\classes\class-wc-add-fees.php.in calculate_gateway_fee_product add the code.

if($check_total==0){
   return $check_total;
}

before return $fees_calc; in line no 2122 . if any query you can comment.

1
votes

Could not get the plugin to do what i needed - i think its a poor oversight on behalf of the developer(s).

Seeing that all the other features of the plugin for me were overkill and not required..i ditched the plugin and simply added my own code for PayPal Fees with simple modification of this snippet:

Add a basic surcharge to all transactions https://docs.woocommerce.com/document/add-a-surcharge-to-cart-and-checkout-uses-fees-api/