How can I add products with PHP to the customer's cart. Having customer's id and login details.

The login is successful. Just need to update the cart with the products, quantity and prices that user can also check from the magento site also.

2 Answers 2


The easy way? Just fire a ajax request to the page.



Maybe you have a problem with the SameOriginPolicy with JS, so you might use an iframe or image instead.

  • Sir with ajax i did but after that I am not able to retrieve the list of products using Mage. Jun 19, 2013 at 7:56

The API would work well for this.

Supports SOAP and REST.


  • I read about this yesterday but couldn't see how I define the customer or his cart to put things into, how does this work? May 31, 2013 at 6:51
  • @FabianBlechschmidt the checkout api has cart_customer.set and cart_product.add. You can fetch customer data with the customer api and set it with the checkout api. magentocommerce.com/api/soap/checkout/checkout.html. Hope this helps. May 31, 2013 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.