I’ve been fiddling with the Magento shopping cart API (Magento v.1.5) and found that when a cart is created (and products added) that the “is_active” value in the “sales_flat_quote” table is set to “0”. In contrast, if you use the “Add to cart” button in the store interface, the “is_active” value is set to “1”.
I did some digging and discovered that the API sets “is_active” in app/code/core/Mage/Checkout/Model/Cart/Api.php.
Here’s the relevant block of code:
public function create($store = null)
{
$storeId = $this->_getStoreId($store);
try {
/*@var $quote Mage_Sales_Model_Quote*/
$quote = Mage::getModel('sales/quote');
$quote->setStoreId($storeId)
->setIsActive(false)
->setIsMultiShipping(false)
->save();
} catch (Mage_Core_Exception $e) {
$this->_fault('create_quote_fault', $e->getMessage());
}
return (int) $quote->getId();
}
So I'm not sure what the intent is to make it false. Is there a reason for the behavior difference between the store interface and the API? Or is there something additional that must be done through the API to make the cart active?