Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@rayrutjes
Created January 31, 2018 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rayrutjes/444e33eb67afabdd3cee068f6eb08eb6 to your computer and use it in GitHub Desktop.
Save rayrutjes/444e33eb67afabdd3cee068f6eb08eb6 to your computer and use it in GitHub Desktop.
Display WooCommerce InstantSearch on home page Algolia
<?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