Make Claim Listing visible to verified vendor only

Hello, I would like to hide the Claim Listing link from regular users and make it visible to verified vendors only. This will prevent regular users from claiming a listing and requiring a vendor to be verified before they can see the Claim Listing link.

I searched the snippets and the forum but could not find anything. If this is possible, it will allow me to setup a proper flow to claim a listing and make it easier to match up a pending claim with the verified vendor.

Hi,

Unfortunately, such a feature is not available and would require a custom implementation. If you are familiar with coding or have access to a developer, we can provide general guidance. Please let me know if this works for you.

Yes, this works and I would appreciate any guidance you have. Thanks.

Please clarify if you want the user who wants to claim the listing to be a verified vendor (to see the Claim Listing link), or the vendor of the listing (that displays the link or not) to be verified? There may be a simple code snippet for this.

Thanks @ihor, I would like any verified vendor to see the Claim Listing link. I will verify if they are the appropriate vendor when I approve the claim manually.

I setup the vendor registration form with a required attachment field in which the user will need to attach a business license or utility bill with their business name and address in order to be verified. This way, it will be easier to match up the vendor with the listing when they claim it.

I’m trying to setup the flow this way:

  1. Require a user to register as a vendor before they can claim a listing.
  2. I manually review and verify the vendor.
  3. Once verified, the Vendor is able to see the Claim Listing link.
  4. Verified vendor claims a listing.
  5. I manually review and approve (or reject) the claim.

That being said, regular users will not see the Claim Listing links unless they register as a vendor and get verified.

Thanks!

Please try this code snippet:

add_filter(
	'hivepress/v1/templates/listing_view_page',
	function( $template ) {

		if ( ! is_user_logged_in() ) {
			return $template;
		}

		$vendor_id = hivepress()->request->get_context( 'vendor_id' );

		$vendor = null;

		if ( $vendor_id ) {
			$vendor = \HivePress\Models\Vendor::query()->get_by_id( $vendor_id );
		}

		if ( ! $vendor || ! $vendor->is_verified() ) {
			hivepress()->template->fetch_block( $template, 'listing_claim_submit_link' );
		}

		return $template;
	},
	1000
);

This works! Much appreciated.

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