Magento – How to add products in cart and wishlist with external code outside Magento

cartmagento-1.7magento-connectsession

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.

Best Answer

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.