Liquid, JavaScript, themes, sales channels
I'm following this guide
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?
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?
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
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.
@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
Did you ever get this figured out? I need the exact same thing. Any help is appreciated!
@CaStLeDzgns We can implement any of this for you no problem we have don it hundreds of times
Hi, I need help with the same thing
User | RANK |
---|---|
37 | |
27 | |
14 | |
13 | |
9 |
Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023