Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Announcement bar default - false

Solved

Announcement bar default - false

Zeuligan
Shopify Partner
11 1 1

Sorry for the simple question, but how/where do I set the Announcement bar för Dawn theme to off as default? 

I'm doing some custom coding and everytime I upload the theme code I have to turn it off. Can't find where to turn it off by default (in code) /blush. 

Accepted Solution (1)

namphan
Shopify Partner
1908 247 274

This is an accepted solution.

Hi @Zeuligan,

Please go to header-group.json file and add code:

Screenshot.png

code: 

"disabled": true,
Coffee tips fuels my dedication.
Shopify Development Service
PageFly Page Builder Optimize your Shopify store (Free plan available)
Need help with your store? namphan992@gmail.com

View solution in original post

Replies 5 (5)

akshay_bhatt
Shopify Partner
115 10 13

Hi @Zeuligan ,

Here’s how you can turn off the Announcement Bar by default:

1. Locate the Theme Schema File

The schema for theme settings is located in the setting_schema.json file.

  1. Go to Online Store > Themes > Edit Code.
  2. In the left sidebar, navigate to the config folder.
  3. Open setting_schema.json.

    2. Find the Announcement Bar Setting

    Search for the announcement bar section in the setting_schema.json file. It might look something like this:

 

{
  "type": "checkbox",
  "id": "show_announcement",
  "label": "Show announcement bar",
  "default": true
}

 

3. Change the Default Value

To turn it off by default, change the "default": true to "default" : false :

 

{
  "type": "checkbox",
  "id": "show_announcement",
  "label": "Show announcement bar",
  "default": false
}

 

4. Save and Test

  • Save the setting_schema.json file.
  • Preview the theme. The Announcement Bar should now be off by default whenever the theme is uploaded.

    Optional: Hardcode the Announcement Bar Off

    If you want to ensure the Announcement Bar is permanently disabled, you can directly edit the header.liquid (or relevant file) where the Announcement Bar is included:

    1. Go to the Sections folder in the theme editor.

    2. Open the file that renders the Announcement Bar, usually named announcement-bar.liquid or part of header.liquid .

    3. Surround the bar's logic with a condition that prevents it from rendering:

 

{% if false %}
    {% render 'announcement-bar' %}
{% endif %}

 

This ensures the Announcement Bar is never displayed, regardless of theme settings.

                      

Got it! If you found my suggestions helpful, please consider liking or marking it as a solution.
Your feedback is appreciated! If you have any more questions or need further assistance, just let me know.

Thanks & Regards
Akshay Bhatt

- Need a Shopify Specialist?
- Custom Design | Advanced Coding | Store Modifications
Email us
Zeuligan
Shopify Partner
11 1 1

Dawn 15.2.0, there is no such setting or code, otherwise I would have found it by searching in all the code files unfortunately. 

namphan
Shopify Partner
1908 247 274

This is an accepted solution.

Hi @Zeuligan,

Please go to header-group.json file and add code:

Screenshot.png

code: 

"disabled": true,
Coffee tips fuels my dedication.
Shopify Development Service
PageFly Page Builder Optimize your Shopify store (Free plan available)
Need help with your store? namphan992@gmail.com
Zeuligan
Shopify Partner
11 1 1

Thank you so much. Tried all places BUT that place with disabled, sometimes I wonder... 🙂
Have a great day

namphan
Shopify Partner
1908 247 274

Hi @Zeuligan,

This will keep the section visible in Customize but hidden. This would be better than removing the code completely. 😊

Coffee tips fuels my dedication.
Shopify Development Service
PageFly Page Builder Optimize your Shopify store (Free plan available)
Need help with your store? namphan992@gmail.com