-
-
Save sachyya/86e0f7998352fdcb2ac53bb81c02bee3 to your computer and use it in GitHub Desktop.
Pass preselected filters in Typesense search for WooCommerce
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
( function() { | |
window.addEventListener( 'load', function() { | |
// Typesense search for WooCommerce | |
// SchemaFilterName is the name of the facet defined in the schema | |
// tsfwInstance is the global variable passed for customization | |
// ts_woo_main_search is the unique identifier which can be changed from shortcode using unique_id attribute | |
tsfwInstance.ts_woo_main_search.helper.addDisjunctiveFacetRefinement('schemaFilterName', 'Tshirts').search(); | |
tsfwInstance.ts_woo_main_search.helper.addDisjunctiveFacetRefinement('schemaFilterName', 'Blue').search(); | |
} ); | |
}() ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment