1.0.0 • Published 8 years ago

vtex-custom-autocomplete v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

vtexCustomAutoComplete

This function listen the event of the input and handles the auto complete resquest at any vtex based e-commerce.

Parameters

  • options object an object is required by parameter with the followings keys and content:
    • options.shelfId string the hash id of the shelf that should be rendered
    • options.appendTo jQuery a jQuery object of the container where the results will be placed
    • options.notFound function a callback function that returns a valid html text or an jQuery object, this result will be appended into the container when no results returns from the search
    • options.limit number the number of the itens that should be placed at once

Getting started

  • First find the shelfId at vtex admin/a -> template de prateleiras

Image 01

Image 02

Image 03

Than call the vtexCustomAutoComplete on your input by following the example bellow

Examples

$('#myInput').vtexCustomAutoComplete({
  shelfId: '37a38486-2baa-4df1-9b0e-02f96f08fa73',
  appendTo: $('#results'),
  notFound: function(){ return 'not found' },
  limit: 3
});