Shopify – Auto tagging customers with account registration form

Hello Friends,

Today, I’m going to give an example to show “how we can auto tag customers with additional information to classify account on different types like wholesale and retail” with auto tags.

To be used in the registration form. The form fields can be of type hidden or any other e.g. text, checkbox, radio

e.g.:

1. Auto-tagging customers in Shopify (example: wholesale and retail)

<input type="hidden" name="customer[tags][tag-1]" value="wholesale" />

or

<input type="hidden" name="customer[tags][tag-1]" value="retail" />

2. Auto-tagging customers in Shopify (example: approved and unapproved)

<input type="hidden" name="customer[tags][tag-2]" value="unapproved" />

All the details stored by using these forms can be retrieved in the admin panel under “Customers” menu option.

How to use these tags for implementing logic in customers account area?

Liquid tags are the programming logic that tells templates what to do. Tags are wrapped in: {% %}.

customer.tags

Returns the list of tags associated with the customer.

{% for tag in customer.tags %}
{{ tag }}
{% endfor %}

Output:

wholesale approved

We can use checks (conditional logic) to perform different actions based upon the tags.

Related Post

Advertisements

Yuvraj has written 39 articles

"Learn & Share" - I believe in this. What about you?