Add to Cart API in Magento
I need to know how can I add products into cart using API. I have a list of products with details, I am trying to call the API from outside Magento. In which Magento's core class imp开发者_Go百科lements this function??
Thanks in Advance..
magento uses MVC and by looking at the cart link you can extract the path to the module, however
Mage_Checkout_CartController::addAction()
is the method you are looking for , remember that it is depending on session
In order to add to the cart you're going to have to implement your own API. That can be difficult because as Anton mentioned, it depends on session.
There was a project out there at one time, Mammoth Web Services, by some guys in the UK, but the project has gone silent.
If you have magento id's for your products this is fairly simple
http://yoursite.com/index.php/checkout/cart/add?product=product_id&qty=qty
http://www.magentocommerce.com/download/release_notes#Release%20Notes%20-%20Magento%201.4.2.0%20%28December%208,%202010%29
included in 1.4.2.0 apparently, though not on the official API documentation yet
精彩评论