How to show Announcement bar only on Cart page

Topic summary

A user needed to display the announcement bar exclusively on the cart page in Shopify’s Dawn theme, rather than site-wide.

Initial Solutions Offered:

  • One suggestion involved adding CSS code to theme.liquid to hide the announcement bar on non-cart pages
  • Another user requested the store URL for further assistance

Problem Encountered:
The CSS approach caused the entire header section to disappear from the theme customizer, preventing the user from configuring the announcement bar.

Working Solution:
Wrap the content in sections/announcement-bar.liquid with a conditional statement:

{% if request.page_type == 'cart' %}
  [announcement bar content]
{% endif %}

This Liquid template condition ensures the announcement bar renders only when the page type is ‘cart’.

Status: Resolved - the user confirmed the conditional approach worked successfully.

Summarized with AI on October 27. AI used: claude-sonnet-4-5-20250929.

It worked thankyou