Snippet on top of messaging platform

In the messaging top panel I need to add a snippet “All messaging and Payment must go through this platform, sharing of email ID or phone number is against Terms of Service

I got a message from Ihor: Adding custom text above the chat is possible but requires a code snippet - if it’s ok please create a new topic here and our developer will provide the snippet https://community.hivepress.io/
Can you please tell me how to add this? I will really appreciate it

Please try this PHP snippet. Please change sign # in the code snippet with the URL by your requirements

add_filter(
	'hivepress/v1/templates/messages_view_page',
	function ( $template ) {
		return hivepress()->helper->merge_trees(
			$template,
			[
				'blocks' => [
					'page_content' => [
						'blocks' => [
							'message_custom_text'  => [
								'type'   => 'content',
								'content'   => '<p>All messaging and Payment must go through this platform, sharing of email ID or phone number is against <a href="#" target="_blank">Terms of Service</a></p>',
								'_order' => 5,
							],
						],
					],
				],
			]
		);
	},
	1000
);
5 Likes

This is briilliant, works perfectly. Thanks a lot
I need this to also display in the popops of contacting expert for the first time, for example using message Icon or “Reply to Listing” button, can this be done?

Sorry, there’s no simple code snippet for this, this would require a custom function for checking if it’s the first message, embedding it into the modal window, etc.

No not a custom function, just on these popups like the text in red, or some place on these popups I need that snippet to be displayed. Otherwise people are sharing email ID and phone numbers while replying to listing or this popup itself and then. Can you please suggest something for this?
(Need this on Reply to Listing and Send Message both popups it is not letting me share 2 screenshots)

Please try this PHP snippet

$filters = ['hivepress/v1/templates/listing_view_block', 'hivepress/v1/templates/listing_view_page', 'hivepress/v1/templates/vendor_view_block', 'hivepress/v1/templates/vendor_view_page'];

if ( hivepress()->get_version( 'marketplace' ) ) {
	$filters[] = 'hivepress/v1/templates/order_footer_block';
}

if ( hivepress()->get_version( 'bookings' ) ) {
	$filters[] = 'hivepress/v1/templates/booking_view_block';
	$filters[] = 'hivepress/v1/templates/booking_view_page';
}

foreach ($filters as $filter){
	add_filter(
	$filter,
	function ($template){
		return hivepress()->helper->merge_trees(
				$template,
				[
					'blocks' => [
						'message_send_modal' => [
							'blocks' => [
								'message_custom_text' => [
									'type'   => 'content',
									'content'   => '<p>All messaging and Payment must go through this platform, sharing of email ID or phone number is against <a href="#" target="_blank">Terms of Service</a></p>',
									'_order' => 20,
								]
							]
						],
					],
				]
			);
	},
	1000
);
}
2 Likes

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