Magento Ajax add to cart not working for subsites -


I wrote a small script through AJAX to add products to the car.

  $ request = Dana :: app () - & gt; GetRequest (); $ Session = Dana :: getSingleton ('core / session', array ('name' => 'frontend')); $ Cart = Dana :: helper ('checkout / cart') - & gt; MillCart (); Foreign currency ($ pids as $ pids) {If (! Pid || $ pid == '') {continue;} $ product = Mage :: getModel ('catalog / product') - & gt; Load ($ pid); $ Cart-> addProduct ($ product, $ qty); } $ Session- & gt; Setcartup update (true); $ Cart- & gt; Save ();   

I have a multi site setup and this script works fine when it runs under the main site, but when I run it under a subsite, it is not in the cart.

I have tried to addtocart.php to subsite (and main sites including mage.php) and they tried to add it to the root of the main site, but nothing works

Thanks

>

all Sector take easy steps to set before the prefix with a single term. It works like a wildcard.

Do not share the cart between default behavior stores In your 'small script' make sure that the correct store is selected when the app is started for the first time.

  Dana :: app ($ storeId);   

Occasionally when you cross the domain you must include the URL parameter. I'm not sure how you will get that value, perhaps from the referrals page ..?

Comments