Shopify themes, liquid, logos, and UX
Hello,
I'm wondering if there is a way to change the navigation bar links based on a customer tag. In this instance we have a (regular/not logged in) account and a (professional) account. We would like to have the regular/not logged in accounts have a certain navbar vs the professional having a different navbar. Is there an app or snippet of code for this? We are using the the "Modular" theme.
It can be done by doing some code customization. please send me a personal message and we can discuss what you'd like
You can do that but you need to customize the snippet. You can check my private message.
thanks i will check and let you know
Hi @CrunchyBytes,
You can use this snippet to check:
{% for tag in customer.tags %}
{% if tag contains 'professional'%}
{% assign link_professional = 'your_link' %}
{% else %}
{% assign link_normal = 'your_link' %}
{% endif %}
{% endfor %}
Hope this helps.
Hello, in which file do I place this?
Hi @CrunchyBytes,
You can use that snippet to change the file which you want to change navbar links.
{% assign menu_handle = 'main-menu' %}
{% if customer %}
{% if customer.tags contains 'wholesale' %}
{% assign menu_handle = 'main-menu-wholesale' %}
{% endif %}
{% endif %}
I have added this code to the header.liquid file to change the navbar according to the customer tag, but this does not seem to work.
Did you ever get this to work? I'm trying the same thing with no luck.. please help.
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024