Hide shipping address when local pick up in order email

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Viewing 24 reply threads
  • Author
    Posts
    • #40612
      Jose
      Guest

      It’s very frustrating try to make changes to the template of an email: store-new-order.php in my child theme.

      At the end, I’m changing this one:

      <?php } ?>

      <?php if ( $order->has_shipping_method( ‘local_pickup’ ) ) { ?>
      <td valign=”top” width=”50%”>
      </td>

      <?php } else { ?>

      <?php if( ( $shipping = $order->get_formatted_shipping_address() ) && $WCFM->wcfm_vendor_support->wcfm_vendor_has_capability( $vendor_id, ‘view_shipping_details’ ) ) { ?>

      <td valign=”top” width=”50%”>

      <h3><?php _e(‘Shipping Address’, ‘wc-multivendor-marketplace’); ?></h3>

      <p><?php echo $shipping; ?></p>

      </td>

      <?php } ?>
      <?php } ?>

      But don’t work. I’m really apreciate your help.
      Resolved this one, I will try to change the other ones.

    • #40634
      WCFM Forum
      Member

      Hi,

      Where you have edit this template?

      I mean, please know me your override path!

      Be sure you have updated this here -> child theme/wcfm/emails/store-new-order.php

      And is this code right? – if ( $order->has_shipping_method( ‘local_pickup’ ) ) {

      Thank You

    • #40653
      Jose
      Guest

      Thanks for your replay !

      My path: child theme/wcfm/emails/store-new-order.php

      When you ask me about code right, I don’t know, sorry. It’s the reason to ask here !

      But, I’m not sure if in every template are the good way to resolve this one.

      Maybe will be better if we change:

      child theme/woocommerce/emails/email-addresses.php
      child theme/woocommerce/emails/plain/email-addresses.php

      I saw this code (but ist’s too old ?) https://stackoverflow.com/questions/38936283/woocommerce-hide-shipping-address-on-local-pickup-in-the-email

      if ( ! defined( ‘ABSPATH’ ) ) {
      exit;
      }

      ?><table id=”addresses” cellspacing=”0″ cellpadding=”0″ style=”width: 100%; vertical-align: top;” border=”0″>
      <tr>
      <td class=”td” style=”text-align:left; font-family: ‘Helvetica Neue’, Helvetica, Roboto, Arial, sans-serif;” valign=”top” width=”50%”>
      <h3><?php _e( ‘Billing address’, ‘woocommerce’ ); ?></h3>

      <p class=”text”><?php echo $order->get_formatted_billing_address(); ?></p>
      </td>
      <?php // ======================> Here begins the customization

      $shipping_local_pickup = false;
      if ( $items_totals = $order->get_order_item_totals() ) {
      foreach ( $items_totals as $items_total ) {
      if ( $items_total[‘value’] == ‘Local Pickup’ && !$shipping_local_pickup ) $shipping_local_pickup = true;
      }
      }
      // End

      if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && ( $shipping = $order->get_formatted_shipping_address() ) && !$shipping_local_pickup ) : ?>
      <td class=”td” style=”text-align:left; font-family: ‘Helvetica Neue’, Helvetica, Roboto, Arial, sans-serif;” valign=”top” width=”50%”>
      <h3><?php _e( ‘Shipping address’, ‘woocommerce’ ); ?></h3>

      <p class=”text”><?php echo $shipping; ?></p>
      </td>
      <?php endif; ?>
      </tr>
      </table>

    • #40710
      WCFM Forum
      Member

      Hi,

      Please check this – https://www.useloom.com/share/769aa7caa6734c968d4cba8c25485d1d

      WooCommerce by default handle this as per order shipping method, then why you want to change anything?

      Thank You

    • #40711
      WCFM Forum
      Member

      Well, for store new order we will take care of this as well in next update.

      You don’t have to change anything.

      Thank You

    • #40741
      jose
      Guest

      I was trying to have the same setting of you, but for me don’t work, allways when select local pickup then show me both billing and shipping address.

    • #40742
      WCFM Forum
      Member

      Hi,

      Kindly check one thing, whether your theme already have overrided template?

      If yes, then it’s compatible with latest WooCommerce or not!

      Thank You

    • #40752
      jose
      Guest
      This reply has been marked as private.
    • #40754
      WCFM Forum
      Member

      Hi,

      Please check under your parent theme folder, may be it’s already coming with overridden template!

      Between, which theme you are using?

      Thank You

    • #40756
      jose
      Guest

      Sorry, don’t understand when you ask me about parent theme folder.

      I use divi theme, and I have child theme of these.

    • #40759
      WCFM Forum
      Member

      HI,

      Yeah right, you are using child theme so you have main theme as well.

      Check under that theme folder “divi theme”

      Thank You

    • #40760
      Jose
      Guest

      Okay,

      Here you will find the structure of divi folder

      https://ibb.co/qsHT6Vy

    • #40763
      WCFM Forum
      Member

      OK, it has no WooCommerce template.

    • #40764
      Jose
      Guest

      Ok, I was trying to test in another domain with a clean install, and I don’t have the same problems.

      So, do you think that I have problems with some plugin ?

    • #40765
      WCFM Forum
      Member

      I think so, if you have any plugin related to shipping then disable those and take a look.

      Thank You

    • #40795
      Jose
      Guest
      This reply has been marked as private.
    • #40889
      WCFM Forum
      Member

      OK, I am checking this.

    • #40902
      WCFM Forum
      Member

      HI,

      Tell me one thing –

      1. WooCommerce Shipping and Vendor Shipping is different
      2. In vendor shipping separate package generated for each vendor
      3. Now if for one vendor Local Pickup available and for another not, then what will happen?

      Thank You

    • #40943
      Jose
      Guest

      Thanks for your replay !!

      1.- They are absolutely different.
      WC Shipping behaves globally and is not the case to use.
      But Vendor shipping has the ability to take all the variables according to the seller.

      2.- That’s right, when buying from different vendors, different packages must necessarily be made.

      3.- In the case of local pickup, a note should be sent with the vendor store address, and in the case of the other seller who only has dispatch available, it is sent to the shipping address

      I made a test with two vendors and 2 different products. And off course local pickup for one and the other one with dispatch.

      Was great, because every vendor received a email with specifict products and what type of delivery (local pickup or dispatch)
      The only one problem are that the product with local pickup come with shipping address, It’s very confusing, it can even cause the error to be sent by mail.

      So, that’s why my requirement to insist on help to solve this problem.

      Regards,

    • #40958
      WCFM Forum
      Member

      HI,

      I understand, we will take care of this at vendor level and their new order email at as well.

      Thank You

    • #41082
      Jose
      Guest

      Thank you so much !!
      I hope you can tell me when you find a solution.
      Regards anb happy holidays.

    • #41096
      WCFM Forum
      Member

      Sure, next update will be end of this week.

      Merry Christmas and have a great time 🙂

    • #41218
      WCFM Forum
      Member

      Hi,

      WCFM Marketplace 2.0.4 has just released, we have take care of this.

      Kindly update yours and take a look.

      Thank You

    • #41234
      Jose
      Guest

      Congratulation !! Resolved with your last update.

      But need to add another request, if you see in the orders list, when a customer choose local pickup, still showing shipping address, the same when you see order details.

      Will be amazing if you hide this one too !!, But I know, it’s a problem if a customer buy two products of the same vendor with different shipping options (local and delivery)

      Best regards,

    • #41326
      WCFM Forum
      Member

      HI,

      But need to add another request, if you see in the orders list, when a customer choose local pickup, still showing shipping address, the same when you see order details.
      – Sure, this will also resolve with WCFM next update

      Will be amazing if you hide this one too !!, But I know, it’s a problem if a customer buy two products of the same vendor with different shipping options (local and delivery)
      – Right, but now shipping address will be visible for that order

      Thank You

Viewing 24 reply threads
  • The topic ‘Hide shipping address when local pick up in order email’ is closed to new replies.