Hi all - I’m trying to add a wholesale section to my website where you need to enter an approved password to get into that section. I followed the tutorial in the below link as a guide.
https://www.envision.io/blogs/ecommerce-pulse/80312001-how-to-add-a-wholesale-area-to-your-shopify-store-without-an-app
The required steps are:
- Ensure that the account log in is optional
- Modify code in theme.liquid
- Add wholesale templates
- Create wholesale products
- Update customers w/ wholesale tag
- Show a different navigation menu to wholesalers (by editing code)
I’m having issues on step 6. I’m told to look for the below script in my header.liquid (my Dawn theme has one) :
{% for link in linklists.main-menu.links %}
OR
{% for link in linklists[section.settings.main_linklist].links %}
And replace it with:
{% assign menu_handle = 'main-menu' %}
{% if customer %}
{% if customer.tags contains 'wholesale' %}
{% assign menu_handle = 'main-menu-wholesale' %}
{% endif %}
{% endif %}
{% for link in linklists[menu_handle].links %}
The only lines of codes that have ‘main-menu’ in my Dawn theme can be found below. I tried to update the below code with the above code and got an “Invalid JSON in tag ‘schema’” error.
{
"type": "link_list",
"id": "menu",
"default": "main-menu",
"label": "t:sections.header.settings.menu.label"
}
I’m very new to Shopify code (and a little bit lost!!!) and need some pointing the right direction. Please let me know if you need me to clarify anything! Thanks!!
1 Like
This is Possible but you are looking at the JSON code and trying to change the code in the wrong place. you must have to access your header.liquid file, add a conditional check to identify the menu item, then wrap the menu code as follows:
{% if customer.tags contains "your tag" %}
Add the code of the menu item here
{%endif%}
That should do it! Don’t forget to like & mark as a solution is this solves your issue 
You can also reach out to me on my Professional Email for any Development related help :-
connect@thedevcomb.com
www.Thedevcomb.com
Hi @fliptoys ,
This code below should be enough. No need to change the JSON link_list since you are already calling the menu but its handle
{% assign menu_handle = 'main-menu' %}
{% if customer %}
{% if customer.tags contains 'wholesale' %}
{% assign menu_handle = 'main-menu-wholesale' %}
{% endif %}
{% endif %}
{% for link in linklists[menu_handle].links %}
Links here...
{% endfor %}
After spending some time looking at the liquid code in the header.liquid file and trying to locate the “% for link in linklists.main-menu.links %” line, i was able to find the line to replace by searching for “for link” and going through each line to see if it looked similar to the above line of code.
I followed the original instructions and the confirmation from both Made4Uo and Amit250850 motioned, and now I have a wholesale section that only customers with the “wholesale” tag can view wholesale pricing. Thanks for the push in the right direction!
2 Likes
Is this the line that you replaced with the main code while also using the suggestion above?
Also, there was a secondary codes for desktop where he searched using ‘left’ and ‘center’. The only thing I could find was ‘mega’… is this the right place for the desktop code?
My code:
This is what I was to look for:

Thanks!
i have the same problem, but dont understand the solution, if you could please help ?
Hello - Im in Dawn as well and can’t find any code wording: linklist link_list main-menu. This last step is holding me up. Can you help? Thank you!
Hiya! Im having the same issue. Can you advise where I put this code please?
{% assign menu_handle = ‘main-menu’ %}
{% if customer %}
{% if customer.tags contains ‘wholesale’ %}
{% assign menu_handle = ‘main-menu-wholesale’ %}
{% endif %}
{% endif %}
{% for link in linklists[menu_handle].links %}
This is what I did for wholesale website functionality (shopify Dawn Theme 14.0):
theme.liquid:
Removed line 297: “ {{ content_for_layout }} “
Replaced with:
{% if template contains ‘wholesale’ %}
{% if customer %}
{% if customer.tags contains ‘wholesale’ %}
{{ content_for_layout }}
{% else %}
{% include ‘wholesale-note’ %}
{% endif %}
{% else %}
{% include ‘wholesale-note’ %}
{% endif %}
{% else%}
{{ content_for_layout }}
{% endif %}
Header-mega-menu.liquid
Line 10: “{%- for link in section.settings.menu.links -%}”
Replaced with: “{% assign menu_handle = ‘dawn-header’ %}
{% if customer %}
{% if customer.tags contains ‘WHOLESALE’ %}
{% assign menu_handle = ‘main-menu-wholesale’ %}
{% endif %}
{% endif %}
{% for link in linklists[menu_handle].links %}”
Header-drawer.liquid
Removed line 24: “{%- for link in section.settings.menu.links -%}”
Replaced with: “{% assign menu_handle = ‘dawn-header’ %}
{% if customer %}
{% if customer.tags contains ‘WHOLESALE’ %}
{% assign menu_handle = ‘main-menu-wholesale’ %}
{% endif %}
{% endif %}
{% for link in linklists[menu_handle].links %}”
main-search.liquid
Added below line 262 ( “ {%- for item in search.results -%}” 
So line 263 now reads: “{% unless item.tags contains ‘wholesale’ %}”
1 Like
I’m still using this too:) And I made the same edits that you did. However, I just realized that the wholesale menu does not show on mobile. Does it show for you?