As described in the Templates Overview, most template files relate to an object stored in Cohub's database. Some objects are available across the entire Store, while others are only available in specific templates.

Universal/Site Wide Objects

  • company_name 
  • company_address 
  • company_logo 
  • company_phone 
  • collections  - all collections
  • categories  - all categories
  • products  - all products
  • customer - the current customer, if signed in
  • cart - the current cart
  • brands - all brands
  • is_admin? - a boolean representing whether or not the current user has admin privileges
  • path - the current path
  • canonical_url - the canonical_url for the current page. Useful when working with things like collection or category pages where there might be filters or pagination.
  • csrf_token - used with forms to prevent Cross-Site Request Forgery

Below is a list of all template files and the Objects and Methods available within them.

brands/index.liquid

{{ brands.with_active_products }} Collection
Returns a collection of all brands that have at least one active product.

{{ brans.all }} Collection
Returns a collection of all currently active brands.

brands/show.liquid

{{ brand.name }} String
The name of the brand.

{{ brand.id }}  Integer
The ID of the brand. Provided as a convenience and used rarely.

{{ brand.path }} String
The URL of the brand on your Store.

{{ brand.url }} String
An alias method for {{ brand.path }}.

{{ brand.products }} Collection
A collection of all active products that belong to the brand.

{{ brand.slug }} String
The slug of the brand.

{{ brand.selected? }} Boolean
A boolean representing whether or not this brand has been chosen as a product filter

{{ brand.logo }} Objects
The logo of the brand.

categories/index.liquid

{{ categories.all }} Collection
A collection of all categories.

{{ categories.active }} Collection
A collection of all active categories.

{{ categories.roots }} Collection
A collection of all root level categories.

{{ categories.root_categories }} Collection
A collection of all root level categories returned in groups of 6.

{{ categories.by_id_1 }} Object
Returns a specific category by its ID.

categories/show.liquid

{{ category.id }} Integer
The ID of the category. Provided as a convenience and used rarely.

{{ category.name }} String
The name of the category.

{{ category.friendly_id }} Integer
The friendly_id of the category. Provided as a convenience and used rarely.

{{ category.path }} String
The URL of the category on your Store.

{{ category.url }} String
An alias method for {{ category.path }}.

{{ category.parent_categories }} Collection
A collection of all active parent_categories of the category.

{{ category.child_categories }} Collection
A collection of active child_categories of the category.

{{ category.products }} Collection
A collection of all active products assigned to the category.

{{ category.product_count }} Integer
An integer representing the total number of products assigned to the category.

{{ category.product_types }} Collection
A collection of the category's product_types.

{{ category.properties }} Collection
A collection of the properties from each product assigned to the category.

{{ category.slug }} String
The slug of the category.

{{ category.images }} Collection
A collection of the category's images.

{{ category.primary_image }} Object
The category's primary_image.

collections/index.liquid

{{ collections.all }} Collection
A collection of all collections.

collections/show.liquid

{{ collection.id }} Integer
The ID of the collection. Provided as a convenience and used rarely.

{{ collection.name }} String
The name of the collection.

{{ collection.path }} String
The URL of the collection on your Store.

{{ collection.url }} String
An alias method for {{ collection.path }}.

{{ collection.content }} String
The content (text description) of the collection.

{{ collection.products }} Collection
A collection of all active products assigned to the collection.

{{ collection.images }} Collection
A collection of the collection's images.

{{ collection.primary_image }} Object
The collection's primary_image.

customers/show.liquid and customers/edit.liquid

{{ customer.id }} Integer
The ID of the customer. Provided as a convenience and used rarely.

{{ customer.name }} String
The customer's full name.

{{ customer.first_name }} String
The customer's first_name.

{{ customer.last_name }} String
The customer's last_name.

{{ customer.email }} String
The customer's email.

{{ customer.gravatar_url }} String
The customer's gravatar URL, if they have one.

{{ customer.marketing_allowed }} Boolean
A boolean representing whether or not the customer accepts marketing emails.

