Skip to content

B2B and B2C under same domain – is it possible?

Is it possible to add a B2C website to our magento2 instance which already has a B2B website? All without changing domain or adding subdomains?

For more context: we have a multi-country b2b magento2 instance with each country having its own website with corresponding store and store view and different domain; the frontend of each is managed with PWA studios’ dists. Now each of these countries will soon need a B2C website counterpart and we don’t want to create other 6 dists (we’re managing 6 countries, 6 domains) nor do we want to change the domains and urls.

What we tried so far is configure the first b2c website in the magento2 admin and we also extended the storeConfig graphql to fetch all websites available in an instance and use the graphql in question to modify Venia’s store switcher (we turned it into a website switcher essentially).

This seemed to work as it switched across and correctly displayed the two different websites.

The problem is that users must be divided by website: an account created on the b2b website cannot be used to access the b2c website and vice versa. This doesn’t seem to work as the user does not get logged off when we switch between b2b and b2c.

Going back to the first question, i’m now wondering whether handling a b2c and b2b website on the same domain and url is even possible or advisable, as i think the accounts problem stems exactly from it.

Can anyone help me figure this out? Thank you!