3
votes

We have 5 websites (each with different store views and design) running on a single Magento installation (1.7) and all are set on different domains. Now we want to share the customer data and shopping cart across all 5 websites but it's not working. We have already set Persistent Shopping cart to true and Share Customer Accounts to Global but it's not working.

Any help in this regards will be appreciated. Thanks!

3
Which part not working? customer sharing, cart emptying when you switch site, etc. Can you checkout from all 5 sites or just 1 (5 ssl or 1)?Renon Stewart

3 Answers

4
votes

You need to create 1 website, 1 store and 5 store view in it. Different theme/skin can be assigned at store view level.

For Product sharing issue. you can create 5 store and then each store have separate store view. On each store we can define separate root category.

In this way cart and customer data can be shared.

1
votes

As suggested by Faisal, we should use 1 website, 1 store and multiple store views to share the cart content.

In our scenario, all store views were set to different domains thus cart sessions were not carried forward if customer wasn't logged in. To over come this, all we had to do was set "Cookie Path" to / in System > Configuration > Web > Session Cookie Management

Cookie Path

1
votes

I've made it different way and it works: I have single installation with multple domains and store and single SSL

I have main web site where i have all products from my other websites and it set with SSL.
1. Share customers account between multi-store:
You can configure this feature here: System -> Configuration -> Customer Configuration -> Share Customer Accounts ->Global
2.Share the cart content between Magento multi-store websites:

Magento uses separate cart sessions for each store. To use one website on the checkout session you need to modify the "Mage_Checkout_Model_Session" class.
Copy this file: app/code/core/Mage/Checkout/Model/Session.php to: app/code/local/Mage/Checkout/Model/Session.php.

After that add the following source code to the class:

class Mage_Checkout_Model_Session extends Mage_Core_Model_Session_Abstract
{
   const CHECKOUT_STORE_ID = 1;

   public function getCheckoutStoreId()
   {
      return self::CHECKOUT_STORE_ID;
   }

Change CHECKOUT_STORE_ID value "1" to your Magento store ID with all products ans SSL.

Next, find all such elements in the file:

Mage::app()->getStore()

and change them to:

Mage::app()->getStore($this->getCheckoutStoreId())

And that is it!

Clear Magento cache and check your store. Now your Magento will use one cart for different multi-domain stores websites.
There are 3 limitations of this solution:
1. All prices in the cart will be from the store you selected (using CHECKOUT_STORE_ID). So if you have different prices for different stores it will not work in the cart.
2. The currency in the cart will be the same as in the store you selected.
3. The link for editing items in the cart will will not redirect customer to original cart website.