No fee on some shipping options and add fee only on checkout
-
Hi there!
This plugin is great but maybe you can enable two other options:
1. To add the fee only on checkout instead of the cart
2. To disable the fee on not only on free shipping but on delivery options that will have no cost ??I will be adding fees to gateways cod, bacs and a 3rd party one, but i need to disable the fee if the customer chooses local pickup and local delivery (they will have no costs).
But i can’t do that! I looked at the posts https://www.ads-software.com/support/topic/different-cod-fee-depending-on-state-or-country and https://www.ads-software.com/support/topic/exclude-extra-fee-when-free-shipping and i even looked at your examples https://github.com/mcguffin/woocommerce-payforpayment but i just can’t do it.
I created a mu-plugin with this code:
<?php function free_payment_on_free_shipping( $apply_pay4pay ) { if ( in_array( 'local_pickup' , WC()->session->get( 'chosen_shipping_methods' ) ) return false; return $apply_pay4pay; } // add filters to every shipping method you need add_filter('woocommerce_pay4pay_cod_amount','free_payment_on_free_shipping'); ?>
But i’m obviously making something wrong as it doesn’t work and it breaks my website ??
Can you help?
Thanks!https://www.ads-software.com/plugins/woocommerce-pay-for-payment/
- The topic ‘No fee on some shipping options and add fee only on checkout’ is closed to new replies.