foreach ($marketplaceOrders as $marketplaceOrder) {
/* @var MarketplaceOrders $marketplaceOrder */
$items = Json::decode(Json::encode($marketplaceOrder->items));
- $itemsToComment = '';
+ $itemsToComment = [];
$itemsFiltered = [];
$summ = 0;
foreach ($items as $item) {
- $itemsToComment .= $item['offer_id'] . ' - ' . $item['offer_id'] . ',';
+ $itemsToComment[] = $item['offer_id'] . ' - ' . $item['offer_name'];
$product1c = Products1c::find()->where(['articule' => $item['offer_id']])->one();
if (!empty($product1c->id)) {
$itemsFiltered []= [
$itemsWithoutSkuString = '';
}
if(!empty($itemsToComment)) {
- $itemsToCommentString = '. Товары в заказе: ' . $itemsToComment;
+ $itemsToCommentString = '. Товары в заказе: ' . implode(', ',$itemsToComment);;
}
else {
- $itemsToCommentString = $itemsToComment;
+ $itemsToCommentString = '';
}
$result[] = [