Liquid: How to add a product to a collection/tag using Liquid code?

Highlighted
Tourist
9 0 1

Hey Shopify community.

So I'm looking for a way I can use the data in the metafields of my products to automatically add all current and future products I make to different collections. I believe I got the Liquid logic know how to pull the desired metafield info from every product, but what I feel like I'm missing is the step of being able to add any product to a collection via Liquid logic.


Does anyone know what the Liquid/JS solution would look like for a command that adds a product to a collection?

 

Another potential solution to this would be to add a tag to each product using liquid logic code, since I can make the collection setting automatically add any product with a certain tag.

 

- Nick

0 Likes
Tourist
9 0 1

Don't think this is relevant but I'm using Supply.

Again just need a way to add to a collection or a product tag or to a collection using Liquid logic.

0 Likes