Adding a product to the cart through the Magento API leads to 0 price

I am trying to programmatically create an order and invoice in Magento, but whenever I add products to my shopping cart, the price of each product is 0, which results in a NULL amount.

I also tried the moveToCustomerQuote method, but this generates a Magento Fault error that does not indicate that the customer quote (shopping cart identifier) ​​does not exist.

Here is my code

$cart           = $magi->execute("cart.create");
$add_customer   = $magi->execute("cart_customer.set",array($cart,$customer));

$products   = array(array(
                "product_id"    => 167,
                "qty"           => 50
              ));

$add_product    = $magi->execute("cart_product.add",array($cart,$products));

Is there something that I am doing wrong, or is there another step I must take to get the product to display the price correctly?

+3
source share
1 answer

This is a recurring question.

I had the same problem. Found the answer here.

Magento Cart API does not show prices

+2
source

All Articles