Skip to main content

Attributes (Liquid Objects)

Liquid objects (also simply known as attributes) are variables, written in the Shopify Liquid template language, that provide dynamic output.

Together with Liquid filters, Liquid objects are used to modify and format the dynamic data for the product feed.

To call a Liquid object inside your feed's template editor, place the object the between double curly brackets: {{ object.attribute }}.

Example

Here's how you would call the title attributes of a product:

INPUT
{{ product.title }}
OUTPUT
Superheroes Attack Playset

Context

The context object contains all information on products, product variants, and product collections in your store's catalog.

You obtain attributes of a specific item within the context.products, context.product_variants, and context.collections iteration cycles.

context.products

Returns an array of all parent products from the store's catalog.

Example of iteration over context.products
INPUT
{% for product in context.products %}
<item>
<title>{{ product.title }}</title>
</item>
{% endfor %}
OUTPUT
<item>
<title>Superheroes Attack Playset</title>
</item>

context.product_variants

Returns an array of all product variants from the store's catalog.

Example of iteration over context.product_variants
INPUT
{% for variant in context.product_variants %}
<item>
<title>{{ variant.title }}</title>
<price>{{ variant.price }}</price>
</item>
{% endfor %}
OUTPUT
<item>
<title>Superheroes Attack Playset</title>
<price>100.00</price>
</item>

context.collections

Returns an array of all collections from the store's product catalog.

Example of iteration over context.collections
INPUT
{% for collection in context.collections %}
<item>
<collection><![CDATA[{{ collection.title }}]]></collection>
</item>
{% endfor %}
OUTPUT
<item>
<collection><![CDATA[ Playsets ]]></collection>
<collection><![CDATA[ Toys ]]></collection>
<collection><![CDATA[ Summer Sale ]]></collection>
</item>

Product

The product object contains all information on a specific product.

Product attributes have to be called inside the context.products iterative cycle.

product.id

Returns the product's identifier.

Example of using product.id
INPUT
{{ product.id }}
OUTPUT
41507219767494

product.title

Returns the product's title (name).

Example of using product.title
INPUT
{{ product.title }}
OUTPUT
Superheroes Attack Playset

product.sku

Returns the product's stock keeping unit.

Example of using product.sku
INPUT
{{ product.sku }}
OUTPUT
TOY01

product.url

Returns the product page URL.

Example of using product.url
INPUT
{{ product.url }}
OUTPUT
https://store.myshopify.com/products/super-heroes-attack-set?om=8179

product.image_url

Returns the URL of the product's main image.

Example of using product.image_url
INPUT
{{ product.image_url }}
OUTPUT
https://cdn.shopify.com/s/files/1/0549/3103/0214/products/a1bc38d22e49bd96073851fa589dffdb.jpg?v=1644932714

product.extra_image_urls

Returns an array of URLs of all additional product images.

Example of using product.extra_image_urls
INPUT
{% for url in product.extra_image_urls %}
<img_url>{{ url }}</img_url>
{% endfor %}
OUTPUT
<img_url>https://cdn.shopify.com/s/files/1/0549/3103/0214/products/84a7e34f1ec16870f3dec205e78a21ad.jpg?v=1650892525</img_url>

product.image_urls

Returns an array of URLs of all product images (main + extra).

Example of using product.image_urls
INPUT
{% for url in product.image_urls %}
<img_url>{{ url }}</img_url>
{% endfor %}
OUTPUT
<img_url>https://cdn.shopify.com/s/files/1/0549/3103/0214/products/a1bc38d22e49bd96073851fa589dffdb.jpg?v=1644932714</img_url>
<img_url>https://cdn.shopify.com/s/files/1/0549/3103/0214/products/84a7e34f1ec16870f3dec205e78a21ad.jpg?v=1650892525</img_url>

product.video_urls

Returns an array of URLs of all product videos.

Example of using product.video_urls
INPUT
{% for url in product.video_urls %}
<vid_url>{{ url }}</vid_url>
{% endfor %}
OUTPUT
<vid_url>https://cdn.shopify.com/videos/c/vp/b6ccec2f6f8a4f09902abf7a79f2dbf1/b6ccec2f6f8a4f09902abf7a79f2dbf1.SD-480p-0.9Mbps-33565983.mp4</vid_url>

