• Resolved passas

    (@passas)


    Hello,
    I have a site and I use the weight based shipping plugin. I have a shipping rule for local pickup in the plugin. I need a custom message in completion email when a customer use plugin’s local pickup.
    For normal shipping option local pickup I use this function:
    `add_action( ‘woocommerce_email_before_order_table’, ‘add_order_email_instructions’, 10, 2 );

    function add_order_email_instructions( $order, $sent_to_admin ) {

    $shipping_method = @array_shift( $order->get_shipping_methods() );
    $shipping_method_id = $shipping_method[‘method_id’];

    if ( ! $sent_to_admin ) {
    if ( ‘local_pickup:5’ == $shipping_method_id ) {
    // local pickup option
    echo ‘<p>Custom Message</p>’;
    }
    }
    }

    What I have to change?
    Thanks a lot in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Dan

    (@dangoodman)

    Hello,

    It seems it should work for WBS if you replace local_pickup:5 with an actual shipping option id.

    Thread Starter passas

    (@passas)

    Thanks a lot for your answer!
    It didn’t work but I found another way to send emails, but I would like to find a solution if it’s possible!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Create email message when is weight based shipping is on’ is closed to new replies.