HomeDesigning ThemeCartface Variables

Cartface Variables

Product Variables

Products : An array of products which can be looped to get each product information.

{% for product in products %}
// here each product will be available from the products list object array.
{% endfor %}

Product Short Description

product.short_description
{{ product.short_description }}
//Returns the short description for the product

Whether Product is new

product.is_treated_new
{% if product.is_treated_new == “Y” %}
//    The product is new.
{% endif %}
// Returns “Y” or “N” if the product is treated new or not.

If Product is on sale or not

product.on_sale
{% if product.on_sale == “Y” %}    
//The product is onsale.
{% endif %}
// Returns “Y” or “N” if the product is on sale or not.

Product ID

product.id
<input type="hidden" name="productId" value="{{ product.id }}"/>
//Returns the id of the product

Product Image

product.imagename
<img class="" src="{{base_url()}}/modules/products/uploads/{{product.imagename}}" alt="" />
//Returns a image associated with the product.

Product Sub-Image

product.subimages
{% for image in subimages %}
image.id
image.imgname
Image.default_status
{% endfor %}
//Returns an array of all  image associated with the product.

Availability Quantity

product.available_qnty
{{ product.available_qnty }}
//Returns the stock amount for the product. 
Inventory tracking needs to be enabled to return a value.

Product Name

product.name
{{ product.name }}
//Returns the name of the product.

Display Available Stock

product.display_avilbl_stock
{% if display_avilbl_stock==”Y” %}
//display stock available is on
{% endif %}
//Returns “Y” or “N” to check if you want to display available stock.

Product On Sale

product.onSale
{% if product.onSale %}
  The product is on sale.
{% endif %}
//Returns true if On Sale option is checked for the product.

Product Price

product.price
{{ product.price|number_format(2) }}
//Returns the current base price for the product.
product.product_price
{{ product.product_price|number_format(2) }}
//Returns the current price for the product. If the product is on sale
the sale price will be returned, if not the base price will be returned.

Sub-Total

product.subtotal
   {{ product.subtota }}
//Returns the subtotal for the product if it has any. if it has any discount
it will have subtotal.

Product Long Description

product.long_description
{% if product.long_description %}
    {{ product.long_description|unescape }}
{% endif %}
//Returns the short description for the product.

Product SKU

product.sku
{{ product.sku }}
//Returns the sku for the product.
all_discount_dtls
{% for discount in all_discount_dtls %}
discount.discount_name // for eg. Winter Sales
     discount.discount_amount // 15 % or amount of discount depends on the discount_type field below
     Discount.discount_type //  P = precentage of base price and A = just an amount of discount
{% endfor %}
//Returns an array of all discounts in the product.

Image URL for Theme Development

 {{ theme_url() }}{{ getActiveTheme() }}
// e.g. <img src="{{ theme_url() }}{{ getActiveTheme() }}/images/myimage.png" alt="" class="" >