How to redirect to a specific page if a customer with a specific tag logs in?

How to redirect to a specific page if a customer with a specific tag logs in?

NomadicRoots
Visitor
3 0 0

I'm following this guide

 

https://www.envision.io/blogs/ecommerce-pulse/80312001-how-to-add-a-wholesale-area-to-your-shopify-s...

 

And was able to successfully configure my store so that they can only see specific products tagged wholesale if the customer has a "wholesale" tag. However I'm running into a problem.

 

I would like to direct customers with a wholesale tag to a different home page when they log in. By default it directs them to their account page that just shows their past orders and addresses. Is there a way to redirect to a specific page if they have that tag?

Replies 7 (7)

NomadicRoots
Visitor
3 0 0

Here's what I've tried. Under customers/login.liquid, I included this statement.

 

{% form 'customer_login', novalidate: 'novalidate' %}
{% if customer.tags contains 'wholesale' %}
<input type="hidden" name="checkout_url" value="/collections/wholesale" />
{% else %}
<input type="hidden" name="checkout_url" value="/collections/all" />
{% endif %}

 

Even though the customer is tagged wholesale, the else statement is triggered instead. My guess is that the code doesn't see the customer.tag as having the value wholesale, but I'm not sure what to do about that. Any ideas?

Inspira_Digital
Shopify Partner
135 3 5

@NomadicRoots 

 

OK so essentially the redirect needs to be done once they are logged in else the liquid code doesn't have access to the customer object.

 

So the code needs to be deployed on the page they are automatically redirected to 

 

login > Account Overview > Redirect  

 

You will need to deploy a redirect using JS on the Account overview page once there logged in 

 

I hope this helps  if not we can deploy this for you reach out to us here 

 

Many Thanks

Mike

Twiiter: http://twitter.com/inspiradigital Website Development: https://www.inspiradigitial.co.uk B2B https://www.inspiradigital.co.uk/our-services/b2b-ecommerce-on-shopify
RoastedRiches
Visitor
1 0 0

Did you end up finding a workable result on this? I am trying to redirect a specific customer, the only one with their tag, to a specific page upon logging in.

Inspira_Digital
Shopify Partner
135 3 5

@RoastedRiches drop me a line or contact us through our website. If we cna get a little more detail we can work a solution out for you

Twiiter: http://twitter.com/inspiradigital Website Development: https://www.inspiradigitial.co.uk B2B https://www.inspiradigital.co.uk/our-services/b2b-ecommerce-on-shopify
CaStLeDzgns
Visitor
1 0 0

Did you ever get this figured out? I need the exact same thing. Any help is appreciated!

Inspira_Digital
Shopify Partner
135 3 5

@CaStLeDzgns  We can implement any of this for you no problem we have don it hundreds of times 

Twiiter: http://twitter.com/inspiradigital Website Development: https://www.inspiradigitial.co.uk B2B https://www.inspiradigital.co.uk/our-services/b2b-ecommerce-on-shopify
gsantoz
New Member
7 0 0

Hi, I need help with the same thing