• Hi

    I’m trying to add text to the email notification when a customer has chosen local pickup. I’m using the shipping zones in WooCommerce 2.6 and Table Rate Shipping plugin.

    The code I have so far is:

    add_action( 'woocommerce_email_before_order_table', 'add_order_email_lp', 10, 2 );
    
    function add_order_email_lp( $order, $sent_to_admin ) {
    
      if ( ! $sent_to_admin ) {
    
        if ( 'local_pickup:14' == $order->shipping_method ) {
          // shipping method
          echo '<p><strong>Instructions:</strong> This is local pickup</p>';
        } else {
          // other methods
          echo '<p><strong>Instructions:</strong>This is not local pickup</p>';
        }
      }
    }

    If I choose Local Pickup (which is this table rate: local_pickup:14) I’m not getting the correct text.

    I found this function online somewhere and it was originally for adding text based on billing method.

    Can anybody help me with this?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add text to email notification in WooCommerce when Local Pickup’ is closed to new replies.