Channels
Sales channels or just channels for short are first class citizens to which everything else in a store is connected to.
Products, stocks, orders, system configuration values and more. All are assigned or connected to one or more channels.
Each channel has at least one scope whose main purpose is to enable scope-level data and configuration. Scopes and channels have unique identifiers called "code". These are immutable, meaning it is not allowed for a channel code or channel scope code to be changed.
As mentioned in data scopes, these codes are used to store scope-level data and configuration. This means that the channel code is used as "data scope" and channel scope code is used as "data scope code".
Upon first application initialization, a default channel and its scope are created. Both of these have the code "default". We call this the "default scope". This means its values are used if no values are found in other channels and their scopes.
For each newly created channel, a "default" scope is created automatically so that we can access its values as default if they cannot be found in other scopes of that particular channel, as mentioned here.
Channels have one or more domains and one of them may be configured as primary. A channel domain is matched using the host at request time. If no active domain matches the host, the store frontend will not handle the request and an error will be thrown. This is not true for requests made to the store frontend API as clients may request a particular channel scope using headers.
Note
When using Amarant Cloud, domain configuration is accessible only through Amarant Cloud Console.
Create a channel
Navigate to Channels → Channels and click on "Add channel".
Enter the code and name. The name can be anything but the code must be unique and cannot be changed once the channel is created.
Click on "Save channel" to complete the process.
Create a channel scope
Navigate to Channels → Scopes and click on "Add channel scope".
Select the channel you want to associate the new scope with. Enter the code and name. The name can be anything but the code must be unique and cannot be changed once the channel scope is created.
Tip
The scope code is used as a route prefix in the store frontend. If you enter code "hr" here, then all URLs in the store frontend will start with "/hr" when this scope becomes active.
Click on "Save channel scope" to complete the process.
Create a channel domain
Navigate to Channels → Domains and click on "Add channel domain".
Select the channel you want to associate the new domain to. Enter the host, state and optionally check the "Default Channel Domain" to make it default for the channel.
Click on "Save channel domain" to complete the process.
Important
A single channel can only have one default domain. Selecting a domain as default unsets this value on all other domains of the channel. The state must be set to "Active" for the frontend store to take it into account when matching host to channel domains at request time.