How to add Ajax Live Search to the Kadence Theme?

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)

Kadence theme

SAVE 10% COUPON: SIMPLEHACKS

Grab it here

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;
}

Useful Kadence theme tutorials

  • Kadence WooExtras Plugin – Full Overview

  • How to Create a Sticky Mobile Bottom Menu for Kadence or Astra Theme?

  • Kadence Theme tutorial: How to Create Complex Headers with Kadence Pro?

  • How to Merge Learndash and Woocommerce Account Pages?

  • How to Create a Mega Menu With Kadence Theme?

  • Kadence Theme vs Blocksy Theme – Which is Better (Full comparison)

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top