A user seeks to hide the header/menu on product pages where the product type equals “Affiliate” in the Dawn theme. They referenced a 2022 solution that no longer applies, as Dawn’s structure has changed—{% section 'header' %} no longer exists in theme.liquid.
Key developments:
Initial guidance: One responder suggested wrapping {% render 'header' %} in theme.liquid with a conditional check for product type “Affiliate”. However, the user couldn’t locate this code.
Working solution: Another contributor provided two approaches in sections/header.liquid:
Wrapping header HTML with {% if template.name != 'product' or product.type != "Affiliate" %}—this caused a JavaScript error on line 316
An alternative method (details shown via screenshots)—this successfully resolved the issue
Resolution: The second solution worked. The user, being new to Shopify, initially marked their own response as the solution but later corrected this after being asked to credit the actual helper. They also requested the working solution be separated from the failed attempt for clarity.
Summarized with AI on October 27.
AI used: claude-sonnet-4-5-20250929.
I have found this answer how to hide menu by collection here
but: the answer is from 2022 and I can’t locate {% section ‘header’ %} in the theme.liquid file of Dawn and I need to hide the menu when a product is ‘Type’ = Affiliate.
Alternativel I could create an Affiliate Collection of products but still unable to loacate {% section ‘header’ %}. Has the code changed since? I am new to Shopify and would appreciate the help.
Yes, the Dawn theme’s structure has changed since 2022. Shopify has moved most layout rendering to main-product.liquid or main.liquid, and the header is now included inside the layout/theme.liquid file using {% render ‘header’ %} instead of {% section ‘header’ %}.
To hide the menu (header) on product pages with Product Type = “Affiliate”, follow these steps: