Hallo,
ich versuche per API eine Bestellung zu erzeugen, bekomme allerdings als Fehlermeldung immer “details.statusId” zurück. Im Shopware5 Log steht folgendes:
Shopware\Components\Api\Exception\NotFoundException: details.statusId in /engine/Shopware/Components/Api/Resource/Order.php:486 Stack trace:
#0 /engine/Shopware/Components/Api/Resource/Order.php(308): Shopware\Components\Api\Resource\Order->prepareCreateOrderDetailsData(Array)
#1 /engine/Shopware/Components/Api/Resource/Order.php(192): Shopware\Components\Api\Resource\Order->prepareCreateOrderData(Array)
#2 /engine/Shopware/Controllers/Api/Orders.php(82): Shopware\Components\Api\Resource\Order->create(Array)
#3 /engine/Library/Enlight/Controller/Action.php(159): Shopware_Controllers_Api_Orders->postAction()
#4 /engine/Library/Enlight/Controller/Dispatcher/Default.php(523): Enlight_Controller_Action->dispatch('postAction')
#5 /engine/Library/Enlight/Controller/Front.php(223): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp))
#6 /engine/Shopware/Kernel.php(182): Enlight_Controller_Front->dispatch()
#7 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(491): Shopware\Kernel->handle(Object(Enlight_Controller_Request_RequestHttp), 1, true)
#8 /engine/Shopware/Components/HttpCache/AppCache.php(266): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL)
#9 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(258): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true)
#10 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(275): Symfony\Component\HttpKernel\HttpCache\HttpCache->pass(Object(Symfony\Component\HttpFoundation\Request), true)
#11 /engine/Shopware/Components/HttpCache/AppCache.php(141): Symfony\Component\HttpKernel\HttpCache\HttpCache->invalidate(Object(Symfony\Component\HttpFoundation\Request), true)
#12 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(206): Shopware\Components\HttpCache\AppCache->invalidate(Object(Symfony\Component\HttpFoundation\Request), true)
#13 /engine/Shopware/Components/HttpCache/AppCache.php(114): Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 /var/www/html/shopware/shopware.php(117): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request))
#15 {main}
Nun verstehe ich darunter, das der Wert “statusId” in meinem Array der Artikel fehlt. Dieser ist aber gesetzt.
$order_products[] = array(
'articleId' => $product->field_interne_produkt_id[LANGUAGE_NONE][0]['value'],
'taxId' => ($product->commerce_price[LANGUAGE_NONE][0]['data']['include_tax'] == 'mwst_19') ? 1 : 4,
'taxRate' => ($product->commerce_price[LANGUAGE_NONE][0]['data']['include_tax'] == 'mwst_19') ? 19 : 7,
'articleNumber' => $product->sku,
'price' => $product->commerce_price[LANGUAGE_NONE][0]['amount'] / 100,
'quantity' => number_format($line_item->quantity, 0),
'articleName' => $product->title,
'shipped' => 0,
'shippedGroup' => 0,
'mode' => 0,
'esdArticle' => 0,
'statusId' => 0,
);
Die einzelnen Produkte sind doch die Orderdetails, oder irre ich mich da ?
Wäre über eine Hilfe, bzw einen Tipp sehr dankbar, da ich langsam daran verzweifle.
Schonmal vielen dank im vorraus.
Gruß
Alfapack