title: Displaying a custom message based on customer postcode in WooCommerce
body: <p>I am trying to display a custom message based on customer postcode in WooCommerce using <a href="https://stackoverflow.com/questions/52747221/display-a-custom-message-based-on-customer-shipping-zone-in-woocommerce/52748192#52748192">Display a custom message based on customer shipping zone in Woocommerce</a>  answer code:</p>
  <pre><code>add_action( 'woocommerce_cart_totals_after_shipping' , 'shipping_zone_targeted_postcodes_custom_notice' );
  add_action( 'woocommerce_review_order_after_shipping' , 'shipping_zone_targeted_postcodes_custom_notice' );
  function shipping_zone_targeted_postcodes_custom_notice() {
      // HERE DEFINE YOUR SHIPPING ZONE NAME(S)
      $targeted_zones_names = array('France'); // &lt;======  &lt;======  &lt;======  &lt;======  &lt;======  
  
      // Get the customer shipping zone name
      $chosen_methods    = WC()-&gt;session-&gt;get( 'chosen_shipping_methods' ); // The chosen shipping mehod
      $chosen_method     = explode(':', reset($chosen_methods) );
      $shipping_zone     = WC_Shipping_Zones::get_zone_by( 'instance_id', $chosen_method[1] );
      $current_zone_name = $shipping_zone-&gt;get_zone_name();
  
      if( in_array( $current_zone_name, $targeted_zones_names ) ){
          echo '&lt;tr class=&quot;shipping&quot;&gt;
              &lt;td colspan=&quot;2&quot; style=&quot;text-align:center&quot;&gt;' . sprintf(
                  __( &quot;You'll be charged %s more for %s zip code&quot;, &quot;woocommerce&quot;),
                  '&lt;strong&gt;10%&lt;/strong&gt;',
                  '&lt;strong&gt;' . WC()-&gt;customer-&gt;get_shipping_postcode() . '&lt;/strong&gt;'
              ) . '&lt;/td&gt;
          &lt;/tr&gt;';
      }
  }
  </code></pre>
  <p>What modifications to make to the code?</p>
  <p>Can someone please assist me in what adjustments need to be made for this to happen please?</p>