Can we add edit profile button in account page

<?php
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'  => 'Vendor Profile',
					'url'    => hivepress()->router->get_url( 'vendor_view_page', [ 'vendor_id' => $vendor_id ] ),
					'_order' => 123,
				];
			}
		}

		return $menu;
	},
	1000
);

like this code in this code view vendor profile button in coming in account simliar edit profile button or nav item

Hi,

The shared snippet adds the vendor profile link to the user account menu, not to the front-end user account page. If you mean the account page (because the “edit profile” item is already in the menu but labeled “settings”), this would require further customizations for the hivepress/v1/templates/user_view_page template hook, you can use this URL to get the user profile settings link:

hivepress()->router->get_url( 'user_edit_settings_page' )

Hi,

Thanks for the clarification. However, we’re not looking to edit the user profile (i.e. account settings). What we actually need is a link or option to edit the vendor profile — not the user account.

We want users (who are vendors) to be able to edit their public vendor profile, such as business name, logo, description, etc.

Please guide us on how we can add a link to the vendor profile edit page instead of the user settings page.

Thanks!

Hi,

This link is already available in the account menu, it’s the “Settings” link, it contains both the user and vendor fields (if the current user is also a vendor). If you mean placing this link to the front-end vendor profile page that shows vendor listings, this would require code customizations.

can we add form fildes like custom vendor attributes editable for vendor

Hi @daniyal,

On the backend of WP visit Vendors > Attributes > Add Attribute then ensure the first checkbox option is enabled. (Front-end editing)

I hope this helps!

Cheers,
Chris :victory_hand:

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