Shopify Tutorials

How to Create & Add an announcement bar on your Shopify store to boost sales.

Step 1: Create Section

Login into the admin panel. Go to Online Store > Themes. Click on Actions > Edit Code. Please check the following screenshot for reference:

Go to Sections. Click on Add a new section and then Create a new section called announcement-bar“. Please check the following screenshot for reference:

Step 2: Add the following code in the section file “announcement-bar.liquid”

{% if section.settings.show_topbar %}
  <div class="section-topbar" style="color:{{ section.settings.topbar_text_color}}; background:{{ section.settings.topbar_bg_color}}">
    {% if section.settings.topbar_link %}
        <a href="{{ section.settings.topbar_link }}" style="color:{{ section.settings.topbar_text_color}}">{{ section.settings.topbar_text}}</a>
    {% else %}
     {{ section.settings.topbar_text}}
    {% endif %}
  </div>
{% endif %}

{% if section.settings.show_topbar %}
<style>
.section-topbar {
    padding: 10px 0;
    text-align: center;
}
</style>
{% endif %}

{% schema %}
  {
    "name": "Announcement Bar",
    "settings": [
    {
          "type": "header",
          "content": "Top Bar"
        },
        {
          "type": "checkbox",
          "id": "show_topbar",
          "label": "Show Top Bar",
          "default": true
        },
        {
          "type": "text",
          "id": "topbar_text",
          "label": "Text"
        },
        {
          "type": "url",
          "id": "topbar_link",
          "label": "Top Bar Link"
        },
        {
          "type": "color",
          "id": "topbar_bg_color",
          "label": "Top Bar Color",
          "default": "#000"
        },
        {
          "type": "color",
          "id": "topbar_text_color",
          "label": "Text",
          "default": "#fff"
        }
    ]
  }
{% endschema %}

Step 3: Include section in theme.liquid file. Please check the following screenshot for reference:

Step 4: Edit the Customize settings to show the Announcement Bar.

Go to Online Store > Themes > Customize. It will show you all the sections. You will see “Announcement Bar” section at the top. Please see the following screenshot for reference:

The Announcement Bar section. It will show you the content settings and you can manage is easily. Please see the following screenshot for reference:

At last, Click on Save button. That’s it! Now you know how to boost sales with announcement bar Shopify.

Shopify Developer

Recent Posts

How to Link eBay to Shopify Store

Imagine! Seamlessly connecting the vast customer base of eBay with the robust features of your…

1 month ago

Unlock the Power of Shopify Flow: Automation Strategies for eCommerce

Let’s face it. Running an online store requires unwavering discipline. Juggling multiple tasks simultaneously is…

2 months ago

Everything You Need to Know About Shopify Liquid

There’s no denying that Shopify has taken over the world. The ecommerce platform contributes to…

2 months ago

Maximizing Revenue: 7 Best Shopify Themes for Conversion Rates that Soar

It’s true. Every marketing strategy has one common objective: to drive maximum conversion rates. If…

3 months ago

Terrific Dropshipping Business Ideas for 2024

*Sigh*. Are you tired of trying out different methods of making money online? Hear it…

3 months ago

Shopify SEO Checklist for Continued Success in 2023

When driving traffic to your Shopify store, Search Engine Optimization (SEO) is the most affordable…

3 months ago