The search template is used to display results from a user product search query .
This template contains the following references:
Term | Data Type | Typical Output | Description |
---|---|---|---|
search.phrase | varchar | Keyword.. | The search phrase used by the user |
filter.brand | html | Brand Two (45), Brand Three (64),.. | HTML brand sort menu |
filter.per_page | html | <form>.. | HTML form per page filter |
filter.sort | html | <form>.. | HTML form sort by filter |
products | array | (See products (array)) |
products (array)
The products reference allows you to display products for the related search term. This reference is a recursive array containing the following references within each sub array contained within.
The products reference uses a snippet to display each product.
Term | Data Type | Typical Output | Description |
---|---|---|---|
id | int | 4 | The product id |
link | varchar | http://www.yourstore/product/product_name_1.html | Link to the product |
link_button | html | <button… | HTML button with link to the product |
short_description | varchar | Short description of product | Short description |
buy_button | html | <button id=”… | HTML buy button w/out quantity |
buy_button_image | html | <a href=“buy”><img src=”… | HTML image button |
price_ex_tax | varchar | £5.00 | The price excluding tax formatted to the local currency |
price_inc_tax | varchar | £5.90 | The price including tax formatted to the local currency |
price_was | varchar | £5.90 | The original price formatted to the local currency |
price_saved | varchar | £5.90 | The amount saved inc tax formatted to the local currency |
price_saved_percent | varchar | £5.90 | The percentage saved over the original price |
price_rrp | varchar | £5.90 | The original RRP price formatted to the local currency |
price_rrp_saved | varchar | £5.90 | The amount saved inc tax formatted to the local currency |
price_rrp_saved_percent | varchar | £5.90 | The percentage saved over the original price |
is_special | boolean | True / false | Determines if the product is on special offer |
savings_text | html | Youve saved x amount.. | HTML savings text |
tax_rate | varchar | 20 | Tax rate in percent |
name | varchar | Product Name | Title of the product |
name_short | varchar | Product Na.. | An abbreviated title of the product |
stock | varchar | 56 | The current stock level for this product |
code | varchar | 201224 | The product code |
man_code | varchar | DFG-45323 | The manufacturers code |
upc_code | varchar | 6346345 | The UPC code |
brand.name | varchar | Value Range | The brand / manufacturers name |
brand.id | varchar | 5 | The brand id |
is_free_delivery | varchar | True / false | Determines if this product is eligible for free delivery |
review_stars | html | <img src=”.. | The html image showing review stars |
review_average | int | 4 | The average rating out of 5 |
review_count | int | 6 | The total number of reviews |
login_for_price | boolean | True / false | User has to log in to view price if true |
qty_prices | html | 100+ $5.00, 200+ $4.85.. | HTML quantity prices |
image_one.active | boolean | True / false | Determines if image exists |
image_one.mini | varchar | http://www.yourstore/images/product_images/mini/product_image.jpg | Mini Image URL & Path |
image_one.small | varchar | http://www.yourstore/images/product_images/small/product_image.jpg | Small Image URL & Path |
image_one.thumb | varchar | http://www.yourstore/images/product_images/thumb/product_image.jpg | Thumb Image URL & Path |
image_one.main | varchar | http://www.yourstore/images/product_images/main/product_image.jpg | Main Image URL & Path |
image_one.large | varchar | http://www.yourstore/images/product_images/large/product_image.jpg | Large Image URL & Path |
image_two.active | boolean | True / false | Determines if image exists |
image_two.mini | varchar | http://www.yourstore/images/product_images/mini/product_image2.jpg | Second Image URL & Path |
image_two.small | varchar | http://www.yourstore/images/product_images/small/product_image2.jpg | Second Image URL & Path |
image_two.thumb | varchar | http://www.yourstore/images/product_images/thumb/product_image2.jpg | Thumb Image URL & Path |
image_two.main | varchar | http://www.yourstore/images/product_images/main/product_image2.jpg | Second Image URL & Path |
image_two.large | varchar | http://www.yourstore/images/product_images/large/product_image2.jpg | Second Image URL & Path |
image_three.active | boolean | True / false | Determines if image exists |
image_three.mini | varchar | http://www.yourstore/images/product_images/mini/product_image3.jpg | Third Image URL & Path |
image_three.small | varchar | http://www.yourstore/images/product_images/small/product_image3.jpg | Third Image URL & Path |
image_three.thumb | varchar | http://www.yourstore/images/product_images/thumb/product_image3.jpg | Third Image URL & Path |
image_three.main | varchar | http://www.yourstore/images/product_images/main/product_image3.jpg | Third Image URL & Path |
image_three.large | varchar | http://www.yourstore/images/product_images/large/product_image3.jpg | Third Image URL & Path |
image_four.active | boolean | True / false | Determines if image exists |
image_four.mini | varchar | http://www.yourstore/images/product_images/mini/product_image4.jpg | Fourth Image URL & Path |
image_four.small | varchar | http://www.yourstore/images/product_images/small/product_image4.jpg | Fourth Image URL & Path |
image_four.thumb | varchar | http://www.yourstore/images/product_images/thumb/product_image4.jpg | Fourth Image URL & Path |
image_four.main | varchar | http://www.yourstore/images/product_images/main/product_image4.jpg | Fourth Image URL & Path |
image_four.large | varchar | http://www.yourstore/images/product_images/large/product_image4.jpg | Fourth Image URL & Path |
The Following are now DEPRECATED, please do not use these, and update your templates to the image references above if possible
Term | Data Type | Typical Output | Description |
---|---|---|---|
image_mini | varchar | http://www.yourstore/images/product_images/mini/product_image.jpg | Mini Image URL & Path |
image_small | varchar | http://www.yourstore/images/product_images/small/product_image.jpg | Small Image URL & Path |
image_thumb | varchar | http://www.yourstore/images/product_images/thumb/product_image.jpg | Thumb Image URL & Path |
image_main | varchar | http://www.yourstore/images/product_images/main/product_image.jpg | Main Image URL & Path |
image_large | varchar | http://www.yourstore/images/product_images/large/product_image.jpg | Large Image URL & Path |
Usage
{% if search.phrase %} {% if filter.brand or tag %} <!-- Brand Filter Start --> <div class="brandFilter"> <div class="brandFilterLeft">Sort by Brand</div> <div class="brandFilterRight"> {{ filter.brand|raw }} </div> </div> {% endif %} <!-- End Brand Filter --> {% endif %} <div class="featureContainer"> {% if cat_submenu == false %} <hr /><div class="featureContainer"> {% if cat_name %} {% if products %} {% for product in products %} {% include "snippets/products.snippet.html" %} {% endfor %} {% else %} <p>Sorry we cannot find any products with the search term {{ search.phrase }}</p> {% endif %} {% else %} <p>Your search term is blank, please type in a word of phrase and try again</p> {% endif %} <div class="pageNav">{{ page_nav|raw }}</div> </div> {% endif %}
Comments
0 comments
Please sign in to leave a comment.