I have two stores with id 1 and 2. Am trying to add product programmatically using below code
$params = array(
'form_key' => $this->_formkey->getFormKey(),
'product' => $productId, //product Id
'qty' => $qty //quantity of product
$this->_cart->addProduct($product_coll, $params); $this->_cart->save();
Checkout flow works well for the store 1. But for store 2, when I add any product to cart using above script. It is adding it to the store 1. I found out this when I looked into the magento quote table . Even though am in store 2, when i add product to cart the quote tables shows it is assigned to store 1. So the order was also place in store 1 instead of store 2.
Can anyone please help me with this ASAP?