Add "Estimated price" text in the calculated price field

Hello, I wanted to add the text “Estimated Price” near the calculated price section.


Someone from hivepress told me its not possible through locotranslate. So I need a code snippet for that. Can anyone help me?

Please try this PHP snippet

add_filter(
	'hivepress/v1/models/listing/fields',
	function($fields){
		
		if(isset($fields['price'])){
			$fields['price']['display_template'] = 'Estimated price: %value%';		
		}
	
		return $fields;
	},
	1000
);
1 Like

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

Hi,
The rental price is calculated automatically after selecting the dates. However, the price that appears also includes the commission fee. It’s quite possible that customers don’t understand the price, as there’s no explanation of the fact that the price includes the commission fee.

My question is this: is it possible to add a note in the price field to specify that the price also includes commission charges?

Thank you!

Hi,

Please check the solution in this topic.

I hope it helps.

Hi,
The snipped code is not only for the zone where the price is located after selecting the dates, but also for the prices displayed on the listings.
I would like to leave the listing format untouched. I just want users to understand why the price isn’t what they expect (with the site’s extra commission).

My request is as follows: Can we just change the price text box after selecting the dates?

Example:

Before: €0.90
After date: Price: €0.90

Only after selecting the dates. Nothing else changes.

Many thanks for your feedback

Hi,
Can you please give me an answer ?

Thank you very much

Please try this code snippet instead:

add_filter(
	'hivepress/v1/models/listing/fields',
	function($fields){
		
		if(hivepress()->helper->is_rest() && isset($fields['price'])){
			$fields['price']['display_template'] = '%value% (incl. fees)';		
		}
	
		return $fields;
	},
	1000
);

It should affect the price format only when the price is re-calculated on changes in the booking form (e.g. dates).

Hi,
It works, thank you very much!