Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento API Data Type: CartCustomerEntity

Tags:

wsdl

api

magento

While trying to create a cart via the Magento API, I am having trouble adding an existing user as the owner of the cart. I am working with the documentation they provide here:

http://www.magentocommerce.com/wiki/doc/webservices-api/api/cart#cart_customer.set

I called "customer.info" using my specific customerId, then just passed the results to that cart_customer.set method, praying that was what it was asking for. It returned (from PHP)

Fatal error: Uncaught SoapFault exception: [1045] Customer's mode is unknown in ...

I looked at the example at the bottom of the above referenced page and they only had an example for a new guest user, 'mode' set to 'guest'. I was wondering if anyone knew what the other options were for that 'mode' key? Documentation on that data structure in general would be a great help.

Thanks.

like image 285
four43 Avatar asked Jan 17 '23 22:01

four43


1 Answers

Via my own comment:

Ah ha! Found buried in their forum:

$customer = array( 'entity_id' => 6, 'mode' => 'customer' ); via http://www.magentocommerce.com/boards/viewthread/232778 I guess that is all you need to pass. This isn't really a great explanation but it does solve the original problem.

Just gonna flag this one as done.

like image 81
four43 Avatar answered Jan 24 '23 19:01

four43