Replace the login form with the registration one in Add Listing

Hello, I was wondering if it is possible to call the user registration popup in the List a service flow. The sign-in is currently used.

Please try this PHP snippet but please note that it can require further customization. If you are not familiar with the code customization then please consider hiring someone for custom work https://fvrr.co/32e7LvY

add_filter(
	'hivepress/v1/templates/user_login_page',
	function($template){
		$redirect_url = hivepress()->router->get_redirect_url();
		
		if(!$redirect_url || strpos($redirect_url, 'submit-listing') === false){
			return $template;
		}
		
		hivepress()->template->fetch_block($template, 'user_login_form');
		
		return hivepress()->template->merge_blocks(
			$template,
			[
				'page_content' => [
					'blocks' => [
						'page_title' => [
							'type' => 'content',
							'content' => '<h1 class="hp-page__title">Register</h1>',
						],
						
						'user_login_form' => [
							'type'   => 'user_register_form',
							'_order' => 10,
						],
					],
				],
			]
		);
	},
	1000
);
2 Likes

That code worked perfectly! I can not thank you enough for your fast and accurate response. You and your team are amazing.

1 Like

Does this force all logins to follow the vendor registration?
Is there a method to have a buyer registration (existing) and a vendor registration (add listing) separately?

Hi,
No, Vendor Registration is available only when you enable Direct registration in HivePress > Settings > Vendors or when you try to add Listings.
By default, registration is separate for users-sellers and users just in the modal window.

1 Like

Direct Registration is enabled in HivePress. But it sounds like you are confirming that the process is every account must use the standard Registration then Vendor Registration?

Yes, the initial registration is required for both regular users and vendors (this way a regular user can decide to become a vendor later), but if you access /register-vendor URL and the current user is not logged in or registered then the first step will show the login/registration form anyway (in the same way as for the listing process, if you click Add Listing while being logged-out).

P.S. If you purchased any of the themes or extensions please set the license key in the forum profile, this will enable the Premium Support badge - this ensures a 24-hour turnaround time.

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