Monthly rental service - 3 Questions revolving it

Hi,

  1. download the code snippet by pro plugin. Then add this code:
add_filter(
	'hivepress/v1/models/listing/fields',
	function( $fields, $model ) {
		if ( isset( $fields['price'] ) ) {
			$fields['price']['display_template'] = '%value% / per month';
		}

		return $fields;
	},
	1000,
	2
);

This will only change the text.

Unfortunately there’s no way to restrict the booking period this way (there are 2 modes at the moment, day-based and time-based bookings), but you can set the minimum booking duration to 30 days in the listing form.

Booking by Day, Week, Month or Year General

  1. Read post above. Currently the host can only set it manually to 30 days. But if you want it like that by default I am not sure if there is a simple code snippet that hivepress support team can provide you with.

  2. Not sure where the per night is in searches or what you mean by it. But you can use this code snippet below to put a description underneath the price p/month field in the add listing section.

add_filter(
	'hivepress/v1/models/listing/attributes',
	function( $attributes ) {
		if ( isset( $attributes['price'] ) ) {
			$attributes['price']['edit_field']['description'] = '/ write your custom text here';
		}
 
		return $attributes;
	},
	1000
);

You can also use loco translate plugin to change any static text on your site.

Hope this helps somewhat.

2 Likes