Hello,
I just updated my website from Impulse 4.1.4 prior to 2.0 and I had a seperate wholesale page that worked with a different navigation for wholesalers. All was peachy.
A week ago I updated my theme to Impulse 7.1.0 and am following these 2 links (both describing how to add wholesale without an app). Yes I know I can use an app but came to Shopify from Squarespace where you could have a separate wholesale that was hidden and there was no add on app necessary.
Been trying everything I can think of to get it to work. I don’t know code just learning bits as I go along and keep trying different things.
These are the two links I’m referring too (they explain the steps prior to 2.0):
So in a nutshell you:
- Edit theme.liquid look for {{ content_for_layout }} and replace it 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 %}
- Add a snippet called “wholesale-note”
paste in this code:
This page is for approved wholesale customers only.
{% unless customer %} Log in to your account | {% endunless %} Contact us to request a wholesale account.
-
Add some templates page.wholesale, product.wholesale, collection.wholesale (now they suggest liquid for all of these as it’s supposed to generate it’s own code but no longer does in 2.0 so as suggested under the first article and a you tube of the second article I was told to make all these json files instead of liquid files which I did.
-
Create a bunch of wholesale products and tag them all wholesale and make sure you use the wholesale template (did that as I had this working in an older version of Impulse)
-
Add wholesale tag to your wholesale customers which I did (made an account for myself so I can keep checking this out)
-
Here is where I’m stumped:
In your theme editor, open theme.liquid and search for “main-menu.” If you don’t find anything, try searching for “navigation,” “site-nav,” “nav,” “menu.”
You can also look in the Snippets folder for a snippet called “site-nav,” “navigation,” or “dropdown.”
If your theme uses Sections, look in Sections > header.liquid.
The main thing we’re looking for is the following code:
{% for link in linklists.main-menu.links %} or {% for link in linklists[section.settings.main_linklist].links %}
then replace it with this code:
{% 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 %}
I don’t see {% for link in linklists.main-menu.links %} or {% for link in linklists[section.settings.main_linklist].links %} except something similar in line 2 of the header.liquid (see full header.liquid code below)
I used a partial code in my current sections header.liquid 7.1.0 theme which is live and then a copy 7.1.0 that isn’t live.
{% if customer %}
{% if customer.tags contains ‘wholesale’ %}
{% assign main_menu = linklists[‘main-menu-wholesale’] %}
{% endif %}
{% endif %}
I didn’t see If I try to use the full code mentioned in step 6 I get schema errors which I don’t know how to fix it. I can see the header on the wholesale page on my backup copy and the number of products but where the products are it is blank. Attaching a photo.
Here is what my header.liquid looks like:
{%- liquid
assign main_menu = linklists[section.settings.main_menu_link_list]
assign toolbar_menu = linklists[section.settings.toolbar_menu]
assign logo_alignment = ‘left’
if section.settings.main_menu_alignment == ‘center-left’ or section.settings.main_menu_alignment == ‘center-split’ or section.settings.main_menu_alignment == ‘center’ or section.settings.main_menu_alignment == ‘center-drawer’
assign logo_alignment = ‘center’
endif
assign dropdown_alignment = ‘left’
if section.settings.main_menu_alignment == ‘left-center’ or section.settings.main_menu_alignment == ‘center-split’ or section.settings.main_menu_alignment == ‘center’
assign dropdown_alignment = ‘center’
endif
assign template_name = template | replace: ‘.’, ’ ’ | truncatewords: 2, ‘’ | handle
assign sticky_header = false
if section.settings.header_style == ‘sticky’
assign sticky_header = true
endif
assign overlay_header = false
if template_name == ‘index’ and section.settings.sticky_index
assign overlay_header = true
endif
if template_name contains ‘collection’ and collection.image and section.settings.sticky_collection
assign overlay_header = true
endif
-%}
{% if customer %}
{% if customer.tags contains ‘wholesale’ %}
{% assign main_menu = linklists[‘main-menu-wholesale’] %}
{% endif %}
{% endif %}
{%- render ‘drawer-menu’,
section: section,
main_menu: main_menu,
toolbar_menu: toolbar_menu,
logo_alignment: logo_alignment
-%}
{%- render ‘cart-drawer’ -%}
{%- unless overlay_header -%}
{%- if section.settings.show_locale_selector or section.settings.show_currency_selector or section.settings.toolbar_social or section.settings.toolbar_menu != blank -%}
{%- render ‘toolbar’,
section: section,
toolbar_menu: toolbar_menu,
overlay_header: overlay_header
-%}
{%- endif -%}
{%- endunless -%}
{%- if overlay_header -%}
{%- if section.settings.show_locale_selector or section.settings.show_currency_selector or section.settings.toolbar_social or section.settings.toolbar_menu != blank -%}
{%- render ‘toolbar’,
section: section,
toolbar_menu: toolbar_menu,
overlay_header: overlay_header
-%}
{%- endif -%}
{%- endif -%}
{%- if logo_alignment == ‘left’ -%}
{%- if logo_alignment == ‘left’ and section.settings.main_menu_alignment != ‘left-drawer’ -%}
{%- if logo_alignment == ‘center’ -%}
{%- if section.settings.main_menu_alignment == ‘center-left’ -%}
{%- render ‘header-desktop-nav’, main_menu: main_menu, dropdown_alignment: dropdown_alignment -%}
{%- endif -%}
{%- if section.settings.main_menu_alignment == ‘center-split’ -%}
{%- render ‘header-split-nav’, main_menu: main_menu, section: section, dropdown_alignment: dropdown_alignment -%}
{%- endif -%}
{%- if section.settings.main_menu_alignment != ‘center-split’ -%}
{%- if section.settings.main_menu_alignment == ‘center’ -%}
{%- unless overlay_header or section.settings.announcement_above_header -%}
{%- render ‘announcement-bar’, section: section -%}
{%- endunless -%}
{% schema %}
{
“name”: “t:sections.header.name”,
“settings”: [
{
“type”: “link_list”,
“id”: “main_menu_link_list”,
“label”: “t:sections.header.settings.main_menu_link_list.label”,
“default”: “main-menu”
},
{
“type”: “checkbox”,
“id”: “mega_menu_images”,
“label”: “t:sections.header.settings.mega_menu_images.label”,
“default”: true,
“info”: “t:sections.header.settings.mega_menu_images.info”
},
{
“type”: “select”,
“id”: “main_menu_alignment”,
“label”: “t:sections.header.settings.main_menu_alignment.label”,
“default”: “left”,
“options”: [
{
“value”: “left”,
“label”: “t:sections.header.settings.main_menu_alignment.options.left.label”
},
{
“value”: “left-center”,
“label”: “t:sections.header.settings.main_menu_alignment.options.left-center.label”
},
{
“value”: “left-drawer”,
“label”: “t:sections.header.settings.main_menu_alignment.options.left-drawer.label”
},
{
“value”: “center-left”,
“label”: “t:sections.header.settings.main_menu_alignment.options.center-left.label”
},
{
“value”: “center-split”,
“label”: “t:sections.header.settings.main_menu_alignment.options.center-split.label”
},
{
“value”: “center”,
“label”: “t:sections.header.settings.main_menu_alignment.options.center.label”
},
{
“value”: “center-drawer”,
“label”: “t:sections.header.settings.main_menu_alignment.options.center-drawer.label”
}
]
},
{
“type”: “select”,
“id”: “header_style”,
“label”: “t:sections.header.settings.header_style.label”,
“default”: “normal”,
“options”: [
{
“value”: “normal”,
“label”: “t:sections.header.settings.header_style.options.normal.label”
},
{
“value”: “sticky”,
“label”: “t:sections.header.settings.header_style.options.sticky.label”
}
]
},
{
“type”: “checkbox”,
“id”: “sticky_index”,
“label”: “t:sections.header.settings.sticky_index.label”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “sticky_collection”,
“label”: “t:sections.header.settings.sticky_collection.label”,
“info”: “t:sections.header.settings.sticky_collection.info”,
“default”: false
},
{
“type”: “header”,
“content”: “t:sections.header.settings.header_announcement_bar”
},
{
“type”: “checkbox”,
“id”: “announcement_compact”,
“label”: “t:sections.header.settings.announcement_compact.label”
},
{
“type”: “checkbox”,
“id”: “announcement_above_header”,
“label”: “t:sections.header.settings.announcement_above_header.label”
},
{
“type”: “header”,
“content”: “t:sections.header.settings.header_toolbar”
},
{
“type”: “link_list”,
“id”: “toolbar_menu”,
“label”: “t:sections.header.settings.toolbar_menu.label”,
“info”: “t:sections.header.settings.toolbar_menu.info”
},
{
“type”: “checkbox”,
“id”: “toolbar_social”,
“label”: “t:sections.header.settings.toolbar_social.label”
},
{
“type”: “header”,
“content”: “t:sections.header.settings.header_language_selector”,
“info”: “t:sections.header.settings.header_language_selector”
},
{
“type”: “checkbox”,
“id”: “show_locale_selector”,
“label”: “t:sections.header.settings.show_locale_selector.label”,
“default”: true
},
{
“type”: “header”,
“content”: “t:sections.header.settings.header_currency_selector”,
“info”: “t:sections.header.settings.header_currency_selector”
},
{
“type”: “checkbox”,
“id”: “show_currency_selector”,
“label”: “t:sections.header.settings.show_currency_selector.label”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “show_currency_flags”,
“label”: “t:sections.header.settings.show_currency_flags.label”,
“default”: true
}
],
“blocks”: [
{
“type”: “logo”,
“name”: “t:sections.header.blocks.logo.name”,
“limit”: 1,
“settings”: [
{
“type”: “image_picker”,
“id”: “logo”,
“label”: “t:sections.header.blocks.logo.settings.logo.label”
},
{
“type”: “image_picker”,
“id”: “logo-inverted”,
“label”: “t:sections.header.blocks.logo.settings.logo-inverted.label”,
“info”: “t:sections.header.blocks.logo.settings.logo-inverted.info”
},
{
“type”: “range”,
“id”: “desktop_logo_width”,
“label”: “t:sections.header.blocks.logo.settings.desktop_logo_width.label”,
“default”: 200,
“min”: 100,
“max”: 400,
“step”: 10,
“unit”: “px”
},
{
“type”: “range”,
“id”: “mobile_logo_width”,
“label”: “t:sections.header.blocks.logo.settings.mobile_logo_width.label”,
“default”: 140,
“min”: 60,
“max”: 200,
“step”: 10,
“unit”: “px”,
“info”: “t:sections.header.blocks.logo.settings.mobile_logo_width.info”
}
]
},
{
“type”: “announcement”,
“name”: “t:sections.header.blocks.announcement.name”,
“limit”: 3,
“settings”: [
{
“type”: “text”,
“id”: “text”,
“label”: “t:sections.header.blocks.announcement.settings.text.label”,
“default”: “Hassle-free returns”
},
{
“type”: “text”,
“id”: “link_text”,
“label”: “t:sections.header.blocks.announcement.settings.link_text.label”,
“default”: “30-day postage paid returns”
},
{
“type”: “url”,
“id”: “link”,
“label”: “t:sections.header.blocks.announcement.settings.link.label”
}
]
}
],
“default”: {
“settings”: {}
}
}
{% endschema %}
