View profile for normal users

I used the snippet you provided to view the vendor profile link in account menu however it shows for regular users too. That’s very good except that it never fetches the uses profile.

An example of the standard user permalink for my site is ''www.hivepress.com/user/“username”

It works for both vendors and regular users. you can view their profile with that permalink structure.
Can you please revise the code snippet so uses that structure and so it fetches the username at the end slug?

And also can you please provide snippets so that requests show on regular users’ page so it’s not empty

This is the code snippet am referring to

add_filter(
	'hivepress/v1/menus/user_account',
	function ( $menu ) {
		if ( is_user_logged_in() ) {
			$vendor_id = HivePress\Models\Vendor::query()->filter(
				[
					'user' => get_current_user_id(),
				]
			)->get_first_id();

			if ( $vendor_id ) {
				$menu['items']['vendor_view'] = [
					'label'  => 'View My Profile',
					'url'    => hivepress()->router->get_url( 'vendor_view_page', [ 'vendor_id' => $vendor_id ] ),
					'_order' => 5,
				];
			}
		}

		return $menu;
	},
	1000
);

Hi,

Sorry, there’s no simple code snippet for this; it would require a custom implementation. If customizations beyond the available features are required for your site, please consider hiring someone for custom work https://fvrr.co/32e7LvY

Alternatively, you can send your proposal via this link, and we will estimate the implementation Request a Quote

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