Content of the article
Should be activated extension: Quick Search
- per_page - products per page
- template_result - should be defined and there is is 5 predefined templates: list_1 | list_2 | list_3 | grid_1 | grid_2. Also is possible to create custom template (read below) and use it. Create folder 'woof_qs_templates' in current WordPress theme -> drop there any predefined template which you you can find in wp-content\plugins\woocommerce-products-filter\ext\quick_search\views\templates OR download this custom template as an example -> customize css as you want -> in template_result attribute write value like: 'custom/custom_1' - here first word 'custom' must be, then '/' and then name of folder where teplate is placed
- always_show_products - (1/0) show products always if 1, and if 0 - show products only if search request is going
- template_structure - 5 fields which can be displayed in templates. Example: img,title,price,sku,key_words - for grid templates works partly.
- orderby - Default sort-by (title-asc). Possible values: title-asc | title-desc | price-asc | price-desc
- header_text - title in the template header. By default is empty string.
Example: [woof_quick_search_results template_result='grid_1' always_show_products=1 per_page=9 template_structure='title,img,price,key_words' orderby='price-desc' header_text="My Products"]
Works ONLY with shortcode: [woof_quick_search] and shows seacrh results
How to create custom template: (for advanced users)
- Download this custom template
- create folder 'woof_qs_template' in current wordress theme
- unpack downloaded file and upload template
- open file woof_qs_template/custom_1/output.php and change its structure as you need, and of course change css you need in woof_qs_template/custom_1/css/ custom_1.css
- Special keys and classes in the template:
- 1,2,3,4 - Required classes for the template. woof_qs_result - class for wrapping the template container
- woof_qs_container - The class for the container where elements (products) must be inserted.
- woof_qs_item - Item class (product)
- woof_qs_no_products_item - Item class when there are no products in the search
- 5 - Displays sorting in the form as drop-down by price and title
- 6 - Displays sorting by title
- 7 - Sorts by price
- 8,9 - Displays pagination
- __SRC__ - in tag <img /> generate sttaribute 'src' with its value. Example: src='http://site.com/uploads/image.png'
- __IMG__ - generate the product img
- __URL__ - URL to the product page
- __TARGET__ - target value for the link, can be _self OR _blank (open in the new tab)
- __TITLE__ - title of the product
- __PRICE__ - price of the product
- __SKU__ - SKU of the product
- __KEY_WORDS__ - names of taxonomies that are contained in the product product (they are used also for text-based search)