I am getting a rather strange error when trying to create a new order via the Magento API V1.0. Here is the basic workflow of my code:
cart.create
method.cart_customer.set
method.cart_product.add
method.cart.order
method.At this point, the cart.order method throws a SoapFault exception with the message "Call to a member function setFinalPrice() on a non-object". The same exception is thrown if I replace the cart.order
method with other methods such as cart.info
or cart_product.list
.
Since the exception's message does not seem very descriptive, I was wondering if anybody else has ever bumped into this.
Thanks.
UPDATE: The problem is due to the fact that I am adding products to the cart using their SKUs when calling the cart_product.add
method. The exception is no longer thrown when using product IDs instead of SKUs (I suspect this could be a bug). However, at this point the cart.order
method returns false, so the order is still not created.
Before you do cart.order method, you must assign the payment and shipping address to your cart.
it's standard procedure to create an order in magento.
the steps should be like this :
try to call cart_shipping.method and cart_payment.method before you call cart.order
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With