Default country in store filter search

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 1 reply thread
  • Author
    Posts
    • #123789
      t.bry
      Participant

      Hi,

      Is there a way to add a default country in the store search widget ‘store list : location filter’ and to hide the country dropdown menu ?

      Thanks a lot

    • #124187
      Sushobhan
      Keymaster

      Hello,
      You can use this hack to do so, thought setting $_GET like this is not considered as good practice.

      add_action( 'wcfmmp_store_lists_before_sidebar_location_filter', function() {
          if ( ! isset( $_GET['wcfmmp_store_country'] ) ) {
              $_GET['wcfmmp_store_country'] = 'IN'; // Change it to any country you like (Two letter country code)
          }
          add_filter( 'wcfmmp_is_allow_store_list_country_filter', '__return_false' );
      } );

      Add this code to your child theme’s functions.php
      In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/
      Let me know how this goes.
      Thanks!

Viewing 1 reply thread
  • You must be logged in to reply to this topic.