Reputation: 173
Did anyone got the Add to cart API of magento working?
$mage_url = 'http://server_path/magento/api/?wsdl';
$mage_user = 'xxxxx';
$mage_api_key = 'xxxxx';
// Initialize the SOAP client $soap = new SoapClient( $mage_url );
// Login to Magento $session_id = $soap->login( $mage_user, $mage_api_key );
after this i want to do Add to cart
any suggestion..
Upvotes: 1
Views: 877
Reputation: 2321
Magento doesn't yield that functionality via the SOAP API(yet as of Dec. 2010 version 1.4.2). You would have to make your own implementation for now. Tricky thing with that would be to change it so that it creates a session object for carts created via SOAP vs. a request coming in via a user's browser with cookie and all to the checkout controller.
The only thing the API does in the current release is create a cart object. Nothing else. Well not even really. It just creates a quote object for the given store ID.
As seen in the API's implementation class here:
class Mage_Checkout_Model_Cart_Api extends Mage_Api_Model_Resource_Abstract
{
public function create($store = null){...}
}
Upvotes: 1