Support » Plugin: States, Cities, and Places for WooCommerce » Remove certain places

  • Resolved sotnas



    and congrats for the excelent plugin.

    I need disable some specific places, how is the hook for?

    Something like this?

    function scpwoo_remove_places_of_xx($places) {  //xx is the state ?

    Need remove the place

    Country code = PT

    State code = PO

    Places = Amarante, Gondomar

    Thank you

    • This topic was modified 1 year, 4 months ago by sotnas.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Yordan Soares


    Hello @sotnas,

    Try adding this code snippet to the functions.php file of your current child theme, a custom functions plugin or using the Code Snippets plugin:

     * Remove places from the District of Porto
    add_filter('scpwoo_custom_places_pt', 'scpwoo_remove_places_porto');
    function scpwoo_remove_places_porto( $places ){  
      global $places;
      unset($places['PT']['PO'][0]); //Amarante
      unset($places['PT']['PO'][3]); //Gondomar
      return $places['PT'];

    The [0] and [3] above, after $places['PT']['PO'], corresponds to the position of the districts (counting starts from 0). See Municipalities of Porto.

    Let me know if it works!

    Thread Starter sotnas


    Hi Yordan

    Works fine!

    thank ou so mutch

    Plugin Author Yordan Soares


    I’m glad to know it worked!

    If you don’t mind and have the time, do you think you could leave us a review?

    Thanks in advance and all the best with your store!

    Thread Starter sotnas


    Review with five stars done!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove certain places’ is closed to new replies.