Options
Fast Simon AC support customization options via JS variable object __fast_options
.
Available Options
Option | Description | Type | Default | Example |
---|---|---|---|---|
"with_product_attributes" | Include product attributes in results | boolean | false | true |
"with_product_variants" | Include product variants in results | boolean | false | true |
"max_ac_products_mobile" | Max products on mobile | number | 5 | false |
"max_ac_products_tablet" | Max products on tablet | number | 5 | false |
"max_ac_products_desktop" | Max products on desktop | number | 5 | false |
"display_popular_on_empty_term" | Show popular results when the input is empty | boolean | true | false |
"display_popular_on_no_results" | Show popular results when no matches are found | boolean | false | true |
"mobileMedieaQuery" | Set mobile breakpoint | {maxWidth: number} | {maxWidth: 767} | {maxWidth: 600} |
"tabletMedieaQuery" | Set tablet breakpoint | {minWidth: number, maxWidth: number} | {minWidth: 768, maxWidth: 1024} | {minWidth: 600, maxWidth: 999} |
"desktopMedieaQuery" | Set desktop breakpoint | {minWidth: number} | {minWidth: 1025} | {minWidth: 1000} |
"full_spa" | Enable for Single Page Applications (SPA) | boolean | false | true |
"forceOpenAlways" | Keep autocomplete open at all times | boolean | false | true |
"is_chatbot" | Enable chatbot mode | boolean | false | true |
"fs_avoid_inject_on_interaction" | Inject AC script immediately (Shopify use case) | boolean | false | true |
"disable_ac_shadow_root" | Disable Shadow DOM in autocomplete rendering | boolean | false | true |
"parseAcProductTitle" | Custom function for parsing product titles | (title:string)=>string | undefined | (title) => title.toUpperCase() |
"parseAcProductPrice" | Custom function for parsing product prices | (price:string)=>string | undefined | (price) => "$" + price |
"parseAcProductCompare" | Custom function for parsing compare-at prices | (compare:string)=>string | undefined | (compare) => "$" + compare |
"avoid_bigcommerce_jwt_logged_on_user_check" | Avoid checking JWT token for logged-in BigCommerce users | boolean | false | true |
How to add custom options:
Add the __fast_options variable to your HTML head within a script tag, for example:
<script>
var __fast_options = __fast_options || {};
__fast_options.max_ac_products_desktop = 5;
__fast_options.max_ac_products_tablet = 3;
__fast_options.max_ac_products_mobile = 2;
__fast_options.with_product_attributes = true;
__fast_options.parseAcProductTitle=(title)=>{
return title.replaceAll(" ",",");
};
</script>