Custom URL on 'Reply to listing' button

I would like to change the url of the reply to listing button and redirect users to a custom form on a different page instead of the default message form.

ie. Instead of the link being https://example.com/listing/house/#message_send_modal_3416
It would change to something like this https://example.com/bookingform-house

I would like to do this because the default messaging form is very limited with only 1 textarea and an attachment section on the form. In this video: https://www.youtube.com/watch?v=K99tO0-42nE that Hivepress posted on YouTube it shows how you can customize the form, however when the message is sent it does not show any of the additional field values (eg. ‘Subject’ or ‘Your Name’) in the message template. So I am not sure how this is a useful tutorial.

I tried doing it myself with the code in the video as shown below:

add_filter(
	'hivepress/v1/forms/message_send',
	function( $form ) {
		$form['fields']['name'] = [
			'label' => 'Your Name',
			'type'  => 'text',
			'required' => 'required',
		];
		
		return $form;
	}
);

So if there is something that I am doing wrong or if there is another way to add in additional fields and have them appear in the message, then any assistance with that would be great.

If changing the url is not possible then is there any way to add in a custom button to the page that will redirect to a different page?

Thank you

1 Like

Hi,

You can overwrite this key using the child theme and template parts and change the URL there (в файлі listing/view/page/message-send-link.php), please see this doc How to override template parts - HivePress Help Center. Please note that the custom form will no longer be in the context of the listing and will not be sent to the vendor. But if you are the only admin on the site, everything should work without any issues.

2 Likes

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