Skip to main content

CSV Template

CSV feed consists of two parts: CSV export options and CSV template filled with variables.

CSV Export Options

In the Export Options section, choose:

  • the context of data you want to place in the feed: products or product variants
  • data delimiter, for example, comma
  • enclosure type, for example, double quotes
  • set Extra header to include an additional header row in the first line of your feed file. It will always be above any other data.
note

You can access different contexts within the currently chosen one in the template with another context cycle or using dynamic expressions functionality.

CSV Template Example

Typical CSV template layout:

id :: {{ variant.id }}
item_group_id :: {{ variant.parent_id }}
title :: {{ variant.title }}
brand :: {{ variant.vendor }}
description :: {{ variant.body_html | strip_html }}
link :: {{ variant.url }}
image_link :: {{ variant.image_url }}
price :: {{ variant.price }}
sku :: {{ variant.sku }}
availability :: {% if variant.in_stock %}in stock{% else %}out of stock{% endif %}

Customizing CSV Template

Comma-separated values (CSV) provide data pieces separated by a comma or another character.

Template customization overview

CSV requires that each product has the same format and order for its data. This means that, for example, if a shopping engine uses a condition attribute, all products in the feed have to have it. Otherwise, a feed may be parsed incorrectly.

The feed modification is made with the help of Liquid variables and Liquid filters.

note

One line of the template corresponds to one column in the CSV file. Therefore, all cycles and conditions should be written in a single line.

How to list products in the feed

To fill the CSV feed with the list of products, you need to do such steps:

  • configure Export Options by setting a Content toggle to Export only Products;

  • choose Delimiter and Enclosure according to the shopping engine CSV feed specification;

  • fill the feed template with required product attributes. For example, product ID, product title, product URL.

product list
INPUT
id :: {{ product.id }}
title :: {{ product.title }}
product_url :: {{ product.url }}
OUTPUT
id,title,product_url
7259352105158,"Super Heroes",https://store.myshopify.com/products/super-heroes?om=8186

How to list product variants in the feed

To fill the CSV feed with the list of product variants, you need to do such steps:

  • configure Export Options by setting a Content toggle to Export only Product Variants;

  • choose Delimiter and Enclosure according to the shopping engine CSV feed specification;

  • fill the feed template with required variant attributes. For example, product variant ID, variant title, variant parent ID.

variant list
INPUT
id :: {{ variant.id }}
item_group_id :: {{ variant.parent_id }}
title :: {{ variant.title }}
OUTPUT
id,item_group_id,title
41805188956358,7259352105158,"Super Heroes"