Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Morning,
I am building a multi-vendor store with a header that takes customers to different "shops" even though it's all the same domain. Currently my header has navigation links to subdomains for each brand (i.e. vip.transpacbrands, totaleegift.transpacbrands, etc.). And then I change the section that loads for the announcement bar and header based on the subdomain via the following code in my theme.liquid file:
{% case request.host %}
{% when 'viphomeandgarden.transpacbrands.com' %}
{% section 'announcement-bar' %}
{% style %}
#section-id-announcement-bar {
--announcement-background: #66817E;
{% endstyle %}
{% when 'seasonsdesigns.transpacbrands.com' %}
{% section 'announcement-bar' %}
{% style %}
#section-id-announcement-bar {
--announcement-background: #96B797;
{% endstyle %}
{% when 'totaleegift.transpacbrands.com' %}
{% section 'announcement-bar' %}
{% style %}
#section-id-announcement-bar {
--announcement-background: #FF6F73;
{% endstyle %}
{% else %}
{% section 'announcement-bar' %}
{% endcase %}
{% case request.host %}
{% when 'viphomeandgarden.transpacbrands.com' %}
{% section 'header-viphomeandgarden' %}
{% when 'totaleegift.transpacbrands.com' %}
{% section 'header-totaleegift' %}
{% when 'seasonsdesigns.transpacbrands.com' %}
{% section 'header-seasonsdesigns' %}
{% else %}
{% section 'header' %}
{% endcase %}
Now I'm trying to also change the theme style based on subdomain and need a little help. I already managed to edit the settings_data.json file so that each of the preset theme styles are correct:
Upon inspecting the existing code I've found two areas where this might be used but nothing I have tried has worked...
From navigating my site that Shopify.theme.style is always equal to null.
Any help here would be greatly appreciated so I don't have to hard code in style updates to every aspect of the stylesheet 4 times.
Thanks!
Any ideas anyone?
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025