Shopify Theme 2.0 Objects Tutorial
Shopify Theme 2.0 introduced a more flexible and modular system for building themes, with several key objects available for use. The main objects include:
Global Objects
These objects are available across all templates:
-
shop : Store-wide settings and information.
-
request : Data about the current request.
-
cart : Details about the shopping cart.
-
customer : Information about the logged-in customer.
-
localization : Data about the user’s language and currency.
-
routes : Provides URLs for important pages.
-
link : Represents a menu link.
Template-Specific Objects
These objects are available depending on the template:
-
product : Represents a single product.
-
collection : Represents a collection of products.
-
page : Represents a custom page.
-
article : Represents a blog article.
-
blog : Represents a blog.
-
search : Represents search results.
-
order : Represents an order.
-
recommendations : Displays product recommendations.
Section-Specific Objects
With Theme 2.0, sections can be added to any page, and these objects help customize them:
-
section : Contains settings and blocks for the section.
-
block : Represents an individual block within a section.
Media and Content Objects
-
image : Represents images in the store.
-
video : Represents embedded videos.
-
article.image : Image for a blog article.
-
product.featured_image : The main product image.
Checkout & Order Objects (Limited in standard themes)
-
checkout : Contains details about the checkout process.
-
order : Represents an order placed by a customer.
Metafields & Custom Data
-
metafield : Custom fields for extending Shopify objects.
Shop Object
Listed shop object useful properties
Property Name | Description |
---|---|
shop.name | Store name |
shop.domain | Store domain. |
shop.description | Store description. |
shop.url | Store URL. |
shop.currency | Default store currency. |
shop.metafields | Custom store-wide metadata. |
Request Object
Listed request object useful properties
Property Name | Description |
---|---|
request.page_type | The type of page being viewed (e.g., "product", "collection", "cart"). |
request.locale | The locale of the request. |
Cart Object
Listed cart object useful properties
Property Name | Description |
---|---|
cart.item_count | Number of items in the cart. |
cart.total_price | Total price of the cart. |
cart.items | List of cart items. |
cart.currency | Currency of the cart. |
Customer Object
Listed shop object useful properties
Property Name | Description |
---|---|
customer.first_name | Customer’s first name. |
customer.last_name | Customer’s last name. |
customer.email | Customer’s email. |
customer.orders_count | Number of orders placed. |
customer.total_spent | Total amount spent by the customer. |
customer.addresses | List of saved addresses. |
Localization Object
Listed localization object useful properties
Property Name | Description |
---|---|
localization.country | Selected country. |
localization.language | Selected language. |
Routes Object
Listed routes object useful properties
Property Name | Description |
---|---|
routes.cart_url | URL of the cart page. |
routes.account_url | URL of the account page. |
Link Object
Listed shop object useful properties
Property Name | Description |
---|---|
link.title | Link title. |
link.url | Link URL. |
link.active | Whether the link is currently active. |