This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Use of users custom fields in a product search

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Use of users custom fields in a product search Reply To: Use of users custom fields in a product search

#27109
Ernest MarcinkoErnest Marcinko
Keymaster

Okay, if these are indeed the author metadata, then this custom code may do the trick:

Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!

add_filter('asp_post_content_before_tokenize', 'vendor_asp_post_content_before_tokenize', 10, 2);
function vendor_asp_post_content_before_tokenize($content, $the_post) {
	$meta_fields = array(
		'_store_description',
		'store_name',
		'wcfm_vendor_store_hours',
		'store_email',
		'phone',
		'payment',
		'wcfm_store_hours',
		'wcfm_shipping_policy',
		'wcfm_vacation_mode',
		'store_location',
		'wcfmmp_store_name'
	);
	foreach ( $meta_fields as $field ) {
		$s = get_user_meta( $the_post->post_author, $field, true );
		if ( !empty($s) ) {
			$content .= ' ' . $s;
		}
	}
    return $content;
}

After that, you will have to re-create the index table. You will find all the information in this documentation.