Add description to the Price field

When I click on “list a property”, it asks for the price. How do I make a note? I want to make a note but I can’t seem to through the attributes settings.

Screenshot 2022-12-31 at 1.44.17 AM

Please keep in mind that I have the following:

  • RentalHive
  • Hivepress Version 1.6.16
  • Hivepress Blocks Version 1.0.0
  • Hivepress Bookings Version 1.4.11
  • Hivepress Favourites Version 1.2.2
  • Hivepress Geolocation Version 1.3.7
  • Hivepress Marketplace Version 1.3.7
  • Hivepress Messages Version 1.3.0
  • Hivepress Reviews Version 1.3.0
  • Hivepress Social Login Version 1.0.1

Hi,

This is a built-in field added by the Marketplace extension, unfortunately it’s not possible to edit it via attributes, but there may be a code snippet for adding a custom description to it, let me know if this works for you.

Can you provide me with a code snippet? And can you tell me where in the code snippet should I type or edit the custom description?

Please try this code snippet:

add_filter(
	'hivepress/v1/forms/listing_update',
	function( $form ) {
		if ( isset( $form['fields']['price'] ) ) {
			$form['fields']['price']['description'] = 'custom text here';
		}

		return $form;
	},
	1000
);

You can add it using the Code Snippets plugin.

1 Like

Is this made to add custom text in front end or back end?

It adds the description to the front-end listing form.

Hi,

  1. I’m still not sure what this is meant for. If this is meant for the vendor to add a custom note by the price, then this snippet doesn’t work for this. Because it just adds the words ‘Custom Text Here’ beneath the price, but I can’t edit and write my personal text.

  2. And besides, is it possible to add a note (from the backend) by the price, for example: ‘Please Note - 5% commission will be included in the price’ ?
    I can’t make this work via the Loco Translate. That will make it a part of the title. I don’t want to change the title, I just want to add a note in smaller font, beneath the title.

Yes, this snippet adds the Price field description (a text under the Price field label) in the front-end form, not back-end one. Please change the “Custom text here” in the snippet with “Please Note - 5% commission will be included in the price”, and vendors will see this note under the Price field label in the listing form (in the front-end form, they can’t access the back-end form anyway).

Great! Thanks

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