Important: the below documentation is about Fast Simon legacy V.1
For the V.Next Customization Callback Hooks please see: https://docs.fastsimon.com/customization/docs/plp/logic
The JavaScript SERP callback functions may run twice if the search results filters given the filters deferred load. Your code should address the fact that the callback might be triggered twice per a given search query.
Check each one of the elements in this user guide for the relevant callbacks
<script>
var __isp_options = __isp_options || {};
__isp_options.isp_serp_callback = function(data, facets_only) {} // SERP rendered
__isp_options.isp_serp_no_results_callback = function() {} // *no* results
__isp_options.isp_serp_with_product_attributes = '1' // Include product attributes
__isp_options.isp_add_to_cart_callback = function(product_id, form_id) {} // After cart quantity update
__isp_options.isp_serp_look_a_like_txt = 'Related…' // Button text
__isp_options.isp_serp_articles_tab_name = 'Blog Posts' // CMS tab name
__isp_options.isp_serp_shopify_image_size = '206x309' // Change default image resolution
__isp_options.isp_serp_disable_seo_schema = true // Remove itemscope div
__isp_options.isp_serp_ajax_header_narrow_facets =[[]]] // Filter serp by parameters
__isp_options.isp_number_of_pages_to_show_load_more = 3; // decide how many pages before showing
__isp_options.image_rollover_filter(shopify_json_data) // custom handling for rollover images
__isp_options.isp_serp_search_within_filters = 1; // merchant seek to have search within filter values
__isp_options.isp_serp_search_within_search = 1; // merchant seek to have search follow-up after search
__isp_options.isp_serp_categories_in_serp = 1; // Display Categories in SERP
__isp_options.isp_content_loaded_callback; // after articles are loaded
__isp_options.variant_color_attributes = Array<filter_name> // build swatches for custom filter term
__isp_options.avoid_swatch_alphabetical_sort = false // disable swatch sorting
__isp_options.serp_color_swatch_limit = 5; // set the PLP visible swatch count
__isp_options.isp_max_serp_product_rollover_images = 5; // define the max number of images to display
__isp_options.isp_pre_serp_callback (isp_data); // runs before serp page loads (run twice)
__isp_options.PRICE_CURRENCY_CODE = '';
__isp_options.enable_optimized_mobile_header = true; // enable mobile optimizer
__isp_options.isp_mobile_filters_open_callback = function() {} // called right after the mobile filters are opened and rendered
__isp_options.mobile_filters_
__isp_product.on_isp_product_variants_hover_callback(productElement, productID); // runs after variant selector is loaded
</script>
<script>
var __isp_options = __isp_options || {};
__isp_options.STAR_REVIEWS_POSITION = 1 // 1 above or 0 under price
__isp_options.isp_turbo_link_in_new_tab = false // Turbo links in new tab or same window
__isp_options.variant_color_attribute = ‘color’ // Attribute name for color swatches
</script>
<script>
var __isp_options = __isp_options || {};
__isp_options.isp_optimized_open_callback; // when the autocomplete opens on mobile __isp_options.CATEGORIES_TITLE_HEADER = "collections"; // change the default category header name
__isp_options.PRODUCTS_TITLE_HEADER = "products";
__isp_options.PRODUCTS_POPULAR__TITLE_HEADER = "popular items";
__isp_options.SEARCHES_TITLE_HEADER = "searches";
</script>
<script>
var __isp_options = __isp_options || {};
__isp_options.isp_dropdown_callback = function(li_element, item_data) {} // Dropdown item
__isp_options.isp_dropdown_select_callback = function(event, ui) {} // Upon dropdown item click
__isp_options.isp_dropdown_open_callback = function() {} // Upon dropdown render
__isp_options.isp_dropdown_with_product_attributes = '1' // Include product attributes
__isp_options.isp_dropdown_with_product_variants; // allows variants to be retrieved in the drop down
__isp_options.isp_dropdown_select_callback(event, $jquery_element) // run after an item in the autocomplete was clicked
__isp_options.dropdown_align_inputbox = 'right' // Dropdown alignment
__isp_options.dropdown_narrow_by = [[]] // Filter by parameters (JSON)
__isp_options.keep_open_all_the_time = ‘1’ // Dropdown will remain open
__isp_options.appendTo = 'div#search_header_id' // Optional element to attach the Dropdown HTML
</script>
enable new autocomplete:
<script>localStorage.setItem("fast-simon-new-autocomplete- enabled", 1)</script>
<script>
var __isp_options = __isp_options || {};
__isp_options.isp_serp_pre_filter_callback: function(event) { }, // Fired after a shopper selects a filter
__isp_options.isp_serp_avoid_scroll_after_filter: true, //Avoid the scrolling after filter select.
__isp_options.isp_serp_disable_sticky_nav = false; // disable sticky filter container
</script>
<script>
var isp_related_options = isp_related_options || {};
isp_related_options.isp_related_callback = function() {} // Recommendations rendered
isp_related_options.slider = options_slidesToShow: 4 // Max product recommendations
isp_related_options.with_product_attributes = false // Include product attributes
isp_related_options.DECIMALS_REMOVE_ON_ROUND_PRICES = true // Remove .00 from prices like $49.00
isp_related_options.LAZYLOAD = "progressive" // Load images in advance
isp_related_options.PRICE_FROM_ALWAYS = true // Render from price wording
isp_related_options.RANDOMIZE = true // Add extra randomization
isp_related_options.STAR_REVIEWS_POSITION = 1 // 1 for above or 0 for under price
isp_related_options.responsive: [{breakpoint: 1400, settings: { slidesToShow: 4, slidesToScroll: 3, infinite: false}}, {breakpoint: 1024, settings: { slidesToShow: 3, slidesToScroll: 2, infinite: false}}]
</script>
<script>
var __isp_options = __isp_options || {};
__isp_options.isp_serp_quickview_callback = function() {} // QuickView opened
</script>