Moving position of location/address in vendor profile page

I’m looking to move the position of the vendor location/address on the vendor profile page. I can successfully remove it from it’s current position, but cannot output it elsewhere…

I know how to do this for the vendor name…

    add_filter(
      'hivepress/v1/templates/vendor_view_page',
      function( $template ) {
        return hivepress()->helper->merge_trees(
          $template,
          [
            'blocks' => [
              'vendor_summary' => [
                'blocks' => [
                  'vendor_name' => [
                    'type' => 'content',
                  ],	
                ],
              ],
              
              'page_content' => [
                'blocks' => [
                  'custom_vendor_name' => [
                    'type'   => 'part',
                    'path'   => 'vendor/view/page/vendor-name',
                    '_order' => 2,
                  ],
                ],
              ],
            ],
          ]
        );
      },
      1000
    );

… but I can’t find the path for the vendor details. The second half of the below code doesn’t work.

    add_filter(
      'hivepress/v1/templates/vendor_view_page',
      function( $template ) {
        return hivepress()->helper->merge_trees(
          $template,
          [
            'blocks' => [
              'vendor_summary' => [
                'blocks' => [
                  'vendor_details_primary' => [
                    'type' => 'content',
                  ],	
                ],
              ],
              
              'page_content' => [
                'blocks' => [
                  'custom_vendor_details' => [
                    'type'   => 'part',
                    'path'   => 'vendor/view/page/vendor-details',
                    '_order' => 2,
                  ],
                ],
              ],
            ],
          ]
        );
      },
      1000
    );

… can anybody help?

Please try this PHP code snippet as an example to move the location to another place on the vendor page.

add_filter(
	'hivepress/v1/templates/vendor_view_page',
	function($template){
		
		// Remove location field from current position and take it parameters
		$location_field = hivepress()->template->fetch_block($template, 'vendor_location');
		
		// Add location field to another place.
		return hivepress()->template->merge_blocks(
			$template,
			[
				'page_content' => [
					'blocks' => [
						'vendor_location' => $location_field,
					],
				],
			],
		);
	},
	1000
);

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