Monthly rental service - 3 Questions revolving it

Hi,

3 questions, I’m in dire need of help on.

  1. How can I change the “per night” pricing tag into “per month”?

  2. How can I set a minimum number of days listings can be booked for all hosts?

  3. How can I show additional information below the “Per night” wording in searches?. I’m trying to show both the “Price per month” as in question 1, but also show “Deposit amount”.

Thank you in advance for your guidance and wisdom!

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

Hi,

  1. Please try the code snippet suggested above.

  2. It can be set per listing, do you mean hiding this field in the listing edit form and setting the same minimum booking for all the listing?

  3. We plan to add the security deposit indication to the next Bookings update. Let me know if it’s urgent, I’ll provide a temporary fix for this.

Hi ihor,

Where do I insert the code to change to price per month?
thanks in advance

You can add custom PHP snippets using this plugin Code Snippets – WordPress plugin | WordPress.org but please note that the snippet above will just change the displayed format, it will not actually charge users per month on recurring basis, there’s no such feature in Bookings yet.

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