hi i want to add 2 icons in header in motion theme in shopify before cart option where i highlight rectangular in attached image. can someone help me to do this?
Hi @abdulquyyum
This is Amelia at PageFly - Shopify Advanced Page Builder app.
You can try the following steps I have provided to help you solve the problem you are facing:
Step 1: Online Stores > Themes > Edit code
Step 2: Find file header.liquid
Step 3: Add the icon to the desired position in the header.
Hoping my solution helps you solve your problem.
Best regards,
Amelia | PageFly
this is my header code. where i add icon code so that it comes before cart option
this is code:
{%- assign main_menu = linklists[section.settings.main_menu_link_list] -%}
{%- 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 %}
{% include ‘drawer-menu’ %}
{% include ‘cart-drawer’ %}
{%- 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 -%}
{%- assign has_logo = false -%}
{% if template_name == ‘index’ and section.settings.sticky_index %}
{%- assign overlay_header = true -%}
{% endif %}
{% if template_name == ‘collection’ and collection.image and section.settings.sticky_collection %}
{%- assign overlay_header = true -%}
{% endif %}
{% style %}
.site-nav__link,
.site-nav__dropdown-link {
font-size: {{ section.settings.type_navigation_size }}px;
}
{% if section.settings.type_navigation_size < 18 %}
.site-nav__link {
padding-left: 8px;
padding-right: 8px;
}
{% endif %}
{% endstyle %}
{% if section.settings.show_announcement %}
{% include ‘announcement-bar’ %}
{% 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’ %}
{% include ‘header-desktop-nav’ %}
{% endif %}
{% if section.settings.main_menu_alignment == ‘center-split’ %}
{% include ‘header-split-nav’ %}
{% endif %}
{% if section.settings.main_menu_alignment != ‘center-split’ %}
{% if section.settings.main_menu_alignment == ‘center’ %}
{% schema %}
{
“name”: “Header and menus”,
“settings”: [
{
“type”: “link_list”,
“id”: “main_menu_link_list”,
“label”: “Menu”,
“default”: “main-menu”
},
{
“type”: “select”,
“id”: “main_menu_alignment”,
“label”: “Logo alignment”,
“default”: “left-center”,
“options”: [
{
“value”: “left”,
“label”: “Logo left, menu left”
},
{
“value”: “left-center”,
“label”: “Logo left, menu center”
},
{
“value”: “left-drawer”,
“label”: “Logo left, menu drawer”
},
{
“value”: “center-left”,
“label”: “Logo center, menu left”
},
{
“value”: “center”,
“label”: “Logo center, menu below”
},
{
“value”: “center-drawer”,
“label”: “Logo center, menu drawer”
}
]
},
{
“type”: “select”,
“id”: “header_style”,
“label”: “Header style”,
“default”: “normal”,
“options”: [
{
“value”: “normal”,
“label”: “Normal”
},
{
“value”: “sticky”,
“label”: “Sticky”
}
]
},
{
“type”: “checkbox”,
“id”: “sticky_index”,
“label”: “Overlay header over homepage”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “sticky_collection”,
“label”: “Overlay header over collection”,
“info”: “(if collection image is enabled)”,
“default”: false
},
{
“type”: “header”,
“content”: “Typography”
},
{
“type”: “range”,
“id”: “type_navigation_size”,
“label”: “Text size”,
“default”: 18,
“min”: 12,
“max”: 40,
“unit”: “px”
},
{
“type”: “checkbox”,
“id”: “type_navigation_style”,
“label”: “Use heading font”
},
{
“type”: “header”,
“content”: “Announcement bar”
},
{
“type”: “checkbox”,
“id”: “show_announcement”,
“label”: “Show an announcement”
},
{
“type”: “text”,
“id”: “announcement_text”,
“label”: “Announcement text”,
“default”: “Free shipping and returns”,
“info”: “When closed, the announcement will remain closed until the next visit. Change the text to see it again.”
},
{
“type”: “url”,
“id”: “announcement_link”,
“label”: “Announcement link”
},
{
“type”: “checkbox”,
“id”: “announcement_closable”,
“label”: “Allow users to close announcement”
}
],
“blocks”: [
{
“type”: “logo”,
“name”: “Logo”,
“limit”: 1,
“settings”: [
{
“type”: “image_picker”,
“id”: “logo”,
“label”: “Logo”
},
{
“type”: “image_picker”,
“id”: “logo-inverted”,
“label”: “White logo”,
“info”: “Used when on top of an image”
},
{
“type”: “range”,
“id”: “desktop_logo_width”,
“label”: “Desktop logo width”,
“default”: 200,
“min”: 100,
“max”: 400,
“step”: 10,
“unit”: “px”
},
{
“type”: “range”,
“id”: “mobile_logo_width”,
“label”: “Mobile logo width”,
“default”: 140,
“min”: 60,
“max”: 200,
“step”: 10,
“unit”: “px”,
“info”: “Set as a max-width, may appear smaller”
}
]
}
],
“default”: {
“settings”: {}
}
}
{% endschema %}
