How to change price format

Hi there,

I’m still having problems displaying the “per hour” text for where the price is displayed on Listings. I was told to install Snippet Plugin and enter the following code:

add_filter(
‘hivepress/v1/models/listing/fields’,
function( $fields, $listing ) {
if (hivepress()->get_version( ‘bookings’ ) && hivepress()->booking->is_time_enabled( $listing->get_id()) && isset( $fields[‘price’] ) ) {
$fields[‘price’][‘display_template’] = ‘%value% / per Hour’;
}

	return $fields;
},
1000,
2

);

This was completed and then the code snippet was added into the Price Attribute within Listings but it’s still not displaying the text or had any effect on what’s displayed - please see screenshots attached.

Any help would be greatly appreciated! Thank you, Sam.


Uploading: Screenshot 2023-01-17 at 20.58.05.png…

Hi,

Please refer to this topic Changed Price per Day to Price per Hour but it’s not working