Increase radius limit above 100

the increase of the radius works in the settings and also this code snippet works:

but the slider only works under 100 km if i go to 101 it just jumps to the 1000 km like setup in the backend settings.

Steps to reproduce

increase radius and try to lower on listing page

thank you in advance

Hi,

After you add this code snippet, please change the value in HivePress > Settings > Geolocation > Radius to 1000 and select Allow users to change radius.

Yes all done before
It displays and shows everything but it does not work like described above.
https://allumwandlung.com/?_sort=&s=&post_type=hp_listing&latitude=49.00689&longitude=8.403653&_radius=200&location=Karlsruhe%2C+Germany

Hi,

Thanks for the link to your site, we have checked in more detail and will try to add the possibility of increasing the radius to 1000 km in the following updates.

thank you very much!
we are doing a very big directory and this is really a crucial function.
If you filter anything and the radius is small it never shows any results since there are not that many organic hotels near.

Everything else is perfect.

any progress?

thank you in advance

Thank you for waiting. This issue is in the bug tracker, and we will fix it as soon as possible. As a temporary fix, please try this PHP snippet.

add_filter( 
	'hivepress/v1/forms/listing_filter', 
	function($form){
		if(isset($form['fields']['_radius'])){
			$form['fields']['_radius']['max_value'] = 1000;
		}
		
		return $form;
	},
	1000 
);

remove_filter( 'option_hp_geolocation_radius', [ hivepress()->geolocation, 'set_search_radius' ] );
add_filter( 
	'option_hp_geolocation_radius', 
	function($value){
		if ( get_option( 'hp_geolocation_allow_radius' ) ) {
			$radius = absint( hivepress()->helper->get_array_value( $_GET, '_radius' ) );

			if ( $radius >= 1 ) {
				$value = $radius;
			}
		}

		return $value;
	},
	1000
);
1 Like

thank you for the great support!
you will be soon the number 1 directory plugin for wordpress :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.