Add fee for Cash on delivery payment method (cod) in Woocommerce
问题 In WooCommerce I need to apply a custom handling fee for a specific payment gateway. I have this piece of code from here: How to Add Handling Fee to WooCommerce Checkout. This is my code: add_action( 'woocommerce_cart_calculate_fees','endo_handling_fee' ); function endo_handling_fee() { global $woocommerce; if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return; $fee = 5.00; $woocommerce->cart->add_fee( 'Handling', $fee, true, 'standard' ); } This function add a fee to all transactions Is it