Created
August 12, 2013 17:54
-
-
Save steveosoule/6213285 to your computer and use it in GitHub Desktop.
Search Spring Catalog Init Function Example
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
/* From https://searchspring.zendesk.com/entries/23536266-SearchSpring-Catalog-init-function-and-options#facetOptionCallback */ | |
SearchSpring.Catalog.init({ | |
afterResultsChange: function() { $('.pagination').hide(); }, | |
backgroundFilters: { | |
category: ['Shirt', 'Shoes'], | |
department: ['Mens'] | |
}, | |
backgroundSortDir: 'desc', | |
backgroundSortField: 'price', | |
breadcrumbSeparator: ' » ', | |
collapseAll: false, | |
collapsedText: 'Show More Options', | |
compareCallback: function() { | |
console.log('Compare dialog opened'); | |
}, | |
compareText: 'Compare Items', | |
expandedText: 'Show Less Options', | |
facetOptionCallback: function(value_option, facet, value) { | |
console.log(value_option, facet, value); | |
}, | |
facets : '.leftNav', | |
facetTitleCallback: function(facet_container, facet_title, facet) { | |
console.log(facet_container, facet_title, facet); | |
}, | |
filterData: function(data) { console.debug(data); }, | |
filterPrefix: 'Option: ', | |
filters: { | |
color: ['Blue'] | |
}, | |
filterText: 'Refine Search Results', | |
forwardSingle: false, | |
historyText: 'Recent Searches', | |
layout: 'top', | |
leaveInitialResults : true, | |
loadCSS: false, | |
maxFacetOptions: 10, | |
maxFacets: 5, | |
modifyRequest: function(request) { | |
console.log(request); | |
request.page = '2'; | |
return request; | |
}, | |
nextText: 'Next', | |
previousText: 'Previous', | |
resetText: 'Reset', | |
result_layout: 'list', | |
results : '#results', | |
results_per_page: 12, | |
resultsPerPageType: 'link', | |
scrollTo: 'body', | |
scrollType: 'scroll', | |
showReset: false, | |
showSearchHistory: true, | |
showSubSearch: true, | |
showSummary: true, | |
sortText: 'Sort By ', | |
sortType: 'dropdown', | |
subSearchText: 'Subsearch:', | |
summaryText: 'Current Filters' | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment