Sharing Common cart with all subdomain

98 Views Asked by At

I have created multi store view from backend.

1- store1

2- store2

Now when i add product from store1 and switch store view to store2 then it shows that added product from store1 into the cart. Now when i created two sub domains for store views

1-store1.mysite.com

2-store2.mysite.com

and configured it on store > configuration > web > store wise base url also made changes in host and vhost file of apache below is apache vhost configuratuion

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "C:/xampp72/htdocs/projects/mysite/pub"
    ServerName store1.mysite.com
    SetEnv MAGE_RUN_TYPE "store"
    SetEnv MAGE_RUN_CODE "stoe1"
    ErrorLog "logs/store1.mysite.com-error.log"
    CustomLog "logs/store1.mysite.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "C:/xampp72/htdocs/projects/mysite/pub"
    ServerName store2.mysite.com
    SetEnv MAGE_RUN_TYPE "store"
    SetEnv MAGE_RUN_CODE "store2"
    ErrorLog "logs/store2.mysite.com-error.log"
    CustomLog "logs/store2.mysite.com-access.log" common
</VirtualHost>

and did same thing add product from store1.mysite.com and switch to store2.mysite.com then it doesn't show that product into the cart.

Basically i want customer to share common cart for all store view with multiple subdomains.

Note: i also changed customer configuration Share Customer Accounts to global

1

There are 1 best solutions below

0
On

Sounds like scope issue. Check this out. https://experienceleague.adobe.com/docs/commerce-admin/start/setup/websites-stores-views.html?lang=en

I believe you need to create store views for different sub-domains to keep cart, inventory etc. same in different sub-domains.