How to change 'Radius Slider' default value.

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 5 reply threads
  • Author
    Posts
    • #133012
      delwyn
      Participant

      Hi,

      The radius filter always shows a default value of 2km.

      Is there anyway to do the following:

      1. Change I set the default value on the ‘radius_slider’ to “25km“?
      (in the Geolocation settings, there’s only 20km or 50km to choose, but i would like set it to 25km).

      2. Then, after setting the default ‘radius_slider’ value to 25km, i would like to hide that radius_slider.
      (This means, whenever customers enter their address in the ‘radius_address’ search bar, it will filter products within 25km radius by default, and they do not have to manually select the value on the radius_slider.

      Please see Attached screenshot.

      Kindly help.

      Thank you!

      Attachments:
      You must be logged in to view attached files.
    • #133038

      Hello,

      Point 1.
      Try this code in your functions.php

      add_filter( 'wcfm_max_radius_to_search_options', function( $distance ) {
      	$distance['25'] = '25';
      	return $distance;
      });
      add_filter( 'wcfmmp_radius_filter_max_distance', function( $distance ) {
      	return 25;
      });
      add_filter('wcfmmp_radius_filter_start_distance',function($start_distance){
      	return 1;
      });

      point 2.
      What we understand that you want the radius search functionality, without show the “radius” slider
      Then add below css in your theme’s style.css

      .wcfmmp-store-search-form div.wcfm_radius_slidecontainer {
          display: none;
      }

      Thanks.

    • #133099
      delwyn
      Participant
      This reply has been marked as private.
    • #133126

      Hello,

      Add css for –
      .wcfmmp-product-geolocate-search-form button {}

      Text change Filter to search –

      function wpfi_change_text( $translated_text ) {
      	if ( $translated_text == 'Filter' ) {
      		$translated_text = 'Search';
      	}
      	return $translated_text;
      }
      add_filter( 'gettext', 'wpfi_change_text', 20 );

      Try this code in your theme’s functions.php

      Thanks.

    • #133223
      delwyn
      Participant
      This reply has been marked as private.
    • #133505
      delwyn
      Participant
      This reply has been marked as private.
Viewing 5 reply threads
  • You must be logged in to reply to this topic.