This template controls how product listings for brands appear.
products (array)
The products reference allows you to display products that relate to the brand. This reference is a recursive array containing the following references within each sub array contained within products.
The products reference uses a snippet to display each product.
Term | Data Type | Typical Output | Description |
---|---|---|---|
count | int | 8 | The current count id of this item |
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_link | varchar | /add/211232_1.html | HTML link to add product to basket |
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 |
tags | array | (See product tags) | |
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 | int | 5 | The brand id |
category.id | int | 5 | The master category id |
is_free_delivery | varchar | True / false | Determines if this product is eligible for free delivery |
is_set | int | 0 or 1 | Determines if this product is part of a set |
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 |
PRODUCT IMAGE REFERENCES
Discontinued Variables
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
<div class="featureContainer"> <hr /><div class="featureContainer"> {% if products %} {% for product in products %} {% include "snippets/products.snippet.html" %} {% endfor %} {% else %} <p>Sorry we cannot find any products for the brand {{ category.name }}</p> {% endif %} <div class="pageNav">{{ page_nav|raw }}</div> </div> </div>
snippets/products.snippet.html in detail
<div class="product" rel="{{ current_page }}"> <a href="{{ product.link }}" title="{{ product.name }}"><img src="{% if product.image_one.active %}{{ product.image_one.main|raw }}{% else %}{{ template_server_url }}pics/missing.gif{%endif %}" border="0" alt="{{ product.name }}" width="225" height="225" class="img-product" /></a> <p class="title"><a href="{{ product.link }}" title="{{ product.name }}">{{ product.name_short }}</a></p> <div class="price"><strong>{{ product.price_inc_tax|raw }}</strong></div> {% if product.review_average > 0 %} <div class="review">{{ product.review_stars|raw }}</div> {% endif %} <div class="buy"> {% if product.login_for_price == false or user.is_logged_on %} {% if product.is_set %} <a href="{{ product.link }}" title="{{ product.name }}"><button onclick="location.href='{{ product.link }}';return false;">More</button></a> {% else %} {{ product.buy_button|raw }} {% endif %} {% else %} <a href="javascript:onClick=alert(\'Please login to buy this item \n\nIf you do not have an account, registration is quick and easy. Once logged in you can view all our prices and make purchases online.\')"><img src="pics/buttons/buy" border="0" alt="Buy {{ product.name }} " /></a> {% endif %} </div> </div>
Product Tags (array)
This array accesses a list of product tags assigned to a product which you can cycle through and render using HTML. You will need to make sure any tags are associated with a tag group.
Each product.tags variable is an array containing the following.
Term | Data Type | Typical Output | Description |
---|---|---|---|
tag_group.name | varchar | Colour | The name of the tag group |
tag_group.id | int | 44 | The id of the Tag Group |
tag_group.url | varchar | http://www.. | An optional hyperlink |
tag_group.description | varchar | Colour | A Description for the Tag Group |
tag_group.image | varchar | tag-group-image.jpg | The image associated with the Tag Group |
tag.name | varchar | Red | The name of the tag associated to the group |
tag.id | int | 46 | The id of the tag |
tag.url | varchar | http://www.. | An optional hyperlink |
tag.description | varchar | Colour | A Description for the tag |
tag.image | varchar | tag-image.jpg | The image associated with the tag |
<p class="product-list-name text-large text-black"> {% for tag in product.tags %} {% if tag.tag_group.name == 'Collection' and product.category.id not in [25,27,28,29,30,31,32,33,51] %} {{ tag.tag.name }} {% endif %} {% endfor %} <a href="{{ product.link }}" title="{{ product.name }}">{{ product.name }}</a> </p>
Displaying New Products and Special Offers
Instantcart supports access to new products and special offers by using a url variable to toggle different product types.
You can use the get_var variable to access any url string variable from within your template. To display special offers for example, we can access the show variable from the url (ie mystore.co.uk/?show=specials) as follows:-
Instantcart supports the following views:- show=specials and show=new
{% if get_var.show == 'specials' %} {# Show special Offers #} <div class="leftPanel"> <div class="navigation"> <h1>Special Offers</h1> </div> {% if products %} {% for product in products %} {% include "snippets/products.snippet.html" %} {% endfor %} {% endif %} </div> {% elseif get_var.show == 'new' %} {# Show New products #} {% else %} <div class="leftPanel"> <div class="navigation"> <h1>New Products</h1> </div> {% if products %} {% for product in products %} {% include "snippets/products.snippet.html" %} {% endfor %} {% endif %} </div> {# display default home page #} <div class="leftPanel"> <div class="navigation"> <h1>{% if setting.intro_home %}{{ setting.intro_home }}{% else %}Welcome to {{ store_name }}{% endif %}</h1> </div> {% if main_features %} {% for product in main_features %} {% include "snippets/products.snippet.html" %} {% endfor %} {% else %} {% for product in features %} {% include "snippets/products.snippet.html" %} {% endfor %} {% endif %} </div> {% endif %}
Comments
0 comments
Please sign in to leave a comment.