Change attribute field name for "price" in both "Listings" and "Bookings"

Hello,
I need to change the attribute field name “price” for both Listings and Bookings.

For Listings, I want to change “Price” to “Hourly Price”.
for Bookings, I want to change "Price to “Total Price”.

I have allowed times slots and multiple time slots to be booked. I used Loco Translate to change "Price to “Hourly Price” but this changes it to "Hourly Price for both forms.

Hi,

Please use this PHP snippet (How to add custom code snippets - HivePress Help Center):

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

I see you’re response for “Listings”.
What about for “Bookings”?

Hi,

Please use this PHP snippet too:

add_filter(
	'hivepress/v1/forms/booking_confirm',
	function( $form ) {
		$form['fields']['_price']['label'] = 'Custom text';

		return $form;
	},
  1000
);

Thank You!

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