Add to cart button not working after change

Hi, looking for some help :slightly_smiling_face:

I made a change to our website based on this tutorial which applied a transparent header, it worked nicely even though I’m using a lower version of Dawn (V2), I thought - https://websensepro.com/blog/how-to-make-sticky-and-transparent-header-in-dawn-theme/

A customer noticed that our add to cart button is now not working, which is isn’t. It’s not responding all, normally it would add a product to cart and a pop-up would appear.

I’ve gone line by line on my header.liquid file to work out what is causing this. It’s definitely something in that file which is broken. When I replace the file with an original version (without the transparent header change), it works as normal.

I’ve even gone through line by line and replaced new code with old, trying to identify the area which is breaking. This didn’t work. All I know is that it’s something between line 200 and 600 and has nothing to do with the Syntax.

I really like the transparent change so I don’t want to revert that. It’s working nicely everywhere else, so would prefer to fix the add to cart issue now.

Could anybody help me? What part of the header.liquid file is triggering the add to cart?

My site: https://summergray.com/

Did you make the change? Because I have checked and saw your add to cart button still working.

I had to revert to an old version of the theme to allow the add to cart to work.

Would it help if I attached the header.liquid file?

No, you don’t. Please go to your Online store > Themes > Customize > Header > Sticky header > Always, click Save, then I can provide code to make your header transparent without affect to Add to cart button

Hi, yep that’s done! Many thanks!

Go to your Online store > Themes > Edit code > open theme.liquid file, add this below code before tag

{% if template == 'index' %}

{% endif %}

Thank you! This seems to work nicely. The only issue is that I need a different logo colour on the homepage (it needs to be white). Are you able to add that somewhere in this code? Many thanks

Give me white logo version please

logo attached (it’s PNG)

Code updated

{% if template == 'index' %}

{% endif %}