Different Logo in Header for Tagged Customer

Is it at all possible to have the logo in the header of my theme change based on a customers tag? I am currently using the Debut theme and would like to have a different logo for a different customer tag.

Hey @ShayneM

Yes, it’s possible.

In your theme you need to do some customisation for this, First get the customer tags and look for the tag you want to change the logo for. If it exist you can replace the logo image using Javascript. leme know if you want to know more.

Thanks!!

Great! Thanks for getting back to me. I know the customer tag etc, I just don’t know the code I need to use or where to put it - are you able to help?

Hi @ShayneM ,

Please follow the steps below:

  • Step 1: You need to upload logo in Assets. Example logo with name: logo-customer.png

-Step 2: Go to sections > header.liquid file, in line 76 → 94 and change code:

Code:

{%- if customer and customer.tags contains 'customer tag' -%}
              
                
              
            {%- else -%}
            {%- assign img_url = section.settings.logo | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}
              
                {% capture logo_alt %}{{ section.settings.logo.alt | default: shop.name }}{% endcapture %}
                
                
              
            {%- endif -%}

Hope it helps!

Absolute legend! Thanks so much it works :slightly_smiling_face:

Hi @ShayneM ,

If you have any further questions, you can contact me.
Happy to help you.

Is this possible in Dawn 2.0?