Move 'view vendor' from listing footer to secondary attributes

How to move the ‘view vendor’ from listing footer to attributes sections in the listing block?

Hi,

Unfortunately, there’s no such feature, it would require a custom implementation. If customizations are required for your site, please try customizing it using the collection of code snippets Search · user:hivepress · GitHub and other developer resources, or consider hiring someone for custom work https://fvrr.co/32e7LvY

I use this php but it goes to the primary block. Where is the mistake?

add_filter(
	'hivepress/v1/templates/listing_view_block/blocks',
	function ($blocks, $template){
		$listing = $template->get_context('listing');
		
		if(!$listing){
			return $blocks;
		}
		
		$vendor_id = $listing->get_vendor__id();
		
		if(!$vendor_id){
			return $blocks;
		}
		
		return hivepress()->helper->merge_trees(
					[ 'blocks' => $blocks ],
					[
						'blocks' => [
							'listing_actions_primary' => [
								'blocks' => [
									'listing_vendor_link' => [
										'type'   => 'content',
										'content'  => '<a href="'.esc_url( hivepress()->router->get_url( 'vendor_view_page', [ 'vendor_id' => $vendor_id ] ) ).'"><p><strong>'.esc_html($listing->get_vendor__name()).'</strong></p></a>',
										'_order' => 50,
									],
								],
							],
						],
				]
				)['blocks'];
	},
	1000,
	2
);

Hi,

Sorry for the inconvenience, but customization is beyond our support scope - it includes fixing bugs and guidance about the available features Support Policy | HivePress

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