How can I incorporate a cart into a custom coded header?

Hello,

Other person build the custom header with the code. But this header doesn’t have a cart. How can I add one?

The store: https://www.ippsolutionscanada.com/

Thank you.

In header.liquid file add this code


  
  {{ cart.item_count }}

Hi @Leadlion ,

This is Henry at PageFly - Shopify Advanced Page Builder app.

You can try this code by following these steps:

Go to Online store => themes => actions => edit code and add this code on the file header.liquid


  Cart

  {{ cart.item_count }}

Hope this answer helps.

Best regards,

Henry | PageFly

I don’t use header included in the theme, I have custom header. If I past this code, would that work? And where exactly I need to put it?

Here is the code:

{% schema %}
{
“name”: “nav”,
“tag”: “section”,
“class”: “section”,
“settings”: [
{
“type”: “checkbox”,
“id”: “include_margins”,
“default”: true,
“label”: “t:sections.apps.settings.include_margins.label”
},
{
“type”: “text”,
“id”: “menu_1”,
“default”: “Your text”,
“label”: “Menu One Label”

},
{
“type”: “text”,
“id”: “menu_1_link”,
“default”: “Your text”,
“label”: “Menu One Link”

},
{
“type”: “text”,
“id”: “menu_2”,
“default”: “Your text”,
“label”: “Menu Two Label”

},
{
“type”: “text”,
“id”: “menu_2_link”,
“default”: “Your text”,
“label”: “Menu Two Link”

},

{
“type”: “text”,
“id”: “menu_3”,
“default”: “Your text”,
“label”: “Menu Three Label”

},
{
“type”: “text”,
“id”: “menu_3_link”,
“default”: “Your text”,
“label”: “Menu Three Link”

},
{
“type”: “text”,
“id”: “menu_4”,
“default”: “Your text”,
“label”: “Menu Four Label”

},
{
“type”: “text”,
“id”: “menu_4_link”,
“default”: “Your text”,
“label”: “Menu Four Link”

},
{
“type”: “text”,
“id”: “menu_5”,
“default”: “Contact”,
“label”: “Contact Label”

},
{
“type”: “text”,
“id”: “menu_5_link”,
“default”: “Contact”,
“label”: “Contact Link”

}
],
“blocks”: [
{
“type”: “@app
}
],
“presets”: [
{
“name”: “nav”
}
]
}
{% endschema %}