{{ customer.phone_number }} String
The customer's phone number.

{{ customer.past_due }} Boolean
A boolean representing whether or not the customer is past due on invoice payments.

{{ customer.past_due_since }} Date
A date representing when the customer was marked as past due on invoice payments.

{{ customer.gsa? }} Boolean
A boolean representing whether or not the customer is eligible for GSA pricing.

{{ customer.credit_cards }} Collection
A collection of all the customer's saved credit cards.

{{ customer.orders }} Collection
A collection of all of the customer's orders that aren't pending or deleted.

{{ customer.addresses }} Collection
A collection of all of the customer's saved addresses.

{{ customer.additional_email_addresses }} String
A list of the customer's additional email addresses.

{{ customer.last_ordered }} Date
A date representing the last time this customer placed an order.

{{ customer.reset_token }} String
The customer's password reset token. The reset token exists only briefly in the database.

{{ customer.yearly_sales_stats }} Collection
A collection of the customer's sales data broken out by year.

Because you may define custom fields for a customer, you may access those like this:

{{ customer.custom_field_name }} 

products/index/liquid

{{ products.all }} Collection
A collection of all products.

{{ products.active }} Collection
A collection of all active products.

{{ products.on_sale }} Collection
A collection of all active products that are on sale.

{{ products.on_clearance }} Collection
A collection of all active products that are on clearance.

{{ products.by_id_1 }} Object
Returns a specific product by its ID.

Note: The Products object has more complex methods that are covered in the Product Filtering article.

products/show.liquid

{{ product.id }} Integer
The ID of the product. Provided as a convenience and used rarely.

{{ product.name }} String
The name of the product.

{{ product.model }} String
The model of the product.

{{ product.part_number }} String
The part number of the product.

{{ product.internal_reference_number }} String
The internal reference number of the product.

{{ product description }} HTML String
The description of the product. The description is returned as HTML and may contain its own styling.

{{ product.brief_description }} String
The brief description of the product.

{{ product.price }}  Decimal
The price of the product.

{{ product.active }} Boolean
A boolean representing whether or not the product is active.

{{ product.regular_price }} String
The regular price of the product. Useful for comparing prices if the product is on sale.

{{ product.created_at }} Date
The date when the product created.

{{ product.updated_at }} Date
The date when the product was last updated (saved).

{{ product.path }} String
The URL of the product on your Store.

{{ product.url }} String
An alias method for {{ product.path }}.

{{ product.brand }} String
The brand name of the product.

{{ product.on_sale? }} Boolean
A boolean representing whether or not the product is on sale.

{{ product.on_clearance? }} Boolean
A boolean representing whether or not the product is on clearance.

{{ product.msrp }} String
The MSRP of the product. In the admin product form, this field is called "Compare At Price".

{{ product.ships_internationally? }} Boolean
A boolean representing whether or not the product is available for international shipments.

{{ product.categories }} Collection
A collection of all categories that the product belongs to.

{{ product.primary_category }} Object
The product's primary category.

{{ product.product_type }} Object
The product's product type.

{{ product.properties }} Collection
The product's properties.

{{ product.custom_fields }} Collection
The product's custom fields.

{{ product.reviews }} Collection
A collection of the product's reviews.

{{ product.review_count }} Integer
An integer representing the number of published reviews for the product.

{{ product.average_rating }} Integer
An integer representing the number of published reviews for the product.

{{ product.five_star_rating_count }} Integer
An integer representing the number of published reviews with a 5 star rating for the product.

{{ product.four_star_rating_count }} Integer
An integer representing the number of published reviews with a 4 star rating for the product.

{{ product.three_star_rating_count }} Integer
An integer representing the number of published reviews with a 3 star rating for the product.

{{ product.two_star_rating_count }} Integer
An integer representing the number of published reviews with a 2 star rating for the product.

{{ product.one_star_rating_count }} Integer
An integer representing the number of published reviews with a 1 star rating for the product.

