Customer variables represent a user's Shopify account information. These variables are refreshed when a customer signs in/out.
Property
Type
Example
Availability
customer.id
String
6669141901500
When user is logged in
customer.firstName
String
John
When user is logged in
customer.metafields
Object
{ "my-namespace": { "my-key": "my-value" } }
If Available
collection
Collection variables are distinct to the collection that's currently in view on the product listing page (PLP). These variables are refreshed when a user visits a new PLP.
Property
Type
Example
Availability
collection.id
String
123457
Always
collection.title
String
Vintage Shirts
Always
collection.handle
String
vintage-shirts
Always
collection.description
String
Limited availability vintage shirts
Always
collection.image
String
[ "<https://example.com/image.jpg>" ]
Always
collection.metafields
Array
{ "my-namespace": { "my-key": "my-value" } }
If Available
cart
Cart variables allow you to access the contents of a customer's current cart. These variables are refreshed in real-time.
20.45 (Sum of cart items less any applied discounts)
Always
cart.currency
String
USD
Always
cart.attributes
Array<[Objects]>
[ { "key": "value" }, { "key1": "value1" },]
If attributes are applied to the cart
cart.notes
String
“This is a cart note”
If notes are applied to cart. Can only have 1 and will be overwritten
cart.items Properties
Property
Type
Example
Availability
cart.items.quantity
Integer
1
If items are in the cart
cart.items.productId
String
7629735690428
If items are in the cart
cart.items.variantId
String
43577520193749
If items are in the cart
cart.items.sellingPlanId
String
1039518903
If selling plans are in cart
cart.items.attributes
Array
[ { "key": "value"} ]
If attributes are in the cart
device
Device variables are distinct to the user's device. If a user gets a new device, or deletes & reinstalls the app, they will receive a new device_id.
Property
Type
Example
Availability
device.id
String
D40B48A7-0889-4E76-8946-5EA5EBDD29FF
Always
device.locale
String
en_US
Always
device.windowHeight
Float
600
Always
product
Product variables are distinct to the product that's currently in view on the product detail page (PDP). These variables are refreshed when a user visits a new PDP.
Click here to learn more about Selling Plans, Shopify's construct of how to sell recurring product subscriptions. Scroll to the right of the table to view more columns.
Before using a product metafield variable your block, you'll first need to enable metafields for your Tapcart app, and include any specific metafields that your app should have access to.
When referencing a metafield variable in your block, make sure to specify the specific namespace & key you want to retrieve.