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.


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.

| improve this answer | |
  • Sir with ajax i did but after that I am not able to retrieve the list of products using Mage. – Harsimran Singh Jun 19 '13 at 7:56

The API would work well for this.

Supports SOAP and REST.


| improve this answer | |
  • 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? – Fabian Blechschmidt May 31 '13 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. – Ryan Street May 31 '13 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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