Created
January 31, 2018 19:01
-
-
Save rayrutjes/444e33eb67afabdd3cee068f6eb08eb6 to your computer and use it in GitHub Desktop.
Display WooCommerce InstantSearch on home page Algolia
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Inject instantsearch.js on every page regardless of backend config. | |
add_filter( 'algolia_wc_should_display_instantsearch', '__return_true' ); | |
// This will make sure the search is displayed on load. Oterwise it waits for the query to change to be displayed. | |
add_filter( 'algolia_config', function( array $config ) { | |
$config['woocommerce']['replace_page'] = true; | |
return $config; | |
}, 6 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment