Ship by City

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 3 reply threads
  • Author
    Posts
    • #37979
      Mustafa
      Participant

      Hi,

      I have installed ( https://wordpress.org/plugins/wc-city-select/ ) And added the following filter to child theme function.php
      add_filter(‘wcfmmp_city_select_dropdown_enabled’, ‘__return_true’ );

      I have added states like below and it’s working fine
      [code]
      add_filter( ‘woocommerce_states’, ‘custom_woocommerce_states’ );
      function custom_woocommerce_states( $states ) {
      $states[‘US’] = array(
      ‘Eastern’ => ‘Eastern’
      );
      return $states;
      }
      [/code]

      But why cities are not showing up when I added this code?

      [code]
      add_filter( ‘wc_city_select_cities’, ‘my_cities’ );
      function my_cities( $cities ) {
      $cities[‘US’] = array(
      ‘New York’,
      ‘Phoenix’
      );
      return $cities;
      }
      [/code]

    • #38083
      Sayan Naskar
      Keymaster

      Hello,
      Group the cities with their respective states. Use the code below


      add_filter( 'wc_city_select_cities', 'my_cities' );
      /**
      * Replace XX with the country code. Instead of YYY, ZZZ use actual state codes.
      */
      function my_cities( $cities ) {
      $cities['XX'] = array(
      'YYY' => array(
      'City ',
      'Another City'
      ),
      'ZZZ' => array(
      'City 3',
      'City 4'
      )
      );
      return $cities;
      }

      But please note that in WCfMMP Shipping by city restriction will only work in “Shipping by Zone” not in “Shipping by Country” or “Shipping by Weight”

    • #38343
      Mustafa
      Participant

      Thank you, it is working now.

      But why it won’t work in “Shipping by Country” or “Shipping by Weight” ?

    • #38347
      Sayan Naskar
      Keymaster

      Hello,
      Actually shipping “Shipping by Country” and “Shipping by Weight” works much differently than “Shipping by Zone”
      Shipping by Zone supports multiple shipping methods in each zone which is not the case for others. They set a single cost for each matching country.

      Though we will plan some workaround to this in future updates for “Shipping by Country”.

      Thank You.

Viewing 3 reply threads
  • The topic ‘Ship by City’ is closed to new replies.