How can I access customer tags from the cart page?

Hi! We’re we’re offering a free-trial offer and would like to disable the checkout button for anyone who has already purchased a trial.

To do this, we’re requiring accounts to checkout, and then attempting to grab existing customer tags on the cart page.

Currently, we’re able to grab the customer ID, assuming they are already signed in, just having trouble grabbing and checking if they have existing tags.

Please let me know if this is possible! We’re NOT on shopify plus yet.

Thank you!

Hello @epet ,

Yes posible.

Use

{% if customer.tags contains "tag" %}

{% endif %}

Thanks

I should place that somewhere on the cart.liquid file and then could execute javascript code in that same liquid file to display a popup or something if the tag exists?

Yes or you can use it in theme.liquid just before tag or liquid in theme.liquid or cart.liquid and JS in js files. Depends on the need and how you want to code.

Are we also able to check the products in a cart after purchase so we can tag the user directly from the thank you page?