{{ product.related_products }} Collection
A collection of the product's related products.

{{ product.variants }} Collection
A collection of the product's variants.

{{ product.options }} Collection
A collection of the product's options. 

{{ product.images }} Collection
A collection of the product's images.

{{ product.documents }} Collection
A collection of the product's documents.

{{ product.primary_image }} Object
The product's primary image.

{{ product.image }} Object
An alias method for {{ product.primary_image }} .

{{ product.to_json }} Object
A JSON representation of several product properties. Useful for manipulating product information in a Javascript file.

Because you may define custom fields for a product, you may access those like this:

{{ product.custom_field_name }} 

reviews/show.liquid

{{ review.title }} String
The title of the review.

{{ review.customer }} Object
The customer who wrote the review.

{{ review.nickname }} String
The nickname of the reviewer.

{{ review.rating }} String
The rating of the review.

{{ review.content }} String
The content of the review.

{{ review.reviewed_on }} Date
The date that the review was created.

{{ review.created_at }} Date
Alias method for {{ review.reviewed_on }} .

sales_orders/show.liquid

{{ order.id }} Integer
The ID of the order. Provided as a convenience and used rarely.

{{ order.name }} String
The name of the customer who placed the order.

{{ order.order_hash }} String
The order hash of the order. Useful for linking to the order in a secure way.

{{ order.discounted? }} Boolean
A boolean representing whether or not the order had a discount applied.

{{ order.discount_total }} Decimal
The total discounted amount of the order.

{{ order.discount_description }} String
The discount description of the order.

{{ order.order_number }} String
The order number of the order.

{{ order.amazon_order_id }} String
The amazon order id of the order.

{{ order.customer }} Object
The customer who placed the order.

{{ order.location }} Object
The location that the order was assigned to.

{{ order.email }} String
The email address associated with the order.

{{ order.status }} String
The current state of the order.

{{ order.subtotal }} Decimal
The subtotal of the order.

{{ order.tax }} Decimal
The total tax charged on the order.

{{ order.shipping }} Decimal
The total shipping charged on the order.

{{ order.total }} Decimal
The total charged on the order.

{{ order.shipping_address }} Object
The shipping address of the order.

{{ order.billing_address }} Object
The billing address of the order.

{{ order.placed_at }} Date
The date the order was placed.

{{ order.shipping_method }} String
The shipping method chosen for the order.

{{ order.payment_method }} String
The payment method chosen for the order.

{{ order.payment_details }} String
The payment details of the order. This value depends on the payment method.

{{ order.po_number }} String
The purchase order number of the order, if it exists.

{{ order.comments }} String
The order's comments, usually provided by the customer or guest placing the order.

{{ order.carrier }} String
The shipping carrier fulfilling the order.

{{ order.gsa? }} Boolean
A boolean representing whether or not the order contained items with GSA pricing.

{{ order.gsa_contracts }} String
The GSA Contracts associated with the order, if they exist.

{{ order.ship_blind? }} Boolean
A boolean representing whether or not the order should be shipped blind, i.e. with a non-identifying return address.

{{ order.pickup? }} Boolean
A boolean representing whether or not the order is meant to be picked up by the customer.

{{ order.first_time_order? }} Boolean
A boolean representing whether or not the order is the first order ever placed by the customer.

{{ order.preorder_products? }} Boolean
A boolean representing whether or not the order contains any preorder products.

{{ order.item_count }} Integer
The total number of items on the order.

{{ order.items }} Collection
A collection of the items on the order.

{{ order.shipments }} Collection
A collection of all shipments associated with the order. In most cases, there will be a single shipment.

{{ order.packages }} Collection
A collection of all packages from all shipments associated with the order.

{{ order.promo_codes }} Collection
A collection of all promo codes associated with the order.

{{ order.completely_shipped? }} Boolean
A boolean representing whether or not all shipments associated with the order have been shipped to the customer.

Did this answer your question?