Hi Community!
What I would like to know is if there’s a way to read from multiple sales channels from within the same storefront/theme.
What we would like to achieve is have a different look & feel and set of products depending on url. So, for example, both a.com and b.com would be set as store domains and, depending on if users are visiting either a.com or b.com, they will see different products and different layouts. The layout/template part is easy to handle because it’s just a conditional rendering depending on the url but I am not sure if it’s possible to read from a different sales channel and not the main one from within the store.
That’s it.
Any help on this would be much appreciated!
I think your describing pages not channels. Sales channels are specific venues for commerce. Brick and mortar, Retail Ecommerce, Marketplace Ecommerce and Direct to Consumer Ecommerce, Distribution, B2B are all examples of channels.
It sounds like you want to tailor your customer experiance using multiple sites/domains/pages.
Nope, I am referring to sales channels (https://www.dropbox.com/s/eyz4z589x1s65vm/Screen%20Shot%202021-09-08%20at%2021.47.04.png?dl=0).
Shop
is the standard sales channel for the storefront, so products need to be published to Shop
to show on the store. We use multiple sales channels to connect from different apps or custom front-ends we have, but we want to have multiple 2 different sales channels for the store itself, so when I go to a.com I see products A and when I go to b.com I see products B.
So, in my theme, I would have something like below (It’s just pseudo code):
if (url == 'a.com') {
products = salesChannel A;
include 'templateA';
} else if (url == 'b.com') {
products = salesChannel B;
include 'templateB';
}