Shopify themes, liquid, logos, and UX
Hi
I managed to add separate wholesale for my online store where they have access for wholesale products (different pricing) and everything works out well. The only thing couldn't solve it is to add a different menu for wholesale
Someone mentioned how to do it but it's not working for me, I am using Debut theme
I copied most of the wholesale coding from this link
please help me I would really appreciate it
Solved! Go to the solution
This is an accepted solution.
You can assign a linklist to a variable depending on customer tags. Make a linklist called "wholesale" and put the links in it that you want to appear for wholesalers. Then you can go into your site-nav.liquid in your snippets folder and at the top you can assign the user_link_list with this code:
// in this if statement use whatever you tag your wholesalers with after "contains"
{% if customer.tags contains 'wholesale' %} {% assign user_link_list = 'wholesale' %} {% else %} {% assign user_link_list = section.settings.main_linklist %} {% endif %}
Then a couple lines down look for this forloop code:
{% for link in linklists[section.settings.main_linklist].links %}
and change it to:
{% for link in linklists[user_link_list].links %}
Now if your customer is logged in and is tagged "wholesale" then they'll see the "wholesale" links
This is an accepted solution.
Go into your header.liquid file in your Sections folder and do the same thing, put the if statement and the variable assignment at the top and then find:
{% for link in linklists[section.settings.main_linklist].links %}
and change to:
{% for link in linklists[user_link_list].links %}
This is an accepted solution.
You can assign a linklist to a variable depending on customer tags. Make a linklist called "wholesale" and put the links in it that you want to appear for wholesalers. Then you can go into your site-nav.liquid in your snippets folder and at the top you can assign the user_link_list with this code:
// in this if statement use whatever you tag your wholesalers with after "contains"
{% if customer.tags contains 'wholesale' %} {% assign user_link_list = 'wholesale' %} {% else %} {% assign user_link_list = section.settings.main_linklist %} {% endif %}
Then a couple lines down look for this forloop code:
{% for link in linklists[section.settings.main_linklist].links %}
and change it to:
{% for link in linklists[user_link_list].links %}
Now if your customer is logged in and is tagged "wholesale" then they'll see the "wholesale" links
Thanks so much!!!!!
it worked !!!!!
@Ninthony wrote:You can assign a linklist to a variable depending on customer tags. Make a linklist called "wholesale" and put the links in it that you want to appear for wholesalers. Then you can go into your site-nav.liquid in your snippets folder and at the top you can assign the user_link_list with this code:
// in this if statement use whatever you tag your wholesalers with after "contains"
{% if customer.tags contains 'wholesale' %} {% assign user_link_list = 'wholesale' %} {% else %} {% assign user_link_list = section.settings.main_linklist %} {% endif %}Then a couple lines down look for this forloop code:
{% for link in linklists[section.settings.main_linklist].links %}and change it to:
{% for link in linklists[user_link_list].links %}Now if your customer is logged in and is tagged "wholesale" then they'll see the "wholesale" links
@Ninthony wrote:You can assign a linklist to a variable depending on customer tags. Make a linklist called "wholesale" and put the links in it that you want to appear for wholesalers. Then you can go into your site-nav.liquid in your snippets folder and at the top you can assign the user_link_list with this code:
// in this if statement use whatever you tag your wholesalers with after "contains"
{% if customer.tags contains 'wholesale' %} {% assign user_link_list = 'wholesale' %} {% else %} {% assign user_link_list = section.settings.main_linklist %} {% endif %}Then a couple lines down look for this forloop code:
{% for link in linklists[section.settings.main_linklist].links %}and change it to:
{% for link in linklists[user_link_list].links %}Now if your customer is logged in and is tagged "wholesale" then they'll see the "wholesale" links
I am trying to solve the same exact issue and can't seem to make this solution work 😞
I am also using the Debut theme. However, I don't have the code:
{% for link in linklists[section.settings.main_linklist].links %}
in my site-nav.liquid. The closest thing I have is:
{% for link in linklists[linklist].links %}
I tried replacing it with the code listed but my entire menu goes away completely. If you'd be willing to share any advice I'd appreciate it! Thanks!
So main_linklist and linklist are just section settings. You'll want to either assign the section setting to a variable, or set the wholesale linklist to that same variable based on if the customer is tagged wholesale or not and do that above the forloop. So something like this:
{% assign current_linklist = section.settings.linklist %}
{% if customer.tags contains 'wholesale' %}
{% assign current_linklist = 'wholesale-menu' %}
{% endif %}
{% for link in linklists[current_linklist].links %}
{{ link.title }}
{% endfor %}
In the beginning you can see we're setting the current_linklist variable to whatever is set in the section settings. This is assuming that "linklist" is the id in the section schema. After that, we check the customer's tags and if it contains "wholesale" as a tag, if it does then we assign the current_linklist to be "wholesale-menu" -- this assumes the handle of your navigation for your wholesale menu is "wholesale-menu". If you were a customer without a "wholesale" tag, the forloop would output the titles of whatever linklist was set through the section settings. If it was a customer with a wholesale tag, it would output the titles for the wholesale menu linklist.
Thank you so much for responding and for explaining this so well. I think I am finally beginning to grasp what is going on here.
I have tried editing this in my site-nav.liquid as well as my header.liquid and still haven't had success. When I edit the code in both, my menu goes away entirely. If I edit one or the other, the menu remains my standard main menu. Should I be editing this in another section or snippet?
Thank you again for your help and patience in explaining! I feel like I'm so close. This is my first time ever attempting to edit code so this is all Greek to me (:
There's no way for me to tell what's really going wrong without seeing your code, knowing the handles of your menus, or knowing how your customers are tagged. If you'd like I can request access to your theme. You can send me a DM with your store url and exactly what you're trying to do and I can see if I can get it figured out for you, then I can explain it so you have an idea next time you do something similar.
hi ninthony i followed the instruction mostly from here https://www.envision.io/blogs/ecommerce-pulse/80312001-how-to-add-a-wholesale-area-to-your-shopify-s... and followed your step in conversation i am only stuck on on point when i am loged in whole sale customer section its shows ok but on top it show retail collection menu as well which i dont want to show my wholesale clint can please help me out i can give you access to my store please i am really tired trying out every thing.thanks a lot
I'm trying to create one template to hold all sections so that i can fell free to add more sections in my other pages because the main theme template cannot be added to other pages unless to create a new template.
thank you
ibrahim
hey, I noticed the code worked out for the desktop version, but the mobile version is not working where the menu is not showing up
@Ninthony wrote:You can assign a linklist to a variable depending on customer tags. Make a linklist called "wholesale" and put the links in it that you want to appear for wholesalers. Then you can go into your site-nav.liquid in your snippets folder and at the top you can assign the user_link_list with this code:
// in this if statement use whatever you tag your wholesalers with after "contains"
{% if customer.tags contains 'wholesale' %} {% assign user_link_list = 'wholesale' %} {% else %} {% assign user_link_list = section.settings.main_linklist %} {% endif %}Then a couple lines down look for this forloop code:
{% for link in linklists[section.settings.main_linklist].links %}and change it to:
{% for link in linklists[user_link_list].links %}Now if your customer is logged in and is tagged "wholesale" then they'll see the "wholesale" links
This is an accepted solution.
Go into your header.liquid file in your Sections folder and do the same thing, put the if statement and the variable assignment at the top and then find:
{% for link in linklists[section.settings.main_linklist].links %}
and change to:
{% for link in linklists[user_link_list].links %}
Thanks Ninthony, much appreciate it
I will definitely need your help soon regarding implement shipping rates based on type of products but I don't need it at this moment. Your help for the wholesale thing won't forget it 😀🙏🏼
Well I'm just going to chime in and let you know that Shopify doesn't have support for shipping rates on specific groups of products. I believe you'll need an app for that. Otherwise you have to charge a flat rate, you can give discounts at a certain price spent, or you can charge for shipping based on weight.
You'll need an app to do this, I'm not sure if there's a free one but I've heard of this one:
https://apps.shopify.com/vendor-shipping-rules-1
which gets pretty good reviews, but I can't really speak for it myself as I haven't used it. Our company uses a flat rate with USPS
Hi, hopeing you can help me. I created the wholesale section as mentioned above many times before with debut theme. However the header.liquid file for colorblock theme is different. Can you please tell me where to insert the code on that theme? I've been at this for 4 days.
I appreciate any help.
I am trying to solve the same issue and it seems like I get close with your solution but am still unsuccessful. I can't seem to find the code in my site-nav.liquid that you list below that needs to be changed. I have something similar but when I replace it, my menu goes away entirely. If you have any suggestions I'd really appreciate it!
Here is the code I have that I tried replacing with what you have listed.
{% for link in linklists[linklist].links %}
Hi @Ninthony hope you can read and check this, I have already applied the codes from this tutorial https://www.envision.io/blogs/ecommerce-pulse/80312001-how-to-add-a-wholesale-area-to-your-shopify-s...
However, I have skipped the Step 4 due to unavailability of Theme templates in Products section. The codes are not working, and I guess this is because I skipped the Step 4. Can you please help me to assign the 'wholesale' template to Wholesale products using liquid codes, if possible?
I am currently using Debut theme.
Thank you in advance!
Hi I was wondering if you can help me with this. I been trying to replace the menu with the wholesale menu for tagged customers here is my nav menu code:
I tried your way and this also and both did not work:
Once you find it, replace it with the following for mobile navigation:
{% 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 %}
Or with this for desktop navigation:
{% assign menu_handle = 'main-menu' %}
{% if customer %}
{% if customer.tags contains 'wholesale' %}
{% assign menu_handle = 'main-menu-wholesale' %}
{% endif %}
{% endif %}
{% include 'site-nav', linklist: menu_handle %}
I managaed to get the different menu but I can't figure out how to have my inventory adjust in both places.
Hi Ninthony- I'm wondering if (and hoping that) you can help. My goal is to have a few products viewable only to wholesale customers, so I used the instructions from the link shared above (https://www.envision.io/blogs/ecommerce-pulse/80312001-how-to-add-a-wholesale-area-to-your-shopify-s...) and then also followed your instructions for creating the menu. I have not been able to get my wholesale products to be hidden from my "shop" page no matter what I've tried. I went through the steps again, and possibly I'm missing one tiny thing, or maybe the instructions at that link are outdated for the current version of Debut I'm using. Do you have any suggestions? Thank you in advance! Pam
I believe I just figured it out so I am posting in case anyone else is racking their brain about this. I had to create a separate collection to put my retail products in so that only those showed for retail customers. My "shop" link was by default pointing to all products so it was including everything. I've now gone through each of my retail products and added them to that retail collection. Fingers crossed that it is now solved!
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024