Bump listing to the top once the claim is approved

Not sure how doable this is out of the box, but for now, my client wants anyone who purchases a verified / claimed listing to immediately jump to the top of the listings for their region. Is there a way to automatically accomplish this?

Please try this PHP snippet but please note that it can require further customization

add_action(
	'hivepress/v1/models/listing/update_verified',
	function($listing_id, $value){
		$listing = \HivePress\Models\Listing::query()->get_by_id($listing_id);
		
		if(!$listing || !$value){
			return;
		}
		
		$listing->set_created_date(current_time( 'mysql' ))->save_created_date();
		$listing->set_created_date_gmt(get_gmt_from_date(current_time( 'mysql' )))->save_created_date_gmt();
	},
	1000,
	2
);
1 Like

Hmmmm… it’s doing it in reverse. The verified results are appearing at the end of the results. Not the begining. Try this example: https://curlyhairsalon.com/page/3/?_sort&s&post_type=hp_listing&latitude=34.113306&longitude=-118.147829&_region=place.308922604&_category=0&location=South+Pasadena%2C+California%2C+United+States&categories[0]=73&categories[1]=74

Please note that the suggested snippet works only for listings that get verified status after adding this code snippet.

It seems like it works for the test listing, which was added to test this code snippet as I understand, and it shows at the first position You searched for - Curly Hair Salon

Unfortunately, there is no simple solution to make changes for listings verified before adding this code snippet, it requires advanced customization. If you are not familiar with the code customization, then please consider hiring someone for custom work https://fvrr.co/32e7LvY

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