How to change the default search radius? (google map)

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!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM – Ultimate How to change the default search radius? (google map)

Viewing 16 reply threads
  • Author
    Posts
    • #78739
      id.manage
      Participant

      Hi Guys,

      May I ask you how can I change the range of the search radius? Current one is 0 to 100km. May I change it from 0 to 5 miles?

      Thanks!

    • #79154
      WCFM Forum
      Keymaster

      Hi,

      Right now, this only support distance in “KM”, not in “Miles”.

      If you want to set some different range in KM, that will be possible.

      Thank You

    • #79206
      id.manage
      Participant

      Thank you, Please can you tell me how to changer the range in KM? Thanks

    • #79549
      WCFM Forum
      Keymaster

      HI,

      Please keep add this code to your site –

      add_filter( 'wcfmmp_radius_filter_max_distance', function( $distance ) {
      	return 500;
      });

      Well, this will work after WCFM Marketplace next update.

      Thank You

    • #79782
      id.manage
      Participant

      Hi Thank you.

      May I ask you when is the next update? And where shall I add this code to? The function sheet?

    • #79965
      WCFM Forum
      Keymaster

      Hi,

      Well, this update is already there, WCFM Marketplace 3.1.10

      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/

      Thank You

    • #80010
      id.manage
      Participant

      Thank you!

    • #80022
      WCFM Forum
      Keymaster

      Welcome 🙂

    • #83762
      Bernard Omolafe
      Participant

      In the UK we use miles. It would be great to have that.

    • #83969
      WCFM Forum
      Keymaster

      Will add that option.

    • #84036
      Bernard Omolafe
      Participant

      Excellent thanks!!!

    • #92159
      villanidomenico
      Participant

      Hi try add the code with snipped but it not works or i don’t now wher it show for change the radius 0 to 5 Km

    • #93391
      WCFM Forum
      Keymaster

      Well, we have already added this as setting option at WCFM Admin Setting -> GEO Location – https://ibb.co/8XpDDvx

      No more custom code require for the purpose.

      Thank You

    • #125024
      justboloindia
      Participant

      Hi
      By default the search redious bar is at 2km. Want to set it till maximum range set on store manager. How to do that.

      • #125095

        Hello,

        For this you need to adjust “Maximum Radius to Search” (From WCFM-dashboard->Settings->Geo Location) and Radius start distance –

        add_filter('wcfmmp_radius_filter_start_distance',function($start_distance){
        	return 20;
        });

        Example – If you set Maximum Radius to Search -100
        Radius start distance – 20
        Then “radius range” value will be 100/20 = 5

        Hope you understand.

        Thanks.

        Attachments:
        You must be logged in to view attached files.
    • #125464
      justboloindia
      Participant

      Hi,
      My maximum search redious is 10, I want the default to 10 also. So, I have added following to my functions.php

      add_filter(‘wcfmmp_radius_filter_start_distance’,function($start_distance){
      return 1;
      });

      But it’s not working. Please suggest.

      • #125471

        Hello,

        Please check you have saved the “Maximum Radius to Search” settings 10km.(PFA) and added below code in your activated theme’s functions.php.

        add_filter('wcfmmp_radius_filter_start_distance',function($start_distance){
        return 1;
        });

        And please confirm whether you are able to see this picture2.png n front-end or not?

        Thanks.

        Attachments:
        You must be logged in to view attached files.
    • #125510
      justboloindia
      Participant

      Hi,
      Yes I can see that. The code is worked like gem. Good work. Keep it up guys.

    • #125676
      justboloindia
      Participant

      Hi,
      The map on shop page is taking much space. So, we want to remove the product image from shop pages. Can you please guide us regarding the same?

      • #125944

        Hello,

        Try this below code in your activated theme’s functions.php.

        function remove_woocommerce_actions() {	
        	add_action( 'woocommerce_before_shop_loop_item_title', 'wcfm_removewoocommerce_template_loop_product_thumbnail', 9 );
        }
        add_action( 'init', 'remove_woocommerce_actions' );
        function wcfm_removewoocommerce_template_loop_product_thumbnail(){
        	if ( function_exists( 'wcfm_is_store_page' ) && !wcfm_is_store_page()) {
        		remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 );
        	}
        }

        Thanks.

Viewing 16 reply threads
  • You must be logged in to reply to this topic.