Options
Fast Simon PLP supports customization options via the JS variable object __fast_options
.
Available Options
Option | Description | Type |
---|---|---|
"with_product_attributes" | Include product attributes | boolean |
"full_product_url_path_redirect" | Redirects users to the full product URL path (in the format: collections/collectionName/products/productName). This is specific to Shopify setups. Use this option if you need to ensure that users land on the exact product page after navigating from a collection. | boolean |
"color_attribute_names" | All the possible color property names | string[] |
"relatedCollectionsConfiguration" | Defines a dictionary where each collection ID (a unique identifier for a collection) is mapped to an array of related collection IDs. This is useful when you want to suggest collections that are related to the current one. For example, if users are viewing a collection of summer dresses, you could also show related collections like “summer accessories.” | Record<string, string[]> |
"url_parameters_to_keep" | Defines which URL parameters (like filters or search terms) should be preserved when navigating through pages. For example, if a user applies filters to a product list, those filter settings will remain in the URL so that the same filters can be applied across different pages. | string[] |
"disable_selected_filters_promote" | Disables the feature that promotes or highlights certain selected filters. In many filtering systems, when a filter is applied, it is sometimes highlighted or moved to a prominent position to show that it’s active. This option turns off that feature, keeping the filters displayed in their default order. | boolean |
"disable_shadow_root" | Disable Shadow DOM | boolean |
"serp_media_queries" | Change screen breakpoints | {device: string, query: string}[] |
"default_value_for_hide_filters_button" | Sets the default visibility for filters. This means whether filters will be hidden or shown when the page first loads. For example, if set to "true," filters will be hidden, and users will need to click a button to show them. | boolean |
"disable_auto_close_filters_when_click_outside" | Prevents the filter panel from automatically closing when a user clicks anywhere outside of it. Normally, if a user clicks outside the filter section, the filter panel might close; this option disables that behavior, keeping the filter panel open until the user manually closes it. | boolean |
"parse_sub_category_tag_filter" | Enables parsing of subcategory tags, but this is only applicable to Shopify environments. This means the system will read and apply filters based on subcategories defined in Shopify's tagging system. For example, if products are tagged by categories like "Men" or "Women," this setting helps the system recognize and filter them properly. | (name: string) => string |
"custom_top_scroll_selector" | Custom top scroll selector | string |
"modern_mobile_filters_animation" | Set animation for modern mobile filters | AnimationOptions |
"apply_narrow_manually" | Apply narrow manually | boolean |
"size_attribute_names" | Set size attribute names | string[] |
"spa_disable_auto_close_mobile_menu" | Disables the automatic closing of the mobile menu in single-page applications (SPA). In a typical mobile interface, when users click anywhere outside the menu, it might automatically close. This option prevents that behavior, keeping the mobile menu open until the user chooses to close it manually. | boolean |
"spa_dynamic_sections" | Dynamic sections to be changed during SPA | Record<string, 'before' |
"before_spa_navigation_callback" | Before function for SPA | (event?: Event) => void |
"after_spa_navigation_callback" | After function for SPA | (event?: Event) => void |
"custom_missing_product_img" | Custom missing product images | string |
"get_selected_variant" | Get product data by variant | (productId: string) => {variant_id:string,image_url:string,sku:string, product_title:string,product_url:string,title:string, main_att:string,price:string,compare_price:string} / undefined |
"add_current_product_as_first_variant" | Adding product with first variant_id | boolean |
"swatch_width" | Set width of swatches | number |
"pagination_querystring_parameter" | Set pagination parameter | string |
"disable_auto_collapsed_filters" | Disable collapsed filters (just for filter layout=collapsed) | boolean |
"category_filter_as_regular_facet" | Set category filter as regular facet | boolean |
"variant_size_custom_sort_order" | Set variant size custom sort order (all sizes must be lower case) | string[] |
"list_view_default_value" | Set list grid view as default | boolean |
"numberOfColumns" | Set number of columns for grid view | Record<string, string> |
"numberOfColumnsList" | Set number of columns for list view | Record<string, string> |
"hide_oos_swatches" | Hide out of stock swatches | boolean |
"viewItemListCallback" | Called after triggering the view_item_list event | (event_items?: {items: GTAGItem[], category: 'filter' |
GTAGItem Interface
export interface GTAGItem {
item_list_id: string; // category id
item_list_name: string; // category name
item_id: string | number; // product id
item_name: string; // product name
item_brand: string;
currency: string;
price: number;
index: number;
}
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.with_product_attributes = true;
__fast_options.relatedCollectionsConfiguration = {
'collectionId1': ['relatedCollectionId1', 'relatedCollectionId2', 'relatedCollectionId3'],
'collectionId2': ['relatedCollectionId4', 'relatedCollectionId5', 'relatedCollectionId6'],
'collectionId3': ['relatedCollectionId1', 'relatedCollectionId2', 'relatedCollectionId4']
};
__fast_options.serp_media_queries=[
{device: 'mobile', query: '(max-width: 480px)'},
{device: 'tablet', query: '(min-width: 481px) and (max-width: 820px)'},
{device: 'desktop', query: '(min-width: 821px)'}
];
__fast_options.variant_size_custom_sort_order = ['one size', 'xs', 'small', 'medium', 'large', 'xl', '4x',
'5x', '6x', '0', '1', '1x', '1x (16-18)', '2', '2x', '2x (18-20)', '3', '3x', '3x (22)', '5', '5.5', '6',
'6.5', '7', '7.5', '8', '8.5', '9', '10', '11', '13', '13/14', '15', '15/16','34b','34c','34d','34dd (e)',
'34dd(e)','34ddd (f)','36c','36d','36dd (e)','36ddd (f)','38c','38d','38dd','38dd (e)','38ddd','38ddd (f)',
'40c','40d','40dd','40dd (e)','40ddd','40ddd (f)','40g','42d','42dd (e)','42ddd','42ddd (f)','42g','44c',
'44d','44dd (e)','44ddd','44ddd (f)','44f','44g','46d','46dd (e)','46ddd','46ddd (f)','46f','46g'];
__fast_options.numberOfColumns = {
'desktop': "3",
'tablet': "3",
'mobile': "2"
};
__fast_options.numberOfColumnsList = {
'desktop': "2",
'tablet': "2",
'mobile': "1"
};
</script>