How To

SortBy Options

3min
the default sortby functionality can be modified within template js by overriding the default script block additional supported options can be added as well as edits to the default labeling see custom overrides docid bc3gcthleeatoyujdtue for details on preparing for klevu js overriding see an in action example and the source code on the klevu codesandbox indexing supported options for product sorting must be supplied at the product level price / sale price title rating id / date (for newness) please see this support article https //help klevu com/support/solutions/articles/5000871480 sort order options for important information about sorting by newness api reference parameter description relevance default combination of klevu a i and merchandising configuration price asc, price desc sort the results by the saleprice value of each record name asc, name desc sort the results by the name of each record, in alphabetical order rating asc, rating desc sort the results by each record's average rating, if this data has been indexed in your store new arrival asc, new arrival desc sort your records based on their published date see klevu api documentation for available sorting options template js override the sortby options template block can be modified using the set template docid 6yvx9naw6ax68wygucob7 override the set custom helpers docid\ q0fqr 0vzosbxrbf7rs l are used to modify the desired display text of the selected option as well javascript