product.price

Returns the product's price.

Example of using product.price
INPUT
{{ product.price }}
OUTPUT
100

product.compare_at_price

Returns the lowest price among the compare at price fields of all the product's variants.

Example of using product.compare_at_price
INPUT
{{ product.compare_at_price }}
OUTPUT
<!-- Assume that a product has 2 variants with compare at prices 175 and 150 -->
150

product.body_html

Returns the product's description. HTML formatting is supported.

Example of using product.body_html
INPUT
{{ product.body_html }}
OUTPUT
Help superheroes defeat evil and save the world with our Superheroes Attack Playset.

product.vendor

Returns the product's vendor name.

Example of using product.vendor
INPUT
{{ product.vendor }}
OUTPUT
Funtoy

product.product_type

Returns the product's type.

Example of using product.product_type
INPUT
{{ product.product_type }}
OUTPUT
PLAYSET

product.category_ids

Returns an array with identifiers of Shopify categories which the product is assigned to.

Example of using product.category_ids
INPUT
{% for category_id in product.category_ids %}
<category_id>{{ category_id }}</category_id>
{% endfor %}
OUTPUT
<category_id>tg-5-8-12-1</category_id>

product.category_taxonomy

Returns the full path of a product's Shopify category.

Example of using product.category_taxonomy
INPUT
{{ product.category_taxonomy }}
OUTPUT
Toys & Games > Toys > Dolls, Playsets & Toy Figures > Toy Playsets > Action Figure Playsets

product.category_taxonomy_name

Returns the last level name of a product's Shopify category.

Example of using product.category_taxonomy_name
INPUT
{{ product.category_taxonomy_name }}
OUTPUT
Action Figure Playsets

product.category_taxonomy_id

Returns the identifier of a product's Shopify category.

Example of using product.category_taxonomy_id
INPUT
{{ product.category_taxonomy_id }}
OUTPUT
tg-5-8-12-1

product.collection_id

Returns the first collection identifier from the array of all collections the product is assigned to.

Example of using product.collection_id
INPUT
{{ product.collection_id }}
OUTPUT
284736127174

product.collection_title

Returns the first collection name from the array of all collections the product is assigned to.

Example of using product.collection_title
INPUT
{{ product.collection_title }}
OUTPUT
Playsets

product.collection_titles

Returns an array of all collection names which the product is assigned to.

Example of using product.collection_titles
INPUT
{% for collection_title in product.collection_titles %}
<collection_title>{{ collection_title }}</collection_title>
{% endfor %}
OUTPUT
<collection_title>Playsets</collection_title>
<collection_title>Toys</collection_title>
<collection_title>Summer Sale</collection_title>

You can turn this array into a string with the join modifier in such way:

INPUT
{{ product.collection_titles | join: ', ' }}
OUTPUT
Playsets, Toys, Summer Sale

product.mapping_collection_id

Returns the identifier of the first collection which the product is mapped to.

For more information about category mapping, please visit the Category Mapping page.

Example of using product.mapping_collection_id
INPUT
{{ product.mapping_collection_id }}
OUTPUT
3166

product.mapping_collection_title

Returns the name of the first collection which the product is mapped to.

For more information about category mapping, please visit the Category Mapping page.

Example of using product.mapping_collection_title
INPUT
{{ product.mapping_collection_title }}
OUTPUT
Toys & Games > Toys > Dolls, Playsets & Toy Figures > Toy Playsets

product.mapping_collection_titles

Returns an array of collection names which the product is mapped to.

For more information about category mapping, please visit the Category Mapping page.

Example of using product.mapping_collection_titles
INPUT
{% for collection in product.mapping_collection_titles %}
<collection_title>{{ collection }}</collection_title>
{% endfor %}
OUTPUT
<collection_title>Toys & Games > Toys > Dolls, Playsets & Toy Figures > Toy Playsets</collection_title>
<collection_title>Toys & Games > Toys > Dolls, Playsets & Toy Figures</collection_title>
<collection_title>Toys & Games</collection_title>

product.tags

Returns an array of product tags.

