$newOrdersArray = $this->getMarketplaceOrders();
if (!empty($newOrdersArray)) {
$mess['line'][] = __LINE__;
- $mess['create_orders'] = $newOrdersArray;
+ if(!empty($newOrdersArray['items'])) {
+ $mess['create_orders'] = $newOrdersArray;
+ } else {
+ $mess['line'][] = ' error '. __LINE__;
+ }
}
$mess['line'][] = __LINE__;
$summ = 0;
foreach ($items as $item) {
$product1c = Products1c::find()->where(['articule' => $item['offer_id']])->one();
- $itemsFiltered []= [
- 'product_id' => $product1c->id ?? '',
- 'color' => '',
- 'price' => $item['price'],
- 'quantity' => $item['count'],
- 'seller_id' => '',
- ];
+ if (!empty($product1c->id)) {
+ $itemsFiltered []= [
+ 'product_id' => $product1c->id ?? '',
+ 'color' => '',
+ 'price' => $item['price'],
+ 'quantity' => $item['count'],
+ 'seller_id' => '',
+ ];
+ }
$summ += $item['price'] * $item['count'];
}
$eit = ExportImportTable::find()->where(['entity' => 'city_store', 'export_id' => 1, 'entity_id' => $marketplaceOrder->store_id])->one();