Category Names

Adding Category Names as Tags in Shopify

Comstack Support

Last Update 8 months ago

This guide explains how to create or add category names to product tags or metafields on your Shopify store using Supply Master's 'match fields' feature.

Steps to Configure Match Fields in Supply Master

  1. Navigate to Edit Supplier > Match Fields in Supply Master.
  2. Choose 'Category Names' as your data source, and assign this to a Meta Field or Tags. 

Note that matching a field to Tags will overwrite any existing tags in your store during every import.

Modifying Imported Data

Category names are imported as a comma separated list of values in string format and can be modified prior to import.

In the below example, we will be adding the prefix sub_cat_ to each of the category names. To do this, use the below Liquid Code snippet after clicking the Modify button under Edit Supplier > Match Fields

Explanation of the Liquid Code

{% assign categories_names = categoryNames | split: ',' %}: 

This line splits the categoryNames string into an array, categories_names, using a comma (,) as the delimiter.

{% for category in categories_names %}: 

This initiates a loop over each element in the categories_names array.


Inside the loop, a prefix is added to each category name. The modified name is then followed by a comma.

Once this setting is saved, and an import is run, the mapped tags will be updated with the category names including the prefix.

Was this article helpful?

0 out of 0 liked this article

Still need help? Message Us