Example of using product.tags
INPUT
{% for item in product.tags %}
<tag>{{ item }}</tag>
{% endfor %}
OUTPUT
<tag>playsets</tag>
<tag>toys</tag>

You can turn this array into a string with the join modifier in such way:

INPUT
{{ product.tags | join: ', ' }}
OUTPUT
playsets, toys

product.published_scope

Returns an array of names of the sales channels in which the product is displayed.

Example of using product.published_scope
INPUT
{{ product.published_scope }}
OUTPUT
global

product.metafields

Returns an object with the product's metafields.

To use metafields, you first must create a metafield in the Shopify admin, fill the metafield's data for each product, and activate metafields in Mulwi.

Example of using product.metafields

Assume that products in the store have a metafield with the name my_fields. Here's how you would get the value of this metafield:

INPUT
{{ product.metafields }}
OUTPUT
map[my_fields:map[length:{"value":1400.0,"unit":"mm"} width:{"value":340.0,"unit":"mm"}]]

To access a specific metafield element, add to the product.metafields variable the metafield name after the dot. For example, here's how you would get the length value:

INPUT
{{ product.metafields.my_fields.length }}
OUTPUT
{"value":1400.0,"unit":"mm"}

product.variants

Returns an array of product's variants.

Example of using product.variants
INPUT
{{ product.variants }}
OUTPUT
[map[barcode: body_html:Mobile Command Center Playset collection_id:0 collection_title: collection_titles:[] color: compare_at_price:0 cost:0 created_at:2022-02-15 08:45:20 -0500 -0500 id:41598888313030 image_url:https://cdn.shopify.com/s/files/1/0549/3103/0214/products/fd22f7965849f923e9f32e5cd1ad9577.jpg?v=1644932720 in_stock:true inventory_item_id:0 inventory_item_tracked:true inventory_management:shopify mapping_collection_id: mapping_collection_title: mapping_collection_titles:[] metafields:map[] option1:Default Title option2: option3: parent_id:7200553631942 parent_image_url:https://cdn.shopify.com/s/files/1/0549/3103/0214/products/fd22f7965849f923e9f32e5cd1ad9577.jpg?v=1644932720 parent_image_urls:[] parent_metafields:map[] parent_published_scope:global parent_sku: parent_url: price:75 product_type:TOYS qty:6 size: sku:TOY04 tags:[playsets toys] title:Mobile Command Center Playset updated_at:2022-02-15 08:59:10 -0500 -0500 url:https://store.myshopify.com/products/mobile-command-center?variant=41598888313030&om=8179 vendor:Funtoy weight_grams:0]]

product.variant_id

Returns the identifier of the product's first variant.

Example of using product.variant_id
INPUT
{{ product.variant_id }}
OUTPUT
41507219767494

product.variant_title

Returns the name of the product's first variant.

Example of using product.variant_title
INPUT
{{ product.variant_title }}
OUTPUT
VARIANT-TOY3

product.variant_sku

Returns the stock keeping unit of the product's first variant.

Example of using product.variant_sku
INPUT
{{ product.variant_sku }}
OUTPUT
TOY03

product.variant_qty

Returns the stock quantity of the product's first variant.

Example of using product.variant_qty
INPUT
{{ product.variant_qty }}
OUTPUT
94

product.variant_url

Returns the page URL of the product's first variant.

Example of using product.variant_url
INPUT
{{ product.variant_url }}
OUTPUT
https://store.myshopify.com/products/super-heroes-attack-set?variant=41598888149190&om=8179

product.variant_image_url

Returns the image URL of the product's first variant.

Example of using product.variant_image_url
INPUT
{{ product.variant_image_url }}
OUTPUT
https://cdn.shopify.com/s/files/1/0549/3103/0214/products/84a7e34f1ec16870f3dec205e78a21ad.jpg?v=1650892525

product.variant_price

Returns the price of the product's first variant.

Example of using product.variant_price
INPUT
{{ product.variant_price }}
OUTPUT
100

product.variant_compare_at_price

Returns the original price before an adjustment or a sale of the product's first variant.

Example of using product.variant_compare_at_price
INPUT
{{ product.variant_compare_at_price }}
OUTPUT
175

product.variant_cost

Returns the cost of the product's first variant.

Example of using product.variant_cost
INPUT
{{ product.variant_cost }}
OUTPUT
50

product.variant_unit_price

Returns the unit price of the product's first variant.

This attribute is available only to merchants selling in the European Union (EU) and in Switzerland.

Example of using product.variant_unit_price
INPUT
{{ product.variant_unit_price }}
OUTPUT
10

product.variant_measured_type

Returns the type of unit measurement of the product's first variant.

This attribute is available only to merchants selling in the European Union (EU) and in Switzerland.

Example of using product.variant_measured_type
INPUT
{{ product.variant_measured_type }}
OUTPUT
WEIGHT

product.variant_base_measure

Returns the base measure value of the product's first variant.

This attribute is available only to merchants selling in the European Union (EU) and in Switzerland.

Example of using product.variant_base_measure
INPUT
{{ product.variant_base_measure }}
OUTPUT
1

product.variant_base_measure_unit

Returns the base measure unit of the product's first variant.

This attribute is available only to merchants selling in the European Union (EU) and in Switzerland.

Example of using product.variant_base_measure_unit
INPUT
{{ product.variant_base_measure_unit }}
OUTPUT
KG

product.variant_total_measure

Returns the total measure value of the product's first variant.

This attribute is available only to merchants selling in the European Union (EU) and in Switzerland.

Example of using product.variant_total_measure
INPUT
{{ product.variant_total_measure }}
OUTPUT
3

product.variant_total_measure_unit

Returns the total measure unit of the product's first variant.

This attribute is available only to merchants selling in the European Union (EU) and in Switzerland.

Example of using product.variant_total_measure_unit
INPUT
{{ product.variant_total_measure_unit }}
OUTPUT
KG

product.variant_weight_grams

Returns the weight (in grams) of the product's first variant.

Example of using product.variant_weight_grams
INPUT
{{ product.variant_weight_grams }}
OUTPUT
400

product.variant_barcode

Returns the barcode of the product's first variant.

Example of using product.variant_barcode
INPUT
{{ product.variant_barcode }}
OUTPUT
ABC-1234

product.variant_country_code_of_origin

Returns the ISO 3166-1 alpha-2 code of the origin country of the product's first variant.

Example of using product.variant_country_code_of_origin
INPUT
{{ product.variant_country_code_of_origin }}
OUTPUT
CN

product.variant_harmonized_system_code

Returns the Harmonized System Code of the product's first variant.

Example of using product.variant_harmonized_system_code
INPUT
{{ product.variant_harmonized_system_code }}
OUTPUT
9503

product.variant_inventory_management

Returns the name of the inventory management system of the product's first variant.

Example of using product.variant_inventory_management
INPUT
{{ product.variant_inventory_management }}
OUTPUT
shopify

product.variant_inventory_item_id

Returns the inventory identifier of the product's first variant.

Example of using product.variant_inventory_item_id
INPUT
{{ product.variant_inventory_item_id }}
OUTPUT
43605311717574

product.variant_inventory_item_tracked

Returns a boolean value of true if the inventory of the product's first variant is tracked, otherwise returns false.

Example of using product.variant_inventory_item_tracked
INPUT
{{ product.variant_inventory_item_tracked }}
OUTPUT
true

product.variant_inventory_policy

Returns deny if the product's first variant cannot be purchased once it is out-of-stock, or continue otherwise.

Example of using product.variant_inventory_policy
INPUT
{{ product.variant_inventory_policy }}
OUTPUT
deny

product.variant_option1

Returns the first of the product's variant option values.

Example of using product.variant_option1
INPUT
{{ product.variant_option1 }}
OUTPUT
Black

product.variant_option2

Returns the second of the product's variant option values.

Example of using product.variant_option2
INPUT
{{ product.variant_option2 }}
OUTPUT
GIFT

product.variant_option3

Returns the third of the product's variant option values.

Example of using product.variant_option3
INPUT
{{ product.variant_option2 }}
OUTPUT
ENGRAVING

product.variant_metafields

Returns an object with the product's variant metafields.

To use metafields, you first must create a metafield in the Shopify admin, fill the metafield's data for each product, and activate metafields in Mulwi.

Example of using product.variant_metafields

Assume that product's variants in the store have a metafield with the name my_fields. Here's how you would get the value of this metafield:

INPUT
{{ product.variant_metafields }}
OUTPUT
map[my_fields:map[length:{"value":1400.0,"unit":"mm"} width:{"value":340.0,"unit":"mm"}]]

To access a specific metafield element, add to the product.variant_metafields variable the metafield name after the dot. For example, here's how you would get the length value:

INPUT
{{ product.variant_metafields.my_fields.length }}
OUTPUT
{"value":1400.0,"unit":"mm"}

product.variant_created_at

Returns the date and time of creation of the product's first variant.

Example of using product.variant_created_at
INPUT
{{ product.variant_created_at }}
OUTPUT
2022-01-28 14:27:56 +0200 EET

product.variant_updated_at

Returns date and time of the last update of the product's first variant.

Example of using product.variant_updated_at
INPUT
{{ product.variant_updated_at }}
OUTPUT
2022-01-29 13:12:26 +0200 EET

Variant

The variant object contains all information on a specific product's variant.

Product variant attributes have to be called inside the context.product_variants iterative cycle.

variant.id

Returns the product variant's identifier.

Example of using variant.id
INPUT
{{ variant.id }}
OUTPUT
41507219767494

variant.title

Returns the product variant's title (name).

Example of using variant.title
INPUT
{{ variant.title }}
OUTPUT
VARIANT-TOY3

variant.sku

Returns the product variant's stock keeping unit.

Example of using variant.sku
INPUT
{{ variant.sku }}
OUTPUT
TOY03

variant.qty

Returns the product variant's stock quantity.

Example of using variant.qty
INPUT
{{ variant.qty }}
OUTPUT
94

variant.url

Returns the product variant's URL.

Example of using variant.url
INPUT
{{ variant.url }}
OUTPUT
https://store.myshopify.com/products/super-heroes-attack-set?variant=41598888149190&om=8179

variant.image_url

Returns the product variant's image URL.

Example of using variant.image_url
INPUT
{{ variant.image_url }}
OUTPUT
https://cdn.shopify.com/s/files/1/0549/3103/0214/products/84a7e34f1ec16870f3dec205e78a21ad.jpg?v=1650892525

variant.price

Returns the product variant's price.

Example of using variant.price
INPUT
{{ variant.price }}
OUTPUT
100

variant.compare_at_price

Returns the product variant's original price before an adjustment or a sale.

Example of using variant.compare_at_price
INPUT
{{ variant.compare_at_price }}
OUTPUT
175

variant.cost

Returns the product variant's cost.

Example of using variant.cost
INPUT
{{ variant.cost }}
OUTPUT
50

variant.in_stock

Returns a boolean value of true if the product variant is in stock, otherwise returns false.

Example of using variant.in_stock
INPUT
{{ variant.in_stock }}
OUTPUT
true 

variant.body_html

Returns the product variant's description. HTML formatting is supported.

Example of using variant.body_html
INPUT
{{ variant.body_html }}
OUTPUT
Team up with the superheroes team to defeat evil and save the world in the Superheroes Attack Playset.

variant.vendor

Returns the product variant's vendor name.

Example of using variant.vendor
INPUT
{{ variant.vendor }}
OUTPUT
Funtoy

variant.product_type

Returns the product variant's type.

Example of using variant.product_type
INPUT
{{ variant.product_type }}
OUTPUT
TOYS

variant.category_taxonomy

Returns the full path of a product variant's Shopify category.

Example of using variant.category_taxonomy
INPUT
{{ variant.category_taxonomy }}
OUTPUT
Toys & Games > Toys > Dolls, Playsets & Toy Figures > Toy Playsets > Action Figure Playsets

variant.category_taxonomy_name

Returns the last level name of a product variant's Shopify category.

Example of using variant.category_taxonomy_name
INPUT
{{ variant.category_taxonomy_name }}
OUTPUT
Action Figure Playsets

variant.category_taxonomy_id

Returns the identifier of a product variant's Shopify category.

Example of using variant.category_taxonomy_id
INPUT
{{ variant.category_taxonomy_id }}
OUTPUT
tg-5-8-12-1

variant.collection_id

Returns the first collection identifier from the array of all collections the product variant is assigned to.

Example of using variant.collection_id
INPUT
{{ variant.collection_id }}
OUTPUT
284736127174

variant.collection_title

Returns the first collection name from the array of all collections the product variant is assigned to.

Example of using variant.collection_title
INPUT
{{ variant.collection_title }}
OUTPUT
Playsets

variant.collection_titles

Returns an array of all collection names which the product variant is assigned to.

Example of using variant.collection_titles
INPUT
{% for collection_title in {{ variant.collection_titles }} %}
<collection_title>{{ collection_title }}</collection_title>
{% endfor %}
OUTPUT
<collection_title>Playsets</collection_title>
<collection_title>Toys</collection_title>
<collection_title>Summer Sale</collection_title>

You can turn this array into a string with the join modifier in such way:

INPUT
{{ variant.collection_titles | join: ', ' }}
OUTPUT
Playsets, Toys, Summer Sale

variant.mapping_collection_id

Returns the identifier of the first collection which the product variant is mapped to.

For more information about category mapping, please visit the Category Mapping page.

Example of using variant.mapping_collection_id
INPUT
{{ variant.mapping_collection_id }}
OUTPUT
3166

variant.mapping_collection_title

Returns the name of the first collection which the product variant is mapped to.

For more information about category mapping, please visit the Category Mapping page.

Example of using variant.mapping_collection_title
INPUT
{{ variant.mapping_collection_title }}
OUTPUT
Toys & Games > Toys > Dolls, Playsets & Toy Figures > Toy Playsets

variant.mapping_collection_titles

Returns an array of collection names which the product variant is mapped to.

For more information about category mapping, please visit the Category Mapping page.

Example of using variant.mapping_collection_titles
INPUT
{% for collection in variant.mapping_collection_titles %}
<collection_title>{{ collection }}</collection_title>
{% endfor %}
OUTPUT
<collection_title>Toys & Games > Toys > Dolls, Playsets & Toy Figures > Toy Playsets</collection_title>
<collection_title>Toys & Games > Toys > Dolls, Playsets & Toy Figures</collection_title>
<collection_title>Toys & Games</collection_title>

variant.tags

Returns an array of product variant's tags.

Example of using variant.tags
INPUT
{% for item in variant.tags %}
<tag>{{ item }}</tag>
{% endfor %}
OUTPUT
<tag>playsets</tag>
<tag>toys</tag>

You can turn this array into a string with the join modifier in such way:

INPUT
{{ product.tags | join: ', ' }}
OUTPUT
playsets, toys

variant.unit_price

Returns the product variant's unit price.

This attribute is available only to merchants selling in the European Union (EU) and in Switzerland.

Example of using variant.unit_price
INPUT
{{ variant.unit_price }}
OUTPUT
10

variant.measured_type

Returns the product variant's type of unit measurement.

This attribute is available only to merchants selling in the European Union (EU) and in Switzerland.

Example of using variant.measured_type
INPUT
{{ variant.measured_type }}
OUTPUT
WEIGHT

variant.base_measure

Returns the product variant's base measure value.

This attribute is available only to merchants selling in the European Union (EU) and in Switzerland.

Example of using variant.base_measure
INPUT
{{ variant.base_measure }}
OUTPUT
1

variant.base_measure_unit

Returns the product variant's base measure unit.

This attribute is available only to merchants selling in the European Union (EU) and in Switzerland.

Example of using variant.base_measure_unit
INPUT
{{ variant.base_measure_unit }}
OUTPUT
KG

variant.total_measure

Returns the product variant's total measure value.

This attribute is available only to merchants selling in the European Union (EU) and in Switzerland.

Example of using variant.total_measure
INPUT
{{ variant.total_measure }}
OUTPUT
3

variant.total_measure_unit

Returns the product variant's total measure unit.

This attribute is available only to merchants selling in the European Union (EU) and in Switzerland.

Example of using variant.total_measure_unit
INPUT
{{ variant.total_measure_unit }}
OUTPUT
KG

variant.weight_grams

Returns the product variant's weight in grams.

Example of using variant.weight_grams
INPUT
{{ variant.weight_grams }}
OUTPUT
400

variant.barcode

Returns the product variant's barcode.

Example of using variant.barcode
INPUT
{{ variant.barcode }}
OUTPUT
ABC-1234

variant.country_code_of_origin

Returns the ISO 3166-1 alpha-2 code of the origin country of the product variant.

Example of using variant.country_code_of_origin
INPUT
{{ variant.country_code_of_origin }}
OUTPUT
CN

variant.harmonized_system_code

Returns the product variant's Harmonized System Code.

Example of using variant.harmonized_system_code
INPUT
{{ variant.harmonized_system_code }}
OUTPUT
9503

variant.inventory_management

Returns the name of the product variant's inventory management system.

Example of using variant.inventory_management
INPUT
{{ variant.inventory_management }}
OUTPUT
shopify

variant.inventory_item_id

Returns the product variant's inventory identifier.

Example of using variant.inventory_item_id
INPUT
{{ variant.inventory_item_id }}
OUTPUT
43605311717574

variant.inventory_item_tracked

Returns a boolean value of true if the product variant's inventory is tracked, otherwise returns false.

Example of using variant.inventory_item_tracked
INPUT
{{ variant.inventory_item_tracked }}
OUTPUT
true

variant.inventory_policy

Returns deny if the product variant cannot be purchased once it is out-of-stock, or continue otherwise.

Example of using variant.inventory_policy
INPUT
{{ variant.inventory_policy }}
OUTPUT
deny

variant.inventory_locations

Returns an array of names of the product variant's stock locations and quantities at each location.

Example of using variant.inventory_locations
INPUT
{{ variant.inventory_locations }}
OUTPUT
map[Germany Warehouse:50 My Custom Location:20 Shop location:30]

To access the product variant's quantity at a specific location, add the name of the location, encased in quotes and square brackets, after variant.inventory_locations. For example, here's how you would get the quantity of the product's variant in a location named Germany Warehouse:

INPUT
{{ variant.inventory_locations["Germany Warehouse"] }}
OUTPUT
50

You can also check if the product's variant is available at a specific location in such way:

INPUT
{% if variant.inventory_locations["Germany Warehouse"] and variant.inventory_locations["Germany Warehouse"] > 0 %}
<quantity>{{ variant.inventory_locations["Germany Warehouse"] }}</quantity>
{% endif %}
OUTPUT
<quantity>50</quantity>

In case you are using the product context, you can access the variant's locations in the product.variants iterative cycle.

variant.size

Returns the product variant's size.

Example of using variant.size
INPUT
{{ variant.size }}
OUTPUT
43

variant.color

Returns the product variant's color.

Example of using variant.color
INPUT
{{ variant.color }}
OUTPUT
Black

variant.option1

Returns the first of the product variant's option values.

Example of using variant.option1
INPUT
{{ variant.option1 }}
OUTPUT
Black

variant.option2

Returns the second of the product variant's option values.

Example of using variant.option2
INPUT
{{ variant.option2 }}
OUTPUT
GIFT

variant.option3

Returns the third of the product variant's option values.

Example of using variant.option3
INPUT
{{ variant.option3 }}
OUTPUT
ENGRAVING

variant.metafields

Returns an object with the product variant's metafields.

To use metafields, you first must create a metafield in the Shopify admin, fill the metafield's data for each product, and activate metafields in Mulwi.

Example of using variant.metafields

Assume that product's variants in the store have a metafield with the name my_fields. Here's how you would get the value of this metafield:

INPUT
{{ variant.metafields }}
OUTPUT
map[my_fields:map[length:{"value":1400.0,"unit":"mm"} width:{"value":340.0,"unit":"mm"}]]

To access a specific metafield element, add to the variant.metafields variable the metafield name after the dot. For example, here's how you would get the length value:

INPUT
{{ variant.metafields.my_fields.length }}
OUTPUT
{"value":1400.0,"unit":"mm"}

variant.created_at

Returns the product variant's date and time of creation.

Example of using variant.created_at
INPUT
{{ variant.created_at }}
OUTPUT
2022-01-28 14:27:56 +0200 EET

variant.updated_at

Returns the product variant's date and time of the last update.

Example of using variant.updated_at
INPUT
{{ variant.updated_at }}
OUTPUT
2022-01-29 13:12:26 +0200 EET

variant.parent_id

Returns the identifier of the product variant's parent item.

Example of using variant.parent_id
INPUT
{{ variant.parent_id }}
OUTPUT
41507219767494

variant.parent_sku

Returns the stock keeping unit of the product variant's parent item.

Example of using variant.parent_sku
INPUT
{{ variant.parent_sku }}
OUTPUT
TOY01

variant.parent_url

Returns the page URL of the product variant's parent item.

Example of using variant.parent_url
INPUT
{{ variant.parent_url }}
OUTPUT
https://store.myshopify.com/products/super-heroes-attack-set?om=8179

variant.parent_image_url

Returns the main image URL of the product variant's parent item.

Example of using variant.parent_image_url
INPUT
{{ variant.parent_image_url }}
OUTPUT
https://cdn.shopify.com/s/files/1/0549/3103/0214/products/a1bc38d22e49bd96073851fa589dffdb.jpg?v=1644932714

variant.parent_extra_image_urls

Returns an array of URLs of all additional images of the product variant's parent item.

Example of using variant.parent_extra_image_urls
INPUT
{% for url in variant.parent_extra_image_urls %}
<img_url>{{ url }}</img_url>
{% endfor %}
OUTPUT
<img_url>https://cdn.shopify.com/s/files/1/0549/3103/0214/products/84a7e34f1ec16870f3dec205e78a21ad.jpg?v=1650892525</img_url>

variant.parent_image_urls

Returns an array of URLs of all images (main + extra) of the product variant's parent item.

Example of using variant.parent_image_urls
INPUT
{% for url in variant.parent_image_urls %}
<img_url>{{ url }}</img_url>
{% endfor %}
OUTPUT
<img_url>https://cdn.shopify.com/s/files/1/0549/3103/0214/products/a1bc38d22e49bd96073851fa589dffdb.jpg?v=1644932714</img_url>
<img_url>https://cdn.shopify.com/s/files/1/0549/3103/0214/products/84a7e34f1ec16870f3dec205e78a21ad.jpg?v=1650892525</img_url>

variant.parent_published_scope

Returns an array of names of the sales channels in which the product variant's parent item is displayed.

Example of using variant.parent_published_scope
INPUT
{{ variant.parent_published_scope }}
OUTPUT
global

variant.parent_metafields

Returns an object with the metafields of the product variant's parent item.

To use metafields, you first must create a metafield in the Shopify admin, fill the metafield's data for each product, and activate metafields in Mulwi.

Example of using variant.parent_metafields

Assume that products in the store have a metafield with the name my_fields. Here's how you would get the value of this metafield:

INPUT
{{ variant.parent_metafields }}
OUTPUT
map[my_fields:map[length:{"value":1400.0,"unit":"mm"} width:{"value":340.0,"unit":"mm"}]]

To access a specific metafield element, add to the variant.parent_metafields variable the metafield name after the dot. For example, here's how you would get the length value:

INPUT
{{ variant.parent_metafields.my_fields.length }}
OUTPUT
{"value":1400.0,"unit":"mm"}

Collection

The collection object contains all information on a store's specific collection.

Collection attributes have to be called inside the context.collections iterative cycle.

collection.id

Returns the collection's identifier.

Example of using collection.id
INPUT
{{ collection.id }}
OUTPUT
284736127174

collection.title

Returns the collection's title (name).

Example of using collection.title
INPUT
{{ collection.title }}
OUTPUT
Playsets

collection.metafields

Returns an object with the collection's metafields.

To use metafields, you first must create a metafield in the Shopify admin, fill the metafield's data for each product, and activate metafields in Mulwi.

Example of using collection.metafields

Assume that collections in the store have a metafield with the name my_fields. Here's how you would get the value of this metafield:

INPUT
{{ collection.metafields }}
OUTPUT
map[my_fields:map[offer_details:{"value":"Buy 3 playsets and pay only for 2!"}]]

To access a specific metafield element, add to the collection.metafield variable the metafield name after the dot. For example, here's how you would get the offer_details value:

INPUT
{{ product.metafields.my_fields.offer_details }}
OUTPUT
{"value":"Buy 3 playsets and pay only for 2!"}