Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor podpirate

    (@podpirate)

    In version 1.2.0 (in a few days) there will be a checkbox, where you can disable the extra fee when free shipping is available.

    In the current version (1.1.1) you can use the woocommerce_pay4pay_applyfor_{$current_gateway_id} filter.

    This piece of code (best placed in a mu-plugin) should work:

    function free_payment_on_free_shipping( $apply_pay4pay ) {
        if ( in_array( 'free_shipping' , WC()->session->get( 'chosen_shipping_methods' ) )
            return false;
        return $apply_pay4pay;
    }
    
        // add filters to every payment method you need
    add_filter('woocommerce_pay4pay_applyfor_paypal','free_payment_on_free_shipping');
    add_filter('woocommerce_pay4pay_applyfor_[...]','free_payment_on_free_shipping');

    This snippet does not work for my. It throws me an error of:
    Parse error: syntax error, unexpected ‘return’ (T_RETURN) …
    I have WordPress v3.7.1. Woocommerce v2.0.20. and I am working with the version of WooCommerce Pay for Payment 1.0.2 and not I gustria switch to another version.
    Could give me some solution?.
    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Exclude extra fee when free shipping’ is closed to new replies.