Closed michaelbromley closed 4 years ago
Some real-life use-cases for Channels:
I am a merchant that is on M2 commerce cloud edition. We have 5 websites, one with 2 separate store views. Moving to Magento from Volusion, the major draw was multi site. We have sites that sell the same product just to different audiences and marketed different. And one site is 100% a different product line. I can not imagine trying to manage those as separate stores. source
I will have store A, B and Each will have it's own url i.e www.a.com, www.b.com and www.c. Each of the stores will share some products and some products will be exclusive to each particular Each store will have it's own identity but will share physical addresses and general information. source
Consider the following:
products()
query. How do we decide which set of products to return? In general: How do we determine the active channel for a request?
channelId
(or token) argument with all API calls as an argument or a header, for example.
channelId
manually with possibly unwanted consequences.token
property (a random hash)channelId
and forwarded to the Service layer.A lot of work has been done on Channels over the past week. Here's a current status report:
Channels represent distinct sales outlets. Many web shops will just have a single, default channel, which is the website. However, there are cases when it would be desirable to be able to define distinct sales channels, such as:
Thus the following aspects could vary from one channel to the next:
Prior Art
Design
Adding Channels would quite significantly increase the complexity of the models. Here is a rough idea for an implementation:
id
andname
. By default, there is a "default" channel which must exist. Any number of additional channels may be created.available
property relative to each Channel. This could be as simple as a one-to-many relationship from Product -> Channels.price
would now be associated with a particular Channel.role
would be relative to a given Channel. Thus you can have Administrators who can view and administrate only selected Channels. This will be tricky to get right.channelId
argument to every query / mutation. Perhaps the active channel id can be stored in the JWT info so that it can be figured out once and then just persists for the session.