Magento Multipe websites Share Shopping cart session - php

i am a new to magento what i am trying to do is share Shopping cart among different stores and there respective websites, I have already implemented the solution provided in this post,
Magento multiple websites share shopping cart, which works but have a limitation,
The Limitation which also is a problem in my case is that if something is 1st added to cart from ROOT category , it remains in session even we switch store(all stores have different ROOT category), also items added from other stores also share same cart session. BUT when i add something to cart from any other Store(Non Default Store) and then move to other stores, Cart Session for every store is created independently(mean there sessions are not shared). Now i wanna know what am i doing wrong here or what must i do to share there sessions.?

Give this a try. I's something I developed for a project on Magento EE 1.12, but it should work on CE also. Magento already shares the cart between store views under the same website. The main idea behind the code is to make magento share the cart for all store views not just the ones in the same website.
I'm not sure it will work for any websites configuration but you can take a shot.

try this works definitely, but its better to overwrite model file.
thanks to this post.
Single Cart multiple websites in Magento
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 and 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:
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.
The currency in the cart will be the same as in the store you selected.
The link for editing items in the cart will will not redirect customer to original cart website.

Related

Prestashop sharing product stock between two seperate prestashop websites

I have a two seperate websites(f.e. abc.com and 123.com) Shops have the same products, but different prices. I want that these two stores would share product stock and nothing more. So I guess it's just one column from database. Is there a good way to synchronize product stock between two seperate prestashop websites?
In order to achieve your goal. You should use the multistore functionality in Prestashop (sharing products and stock), see doc.prestashop.com/display/PS16/Managing+Multiple+Shops
As I assume you aren't using it for a specific reason, you would need to go and create your own module. Your module should register to the actionUpdateQuantity hook, meaning everytime your stock changes, it should do something, namely send a message to the other shop.
Normally, you would use the Prestashop webservice for this kind of behaviour, but as the webservice has some problems with stock management (see http://forge.prestashop.com/browse/PSCSX-3170, mainly having to do with the advanced stock management). I don't know if you use the ASM functionality, but I've created an example module for syncing your stocks. It can be adapted to be compatible with ASM functionality.
In the module configuration, you'll find the Sync URL of the current shop, you can use that URL in the other shop. So you'll install the module on both shops and cross reference them. I've created a separate sync.php file which will be called to sync the stock. As said, normally you should use the webservice functionality for this (and if you dont use ASM, you can adapt it to use the webservice, if you do use ASM, you must adapt it to allow for stock movements and valuation).
For the code, see the repository at https://github.com/mwienk/prestashop-syncstock

Multiple Magento Stores sharing inventory generates a new URL from the shopping cart

We have three stores within Magento EE. When the site was set-up, inventory was dumped into "All Store Views" versus in each individual store. Having said that, some inventory is sold across all three sites, and all three sites share the same user login and checkout process. But what happens now is, if you add a store-specific item to your cart (from Store A), then head over to one of the other two sites' shopping carts (Store B or C) and click the product link, it essentially replicates the product page (from A) on the (Store B or C) domain. The URL path is the same, and all on-page content is exactly the same.
Does this issue stem from all inventory being under All Stores? Or can this be fix, so if you have an item from Store A in your Store B shopping cart, that the link points back to its origin in Store A?
As far as Magento's default implementation goes, products are NOT store-specific, also categories are NOT store-specific, you may however choose to change the visibility of the product per store.

Make Opencart 1.5.6 multi-store share same cart over multiple Top-level Domain

I wanna ask if there's a way that I can make my opencart multi-store in just one session. For example, if I login to store1, then I went to store 2, I don't need to login anymore. Also, if I didn't login but I added a product from store1, when I go to store2, the product that I added in store1 is still on the cart (adding product first before login).
I've tried all the solutions of the links below but none of them worked:
how to make opencart multi-store share same cart over multiple TLDs?
Opencart cart across multiple stores with different subdomains
Opencart Multi-store 1.5.6 shared session
Thanks.

Prestashop 1.6 Automatically adding a customer to a group upon virtual product purchase

Using Prestashop 1.6 is there a way to automatically add a customer to a group when they purchase a virtual product?
Example: Virtual product is a membership. When they buy the product, I want them to be assigned to the Members group.
One way I was thinking of achieving this was to do the following:
Can the virtual product link that the customer receives in the email be a link to a PHP page that I create? I was thinking of writing a PHP page with an activate membership button that would insert them into the proper group via MySQL code.
I could not find a module to do this. I would like to avoid creating a module because then I would have to study module creation and I was hoping for an easier solution.
The highly recomended solution is a custom module that will assign the user when the payment is confirmed. It can be done with changes to the core file, but this is the worst solution, since after the next upgrade of PrestaShop those changes will be overriden. Module creation is not so hard, you just need to implement the hook "actionOrderStatusUpdate" and asign the order customer to previously selected customer group from the module configure page.

Adding multiple items to OS Commerce cart programmatically / with API

I am creating a custom paintball marker configurator. The customers will be able to choose a marker, then add hundreds of different accessories with our html5 / java script configurator. The client has an OSCommerce site and the goal is to send all the pieces that make up their custom marker to the OScommerce cart.
All the pieces in the configurator will be in the oscommerce system, but we're going to build the configurator on codeigniter and a seperate html5 site. So my question is, is there any way to send information from another page on his site (our configurator) to the oscommerce cart.
I was thinking maybe an array of products with their specific information like sku number, product id, etc, and add that array to the oscommerce cart.
Any ideas? I can't find any solutions online. Thanks ahead of time!!!
http://forums.oscommerce.com/topic/45279-add-to-cart-from-external-page-or-site/
https://www.google.com/search?q=oscommerce+add+to+cart+from+external+site+site:forums.oscommerce.com
Looks like a nightmare TBH. Lots of issues with cookies/sessions. Might have to create a separate oscommerce file (e.g. custom_add_to_cart.php) to hit from the external page. Doesn't look like there's an easy way to add to cart > edit options on external page > save to cart. May be able to avoid some issues if you serve the html5 site on the same domain or create a custom page/module (if oscommerce has those).
Good luck!

Categories