How can I access product tags in the mini cart?

I’m adding some custom functionality that’s tag based and I need to be able to loop through tags on the product page, cart, and mini cart (up in the header). The main cart and product pages are fine, but I don’t seem to be able to access the product’s tags in the header.liquid file where the mini cart is rendered. I tried using item.tags within the cart.items loop, but no luck. I’m able to access properties, so I guess I could go that route with a hidden input, but would really prefer to use the tags instead.

Is it possible to access tags in the mini cart? It’s the Turbo / Portland theme, but not sure if that matters in this case.

Hi @stinkysGTI ,

I checked and your Shopify doesn’t support ‘item.tags’ so you can’t use it to display. Refer https://shopify.dev/api/liquid/objects/line_item

How did you show it on the cart page?

I recommend using ‘item.product.tags’

Hope it helps!

1 Like

That did the trick, thank you! Didn’t realize I needed the “product” part of the object and assumed it was already part of the “item” variable.

1 Like