Add description above the price extras

My client has asked for some examples to be displayed around the Extras field in the "List Property’ page. I found on the HivePress> Settings> Listings tab where the Extras are turned on after realizing they were not in the Listings> Attributes but am struggling to find the extras in the developer documentation or to even find the submit-listing/details/ page or php source.
Any directions will be greatly appreciated. Best Wishes!
P.S. Loving your products with ~90% of Use Cases configured!

Hi,

Please provide more details on what exactly you need to customize in the extras field (add a description for the field, etc.). Also, please note that extras are a repeater-type field; you can see the implementation here: hivepress/includes/fields/class-repeater.php at master · hivepress/hivepress · GitHub. If you just use the hivepress/v1/fields/repeater hook, it will work for all repeaters, so you need to check the field name additionally.

Thanks Andrii,
Our client wants to put an example on the “List a Property” page (/submit-listing/details/) and above or below the extras display an example such as “Example: Cleaning Fee, $xx, per stay, required” to help new property owners understand how to fill out that part of the form.
Best Wishes,
David

Hi,

Please use this PHP snippet:

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

Thank You Andrii!
I will implement and test this weekend and let you know the results.

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