Currently the Kadence theme does not have Ajax live search option. In this video I’m going to show you how to add Ajax live search to the Kadence. This way you will be able to live search for products, posts, etc.
Kadence Theme is currently one of the best WordPress themes. So, if you’re interested, then you can grab it here https://wpsimplehacks.com/kadence (SAVE 10% COUPON: SIMPLEHACKS)
Video: How to add Ajax Live Search to the Kadence Theme?
Code snippet shown in the video:
add_filter('asl_results', 'asl_display_price_w_currency', 10, 1);
function asl_display_price_w_currency($results) {
$currency = isset($args['woo_currency']) ?
$args['woo_currency'] : (
function_exists('get_woocommerce_currency') ?
get_woocommerce_currency() : '');
foreach ($results as $k=>&$r) {
if ( isset($r->post_type) &&
in_array($r->post_type, array('product', 'product_variation'))
) {
$p = wc_get_product( $r->id );
$price = $p->get_price();
if ( $currency != '' )
$price = wc_price($price, array('currency' => $currency));
else
$price = wc_price($price);
$r->title .= ' - ' . $price;
}
}
return $results;
}