Skip to main content

Step 2: How to add the Cart Block to your theme

Now that you have added the Unicorn Global Script to your theme, what's next?

Updated over 3 weeks ago

The article below will walk you through adding the cart block to your theme.
​

This allows your Unicorn carts to be rendered in your store front.
​

To manually activate the Unicorn Cart Block on your theme:
​

1. Inside your Shopify Themes menu, click "Customize" to open the Theme Editor:

2. Click "Add section" under the Header title. Then click the "Apps" tab. Then select the "Cart" block by Unicorn:

3. Save your changes and head back to the Unicorn app.

If you are having issues add the app block to your theme, please read our Troubleshooting Guide below:

Troubleshooting Guide:

My theme does not allow me to add an app block to the header section/ The Header Block is missing.

Some older themes have not been setup to have the ability to add an app block to the header section. This can be fixed with a small change to your theme code. Watch the video below for detailed instructions:

Follow the steps below:

  1. Go to the edit code section of your theme.

  2. Open the sections folder in your theme code and click 'Add a section'.

  3. In the popup box that appears, click the json button and then enter 'header-group' in the input field, then click save. This will create a new file for you called header-group.json.

  4. Open the new file and change the name value from "Group name" to "Header", then click the save button.

  5. Open you layout/theme.liquid file. Then find the line:

    1  {% section 'header' %}
  6. Directly below add a new line and with the following:

    1   {% sections 'header-group' %}
  7. Then save the file and head back to the theme editor. You will now see a section called 'Header' and you can add the app block to that section.

I get an error when adding an app block to my theme header section

Some themes have disabled the ability to add an app block to the header section of the theme. You will see an error that reads:

Section '1234567' is not supported in section groups

This can be fixed with a small change to your theme code. Watch the video below for detailed instructions:

Follow the steps below:

  1. Go to the edit code section of your theme.

  2. Open the sections folder in your theme code and the app.liquid file.

  3. Find the code below:

    1 "disabled_on": {2    "groups": ["header", "aside","footer"]3  }
  4. Delete the "header" item from the list.

  5. Then save the file and head back to the theme editor. You can now add the app block to that section.

If you require help fixed an error or need help change your theme code please get in contact with our support and we will assist.

Did this answer your question?