• Resolved stimartnet

    (@stimartnet)


    I noticed that it is not possible to disable fee if the customer chooses local pickup as the shipping method.
    I would like to get around this by creating a hook but I need help to do that.

    I have created this code into functions.php of my template:

    do_action( 'woocommerce_shipping_method_chosen', 'if_local_pickup_disable_fee', 10, 1 );
    function if_local_pickup_disable_fee( $chosen_method ) {
        $chosen_methods = WC()->session->get( 'chosen_shipping_methods' );
        $chosen_shipping = $chosen_methods[0]; 
        if ($chosen_shipping == 'local_pickup') { 
            // TODO
        }
    }

    Can you help me please?
    Thanks in advance and congratulation for your beautiful plugin.
    Marco

    • This topic was modified 4 years ago by stimartnet.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support kenil802

    (@kenil802)

    Hi @stimartnet,

    I will ask the developer regarding your query and get back to you with an update.

    Regards,
    Kenil Shah

    Thread Starter stimartnet

    (@stimartnet)

    Ok, thank you.
    I’m waiting for your feedback. ??

    Plugin Support kenil802

    (@kenil802)

    Hi @stimartnet,

    Regarding the query, I am afraid that it is not possible from our pluign to add the fees based on the shipping.

    Please let us know if you have any further queries.

    Regards,
    Kenil Shah

    Thread Starter stimartnet

    (@stimartnet)

    Ok, thanks.
    Can you add this features on future release?
    Anyway, could you tell me how I can modify the plugin code to do this thing?
    It is very important for me and I think that it is not logical to apply fees to local pickup based on my purpose.
    Thanks in advance.
    Marco ??

    Plugin Support kenil802

    (@kenil802)

    Hi @stimartnet,

    Apologies for the delay in response.

    I will take your suggestion into consideration and see what we can do about this.

    Regards,
    Kenil Shah

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Hook to disable fees if local pickup’ is closed to new replies.