cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Issue with multiple SAP Commerce Composable Storefronts - B2B and B2C

sumitkhaldar
Explorer
0 Kudos
286

I have been trying to setup one b2b and one b2c stores with the common sap commerce backend.

I have followed the below mentioned steps and sample repositories:

https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/b2f400d4c0414461a4bb7e115dccd779/1c2604580...

https://github.com/SAP-samples/cloud-commerce-sample-setup/blob/main/js-storefront/manifest.json

Following is my manifest.json:

{
    "applications": [
        {
            "name": "b2bstore",
            "path": "b2bstore",
            "ssr": {
                "enabled": true,
                "path": "dist/b2bstore/server/server.mjs"
            },
            "csr": {
                "webroot": "dist/b2bstore/browser/"
            }
        },
        {
            "name": "mystore",
            "path": "mystore",
            "ssr": {
                "enabled": true,
                "path": "dist/mystore/server/server.mjs"
            },
            "csr": {
                "webroot": "dist/mystore/browser/"
            }
        }
    ]  
}

 

However, when trying to open my stores in ccv2 post deployment, I am always getting redirected to the B2B storefront and my B2C storefront is not opening at all.

Requesting your inputs and suggestion to understand where I am going wrong and what to do to solve this. Please let me know if further details are needed.

 

 

View Entire Topic
Anis-DK
Associate
Associate
0 Kudos

As mentioned in the documentation and re-iterated in KBA, in order to access your B2C storefront you need to create and use an endpoint with the following format: 

mystore.<domain-name>.<ext>

notice the desired application name as sub-domain.

If you want to use custom domain names you need to map each jsapps with its endpoint using properties, for example:

jsapps.mystore.servername.0=<b2c-endpoint-domain>   // to access b2c storefront
jsapps.b2bstore.servername.0=<b2b-endpoint-domain>. // to access b2b storefront

The properties can be added from Cloud Portal as mentioned here.

sumitkhaldar
Explorer
0 Kudos
The reason I was not able to make both b2b and b2c work together was because I had mistakenly added "https://" before the endpoint. After removing this, both b2b and b2c has started working smoothly.