Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › How to change 'Radius Slider' default value.
Tagged: WCFM Radius slider default value
- This topic has 7 replies, 2 voices, and was last updated 4 years, 7 months ago by Sarmistha Chakraborty.
- AuthorPosts
- May 19, 2020 at 2:49 pm #133012delwynParticipant
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. - May 19, 2020 at 3:21 pm #133038Sarmistha ChakrabortyMember
Hello,
Point 1.
Try this code in your functions.phpadd_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.
- May 19, 2020 at 4:47 pm #133099delwynParticipantThis reply has been marked as private.
- May 19, 2020 at 6:34 pm #133126Sarmistha ChakrabortyMember
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.
- May 19, 2020 at 11:13 pm #133223delwynParticipantThis reply has been marked as private.
- May 20, 2020 at 3:01 pm #133493Sarmistha ChakrabortyMemberThis reply has been marked as private.
- May 20, 2020 at 3:54 pm #133505delwynParticipantThis reply has been marked as private.
- May 22, 2020 at 12:14 pm #134091Sarmistha ChakrabortyMember
Using Cpanel/FTP.
Thanks.
- AuthorPosts
- You must be logged in to reply to this topic.