SHARE MAGENTO CART BETWEEN SEVERAL MAGENTO MULTI-STORES
In this post we will show you how to share magento cart between several magento multi-stores, Share client accounts, Share sessions between Magento websites and Share the truck content between Magento multi-store websites.
On the off chance that you have multi-stores arranged in your Magento and you need to have single truck for all multi-stores this article is the thing that you require.
All your multi-stores will be not separate sites, they all will have single truck (share truck content between multi-stores).
Additionally your clients will have single record for all multi-stores.
1. Share client accounts.
Initial step is to share clients account between multi-stores for share magento cart.
You can arrange this element here: System - > Configuration - > Customer Configuration - >
Share Customer Accounts.
2. Share sessions between Magento websites.
Next stride is to share clients session between Magento sites for share magento cart.
There are 3 conceivable store configurations for share magento cart::
1. On the off chance that your sites are situated in one area, yet in various indexes, e.g. “www.yourdomin.com/stores/store1
” and “www.yourdomin.com/stores/store2
” you can setup your “Cookie Path” to “/stores/
” in System - > Configuration - > Web - > Session Cookie Management
for share magento cart.
2. In the event that your sites are situated in various sub-spaces e.g. “store1.yourdomin.com
” and “store2.yourdomin.com
” you can setup “Cookie Domain” to “.yourdomin.com
” in System - > Configuration - > Web - > Session Cookie Management
for share magento cart.
3. In the event that you have distinctive areas, for this situation you can add session ID to the URL for another store. Utilize this development “Mage::getModel('core/url')- >addSessionParam()- >getUrl('...')
” to get the URL with session parameter for share magento cart.
After that your clients will have the capacity to switch between multi-stores Magento sites without re-login. At the end of the day, if client will login in one Magento site, he will have the capacity to see another multi-store Magento site utilizing his initially store account share magento cart.
Be that as it may, the truck will be diverse for each Magento site.
3. Share the truck content between Magento multi-store websites.
Magento utilizes isolate truck sessions for each store, the reason is that diverse multi-store sites have distinctive arrangement of items and distinctive item settings for each store (like value, amount, and so on for share magento cart).
To beat this impediment, you need a site/store which will have every single accessible item from every other site. In the event that you don’t have such Magento site, simply make it in the System - > Manage stores
. The thought is utilize single store and site in the checkout session, that is the reason we require Magento store with all items in it.
To utilize one site on the checkout session you have to alter the “Mage_Checkout_Model_Session
” class.
Duplicate this document: app/code/center/Mage/Checkout/Model/Session.php
to: app/code/nearby/Mage/Checkout/Model/Session.php
.
After that add the accompanying source code to the class for share magento cart:
// for share magento cart between several magento multi-stores class Mage_Checkout_Model_Session expands Mage_Core_Model_Session_Abstract { const CHECKOUT_STORE_ID = 1; public function getCheckoutStoreId() { return self::CHECKOUT_STORE_ID; } ...
Change CHECKOUT_STORE_ID
esteem “1” to your Magento store ID with all items.
Next, locate every such component in the document:
// // for share magento cart between several magento multi-stores Mage::app()- >getStore()
also, transform them to:
Mage::app()- >getStore($this->getCheckoutStoreId())
Clear Magento reserve and check your store. Presently your Magento will utilize one truck for various multi-stores sites.
Take note of that there are a few restrictions of this arrangement:
1. All costs in the truck will be from the store you chose (utilizing CHECKOUT_STORE_ID). So on the off chance that you have diverse costs for various stores it won’t work in the truck.
2. The money in the truck will be the same as in the store you chose.
3. The connection for altering things in the truck will divert client to unique truck site. It is conceivable to change it, you can supersede getUrl technique for truck things piece or abrogate controller.
we hope how to share magento cart between several magento multi-stores will help.
you may also like Get Product details Using Product sku in Magento