1

I am fetching all the products information outside of the magento installation so I am using soap api. I am unable to fetch cart url on which after clicking on, it will be redirected to my magento installation and it will be added to cart for the user

How do I get the Cart url using magento API. I have tried the url which is dynamic.. however it is redirecting me blank cart. It is showing "Shopping Cart is Empty"

http://example.com/checkout/cart/add/product_id/56/qty/1

I have checked on magento installation it uses the button onclick event

<button onclick="setLocation('http://example.com/checkout/cart/add/uenc/aHR0cDovL2VzaG9wbnNlbGwuY29tL2VzaG9wbnNlbGwuaHRtbD9TSUQ9ZTYyMTJhMzFjY2NmYTU1NzAwMGIxYjNkYTAwODY2Y2I,/product/56/?SID=e6212a31cccfa557000b1b3da00866cb')" class="button btn-cart" title="Add to Cart" type="button"><span><span>Add to Cart</span></span></button>

how this is passing the url

'http://example.com/checkout/cart/add/uenc/aHR0cDovL2VzaG9wbnNlbGwuY29tL2VzaG9wbnNlbGwuaHRtbD9TSUQ9ZTYyMTJhMzFjY2NmYTU1NzAwMGIxYjNkYTAwODY2Y2I,/product/56/?SID=e6212a31cccfa557000b1b3da00866cb'

Thanks :)

  • helllooo ... is there anyone :( – MagentoBoy Oct 20 '13 at 8:11
  • waiting for someone to reply... – MagentoBoy Oct 21 '13 at 4:54
1

The link you're describing is created using the users local session. As far as I know it's impossible to access this through the SOAP API.

Instead use the Checkout SOAP API to add a product to cart. Documentation on that can be found here.

This does mean however that you will need to place some of your own code in between that shows the user an add to cart button and calls the API when the users clicks it

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.