Title: Adding instructons for local pickup
Last modified: August 31, 2016

---

# Adding instructons for local pickup

 *  Resolved [beezwings](https://wordpress.org/support/users/beezwings/)
 * (@beezwings)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/adding-instructons-for-local-pickup/)
 * Hi! I’m trying to customize an email when a customer selects, “Local Pickup.”
 * I tried adding this to my funtions.php
 *     ```
       add_action( 'woocommerce_email_before_order_table', 'add_order_email_instructions', 10, 2 );
   
       function add_order_email_instructions( $order, $sent_to_admin ) {
   
         if ( ! $sent_to_admin ) {
   
           if ( 'local_pickup' == $order->shipping_methods ) {
             // local pickup
             echo '<p><strong>Instructions:</strong> These are the local pickup instructions.</p>';
           } else {
             // other methods (ie table rates)
             echo '<p><strong>These are the instructions for everything else</p>';
           }
         }
       }
       ```
   
 * But it doesn’t seem to be working 🙁
 * Can someone suggest a fix?
 * Thanks!
 * [https://wordpress.org/plugins/woocommerce/](https://wordpress.org/plugins/woocommerce/)

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/adding-instructons-for-local-pickup/#post-7158370)
 * Use
 *     ```
       $order->get_shipping_method()
       ```
   
 * To get the method ID.
 *  Thread Starter [beezwings](https://wordpress.org/support/users/beezwings/)
 * (@beezwings)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/adding-instructons-for-local-pickup/#post-7158385)
 * Thanks! Can you be super specific for the whole code? I’m a newbie (I had altered
   that code from something else).
 * I tried
 *     ```
       function add_order_email_instructions( $order, $sent_to_admin ) {
   
         if ( ! $sent_to_admin ) {
   
           if ( 'local_pickup' == $order->get_shipping_method ) {
             // Local Pickup
             echo '<p><strong>Instructions:</strong> These are the local pickup instructions.</p>';
           } else {
             // other methods (ie table rates)
             echo '<p><strong>These are the instructions for everything else!</p>';
           }
         }
       }
       ```
   
 * but that didn’t work either.
 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/adding-instructons-for-local-pickup/#post-7158386)
 *     ```
       $order->get_shipping_method
       ```
   
 * is wrong.
 *     ```
       $order->get_shipping_method()
       ```
   
 * is right. Try that.
 *  Thread Starter [beezwings](https://wordpress.org/support/users/beezwings/)
 * (@beezwings)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/adding-instructons-for-local-pickup/#post-7158425)
 * It didn’t work 🙁 The email I received still says, “These are the instructions
   for everything else” rather than “These are the local pickup instructions”
 * (PS: Thanks so much for the quick responses!)
 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/adding-instructons-for-local-pickup/#post-7158522)
 * if you simply add:
 *     ```
       echo $order->get_shipping_method();
       ```
   
 * to your email, what do you get?
 *  Thread Starter [beezwings](https://wordpress.org/support/users/beezwings/)
 * (@beezwings)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/adding-instructons-for-local-pickup/#post-7158573)
 * So, on another forum, someone said the following, but I don’t know how to implement
   that:
 * > There’s no shipping_method class member for the order abstract like that since
   > there can be multiple methods per order (whereas there’s only one payment method
   > per order). You’d need more additional code to get the array of shipping methods,
   > then check to see if the method you want is in that array to add your notices.
 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/adding-instructons-for-local-pickup/#post-7158592)
 * This is true, however the code I posted still works and returns the first found
   shipping method. You only have 1 per order so it doesn’t matter.
 *  Thread Starter [beezwings](https://wordpress.org/support/users/beezwings/)
 * (@beezwings)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/adding-instructons-for-local-pickup/#post-7158617)
 * Hi, I tried that, but then the email just returns: “local pickup” but I don’t
   need the email to say that; I want the email to say, “The instructions for local
   pickup are come to this address between 2-4pm etc. …” when the person has selected
   local pickup.
 * Thanks for your persistance.
 * Jessie
 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/adding-instructons-for-local-pickup/#post-7158620)
 * This was just to see what was returned. If it says ‘local pickup’ use that string
   in your previous if/else statement.
 *  Thread Starter [beezwings](https://wordpress.org/support/users/beezwings/)
 * (@beezwings)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/adding-instructons-for-local-pickup/#post-7158621)
 * Oh, wow! I just realized I had to use “Local Pickup” instead of “local_pickup”
   because it was looking for the actual output. Gee, thanks! So sorry it took so
   much back and forth, and I appreciate your patience. Have an awesome day!
 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/adding-instructons-for-local-pickup/#post-7158622)
 * There was an underscore before? Make sure the string matches what was echo’d.
 * Also before you forgot to include the brackets for the function name.
 *  Thread Starter [beezwings](https://wordpress.org/support/users/beezwings/)
 * (@beezwings)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/adding-instructons-for-local-pickup/#post-7158623)
 * (Just edited my previous response. Thanks a million!)

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Adding instructons for local pickup’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3640790)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 12 replies
 * 2 participants
 * Last reply from: [beezwings](https://wordpress.org/support/users/beezwings/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/adding-instructons-for-local-pickup/#post-7158623)
 * Status: resolved