0

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.

1

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

http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/catalog/adding_a_product_to_the_cart_via_querystring

/path/to/magento/checkout/cart/add?product=[id]&qty=[qty]

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. – Harsimran Singh Jun 19 '13 at 7:56
0

The API would work well for this.

Supports SOAP and REST.

http://www.magentocommerce.com/api/soap/introduction.html

  • 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.