Критическое изменение содержимого $order->items Есть решение

1

1. Наполняем свою корзину товаром с услугами

2. В приложении "Разработка" запускаем вот такой код

wa('shop', 1);
$order = new shopOrder([
	'contact_id' => ifempty(ref(wa()->getUser()->getId()), null),
	'currency'   => wa('shop')->getConfig()->getCurrency(false),
	'items'      => (new shopCart())->items(true),
	'discount'   => 'calculate',
	'tax'        => 'calculate',
], [
	'items_format'       => 'cart',
	'items_extend_round' => true,
	'return_stock' => true,
]);
$oi = $order->items;
wa_dumpc($order->items);
foreach($oi as &$item){}
unset($item);
$order->items = $oi;
wa_dumpc($order->items);

Что же мы делаем? Создаём заказ, чтобы поменять что-то в items выносим это в переменную, так как менять что-то через foreach($order->items ....) мы не можем, так как напоримся на Indirect modification of overloaded property shopOrder::$items has no effect

Так вот, кинули позиции заказа в переменную $oi сделали дамп, покрутили массив, вернули $oi в $order->items и снова делаем дамп, давайте смотреть на дампы, вроде бы ничего поменяться на должно.....


[
  [
    'type' => 'product',
    'service_id' => NULL,
    'service_variant_id' => NULL,
    '_index' => '0',
    'cart_item_id' => 1409,
    'price' => '1599',
    'quantity' => 1.0,
    'product_id' => 387,
    'sku_id' => 6029,
    'stock_id' => NULL,
    'name' => 'Юбка Marina (красный, 46)',
    'purchase_price' => '0',
    'sku_code' => 'od100400-02',
    'sku_name' => 'красный, 46',
    'sku' => [
      'id' => '6029',
      'product_id' => '387',
      'id_1c' => NULL,
      'sku' => 'od100400-02',
      'sort' => '1',
      'name' => 'красный, 46',
      'image_id' => NULL,
      'price' => '1599.0000',
      'primary_price' => '1599.0000',
      'purchase_price' => '0.0000',
      'compare_price' => '0.0000',
      'count' => NULL,
      'available' => '1',
      'status' => '1',
      'stock_base_ratio' => NULL,
      'order_count_min' => NULL,
      'order_count_step' => NULL,
      'dimension_id' => NULL,
      'file_name' => '',
      'file_size' => '0',
      'file_description' => NULL,
      'virtual' => '1',
      'scanbarcode_barcode' => NULL,
      'price_plugin_1' => '0.0000',
      'price_plugin_type_1' => '',
      'price_plugin_currency_1' => NULL,
      'price_plugin_markup_price_1' => 'price',
      'r5c_aID' => NULL,
      'p5s_aID' => NULL,
      'flexdiscount_minimal_discount_price' => '0.0000',
      'flexdiscount_minimal_discount_currency' => NULL,
      'flexdiscount_item_discount' => NULL,
      'flexdiscount_discount_currency' => NULL,
      'flexdiscount_item_affiliate' => NULL,
      'flexdiscount_affiliate_currency' => NULL,
      'complex_plugin_price_3' => '0.0000',
      'complex_plugin_type_3' => '',
      'complex_plugin_from_3' => '0',
      'complex_plugin_price_4' => '0.0000',
      'complex_plugin_type_4' => '',
      'complex_plugin_from_4' => '0',
      'unconverted_currency' => 'RUB',
      'currency' => 'RUB',
      'frontend_price' => '1599.0000',
      'unconverted_price' => '1599.0000',
      'frontend_compare_price' => '0.0000',
      'unconverted_compare_price' => '0.0000',
    ],
    'product' => [
      'id' => '387',
      'id_1c' => NULL,
      'name' => 'Юбка Marina',
      'summary' => '',
      'meta_title' => '',
      'meta_keywords' => '',
      'meta_description' => '',
      'description' => '<p>Эта модель юбки создаст для вас нежный и женственный образ. Юбка выполнена из высококачественного материала приятной расцветки. Отличный вариант для повседневного использования.</p>',
      'contact_id' => '1',
      'create_datetime' => '2019-04-11 15:03:23',
      'edit_datetime' => '2019-12-06 14:46:56',
      'status' => '1',
      'type_id' => '15',
      'image_id' => '255',
      'image_filename' => '',
      'video_url' => NULL,
      'sku_id' => '6029',
      'ext' => 'png',
      'url' => 'yubka-marina',
      'rating' => '0.00',
      'price' => '1599.0000',
      'compare_price' => '0.0000',
      'currency' => 'RUB',
      'min_price' => '1599.0000',
      'max_price' => '1599.0000',
      'tax_id' => '0',
      'count' => NULL,
      'count_denominator' => '1',
      'order_multiplicity_factor' => '1.000',
      'stock_unit_id' => '0',
      'base_unit_id' => '0',
      'stock_base_ratio' => '1.00000000',
      'order_count_min' => '1.000',
      'order_count_step' => '1.000',
      'base_price' => '1599.0000',
      'min_base_price' => '1599.0000',
      'max_base_price' => '1599.0000',
      'cross_selling' => NULL,
      'upselling' => NULL,
      'rating_count' => '0',
      'total_sales' => '35178.0000',
      'category_id' => '3',
      'badge' => '',
      'sku_type' => '1',
      'base_price_selectable' => '1599.0000',
      'compare_price_selectable' => '0.0000',
      'purchase_price_selectable' => '0.0000',
      'sku_count' => '4',
      'scanbarcode_barcode' => NULL,
      'r5c_prodID' => NULL,
      'p5s_prodID' => NULL,
      'complex_plugin_toggle_prices' => '0',
      'flexdiscount_minimal_discount_price' => '0.0000',
      'flexdiscount_minimal_discount_currency' => NULL,
      'flexdiscount_item_discount' => NULL,
      'flexdiscount_discount_currency' => NULL,
      'flexdiscount_item_affiliate' => NULL,
      'flexdiscount_affiliate_currency' => NULL,
      'url_crop_small' => '/wa-data/public/shop/products/87/03/387/images/255/255.48x48.png',
      'services' => [
        1 => [
          'id' => '1',
          'cml1c_id' => NULL,
          'name' => 'Постирать',
          'description' => NULL,
          'price' => '10.0000',
          'currency' => '%',
          'variant_id' => '1',
          'tax_id' => '0',
          'sort' => '0',
          'variants' => [
            1 => [
              'id' => '1',
              'service_id' => '1',
              'cml1c_id' => NULL,
              'name' => '',
              'price' => '10.0000',
              'primary_price' => '10.0000',
              'sort' => '0',
            ],
          ],
        ],
        2 => [
          'id' => '2',
          'cml1c_id' => NULL,
          'name' => 'Погладить',
          'description' => NULL,
          'price' => '100.0000',
          'currency' => 'RUB',
          'variant_id' => '2',
          'tax_id' => '0',
          'sort' => '0',
          'variants' => [
            2 => [
              'id' => '2',
              'service_id' => '2',
              'cml1c_id' => NULL,
              'name' => '',
              'price' => 100.0,
              'primary_price' => '100.0000',
              'sort' => '0',
              'unconverted_currency' => 'RUB',
              'currency' => 'RUB',
              'unconverted_price' => '100.0000',
              'frontend_price' => 100.0,
            ],
          ],
          'frontend_price' => '100.0000',
          'unconverted_price' => '100.0000',
          'unconverted_currency' => 'RUB',
        ],
      ],
      'unconverted_currency' => 'RUB',
      'unconverted_price' => '1599.0000',
      'frontend_price' => '1599.0000',
      'unconverted_min_price' => '1599.0000',
      'frontend_min_price' => '1599.0000',
      'unconverted_max_price' => '1599.0000',
      'frontend_max_price' => '1599.0000',
      'unconverted_compare_price' => '0.0000',
      'frontend_compare_price' => '0.0000',
    ],
    'quantity_denominator' => '1',
    'tax_id' => 0,
    'total_discount' => 0,
    'currency' => '',
    'discount_description' => NULL,
  ],
  [
    '_parent_index' => '0',
    '_index' => '0_0',
    'type' => 'service',
    'stock_id' => NULL,
    'cart_item_id' => 1412,
    'price' => '160',
    'product_id' => 387,
    'sku_id' => 6029,
    'quantity' => 1.0,
    'service_id' => 1,
    'service_variant_id' => 1,
    'purchase_price' => 0,
    'tax_id' => 0,
    'name' => 'Постирать',
    'service_variant' => [
      'id' => '1',
      'service_id' => '1',
      'cml1c_id' => NULL,
      'name' => '',
      'price' => '10.0000',
      'primary_price' => '10.0000',
      'sort' => '0',
    ],
    'service' => [
      'id' => '1',
      'cml1c_id' => NULL,
      'name' => 'Постирать',
      'description' => NULL,
      'price' => '10.0000',
      'currency' => '%',
      'variant_id' => '1',
      'tax_id' => '0',
      'sort' => '0',
    ],
    'product' => [
      'id' => '387',
      'id_1c' => NULL,
      'name' => 'Юбка Marina',
      'summary' => '',
      'meta_title' => '',
      'meta_keywords' => '',
      'meta_description' => '',
      'description' => '<p>Эта модель юбки создаст для вас нежный и женственный образ. Юбка выполнена из высококачественного материала приятной расцветки. Отличный вариант для повседневного использования.</p>',
      'contact_id' => '1',
      'create_datetime' => '2019-04-11 15:03:23',
      'edit_datetime' => '2019-12-06 14:46:56',
      'status' => '1',
      'type_id' => '15',
      'image_id' => '255',
      'image_filename' => '',
      'video_url' => NULL,
      'sku_id' => '6029',
      'ext' => 'png',
      'url' => 'yubka-marina',
      'rating' => '0.00',
      'price' => '1599.0000',
      'compare_price' => '0.0000',
      'currency' => 'RUB',
      'min_price' => '1599.0000',
      'max_price' => '1599.0000',
      'tax_id' => '0',
      'count' => NULL,
      'count_denominator' => '1',
      'order_multiplicity_factor' => '1.000',
      'stock_unit_id' => '0',
      'base_unit_id' => '0',
      'stock_base_ratio' => '1.00000000',
      'order_count_min' => '1.000',
      'order_count_step' => '1.000',
      'base_price' => '1599.0000',
      'min_base_price' => '1599.0000',
      'max_base_price' => '1599.0000',
      'cross_selling' => NULL,
      'upselling' => NULL,
      'rating_count' => '0',
      'total_sales' => '35178.0000',
      'category_id' => '3',
      'badge' => '',
      'sku_type' => '1',
      'base_price_selectable' => '1599.0000',
      'compare_price_selectable' => '0.0000',
      'purchase_price_selectable' => '0.0000',
      'sku_count' => '4',
      'scanbarcode_barcode' => NULL,
      'r5c_prodID' => NULL,
      'p5s_prodID' => NULL,
      'complex_plugin_toggle_prices' => '0',
      'flexdiscount_minimal_discount_price' => '0.0000',
      'flexdiscount_minimal_discount_currency' => NULL,
      'flexdiscount_item_discount' => NULL,
      'flexdiscount_discount_currency' => NULL,
      'flexdiscount_item_affiliate' => NULL,
      'flexdiscount_affiliate_currency' => NULL,
      'skus' => [
        6029 => [
          'id' => '6029',
          'product_id' => '387',
          'id_1c' => NULL,
          'sku' => 'od100400-02',
          'sort' => '1',
          'name' => 'красный, 46',
          'image_id' => NULL,
          'price' => '1599.0000',
          'primary_price' => '1599.0000',
          'purchase_price' => '0.0000',
          'compare_price' => '0.0000',
          'count' => NULL,
          'available' => '1',
          'status' => '1',
          'stock_base_ratio' => NULL,
          'order_count_min' => NULL,
          'order_count_step' => NULL,
          'dimension_id' => NULL,
          'file_name' => '',
          'file_size' => '0',
          'file_description' => NULL,
          'virtual' => '1',
          'scanbarcode_barcode' => NULL,
          'price_plugin_1' => '0.0000',
          'price_plugin_type_1' => '',
          'price_plugin_currency_1' => NULL,
          'price_plugin_markup_price_1' => 'price',
          'r5c_aID' => NULL,
          'p5s_aID' => NULL,
          'flexdiscount_minimal_discount_price' => '0.0000',
          'flexdiscount_minimal_discount_currency' => NULL,
          'flexdiscount_item_discount' => NULL,
          'flexdiscount_discount_currency' => NULL,
          'flexdiscount_item_affiliate' => NULL,
          'flexdiscount_affiliate_currency' => NULL,
          'complex_plugin_price_3' => '0.0000',
          'complex_plugin_type_3' => '',
          'complex_plugin_from_3' => '0',
          'complex_plugin_price_4' => '0.0000',
          'complex_plugin_type_4' => '',
          'complex_plugin_from_4' => '0',
          'unconverted_currency' => 'RUB',
          'currency' => 'RUB',
          'frontend_price' => '1599.0000',
          'unconverted_price' => '1599.0000',
          'frontend_compare_price' => '0.0000',
          'unconverted_compare_price' => '0.0000',
        ],
      ],
      'url_crop_small' => '/wa-data/public/shop/products/87/03/387/images/255/255.48x48.png',
      'unconverted_currency' => 'RUB',
      'unconverted_price' => '1599.0000',
      'frontend_price' => '1599.0000',
      'unconverted_min_price' => '1599.0000',
      'frontend_min_price' => '1599.0000',
      'unconverted_max_price' => '1599.0000',
      'frontend_max_price' => '1599.0000',
      'unconverted_compare_price' => '0.0000',
      'frontend_compare_price' => '0.0000',
    ],
    'parent_item' => [
      'type' => 'product',
      'service_id' => NULL,
      'service_variant_id' => NULL,
      '_index' => '0',
      'cart_item_id' => 1409,
      'price' => 1599.0,
      'quantity' => 1.0,
      'product_id' => 387,
      'sku_id' => 6029,
      'stock_id' => NULL,
      'name' => 'Юбка Marina (красный, 46)',
      'purchase_price' => '0.0000',
      'sku_code' => 'od100400-02',
      'sku_name' => 'красный, 46',
      'quantity_denominator' => '1',
      'tax_id' => 0,
    ],
    'total_discount' => 0,
    'currency' => '',
    'discount_description' => NULL,
  ],
  [
    '_parent_index' => '0',
    '_index' => '0_1',
    'type' => 'service',
    'stock_id' => NULL,
    'cart_item_id' => 1413,
    'price' => '100',
    'product_id' => 387,
    'sku_id' => 6029,
    'quantity' => 1.0,
    'service_id' => 2,
    'service_variant_id' => 2,
    'purchase_price' => 0,
    'tax_id' => 0,
    'name' => 'Погладить',
    'service_variant' => [
      'id' => '2',
      'service_id' => '2',
      'cml1c_id' => NULL,
      'name' => '',
      'price' => 100.0,
      'primary_price' => '100.0000',
      'sort' => '0',
      'unconverted_currency' => 'RUB',
      'currency' => 'RUB',
      'unconverted_price' => '100.0000',
      'frontend_price' => 100.0,
    ],
    'service' => [
      'id' => '2',
      'cml1c_id' => NULL,
      'name' => 'Погладить',
      'description' => NULL,
      'price' => '100.0000',
      'currency' => 'RUB',
      'variant_id' => '2',
      'tax_id' => '0',
      'sort' => '0',
      'frontend_price' => '100.0000',
      'unconverted_price' => '100.0000',
      'unconverted_currency' => 'RUB',
    ],
    'product' => [
      'id' => '387',
      'id_1c' => NULL,
      'name' => 'Юбка Marina',
      'summary' => '',
      'meta_title' => '',
      'meta_keywords' => '',
      'meta_description' => '',
      'description' => '<p>Эта модель юбки создаст для вас нежный и женственный образ. Юбка выполнена из высококачественного материала приятной расцветки. Отличный вариант для повседневного использования.</p>',
      'contact_id' => '1',
      'create_datetime' => '2019-04-11 15:03:23',
      'edit_datetime' => '2019-12-06 14:46:56',
      'status' => '1',
      'type_id' => '15',
      'image_id' => '255',
      'image_filename' => '',
      'video_url' => NULL,
      'sku_id' => '6029',
      'ext' => 'png',
      'url' => 'yubka-marina',
      'rating' => '0.00',
      'price' => '1599.0000',
      'compare_price' => '0.0000',
      'currency' => 'RUB',
      'min_price' => '1599.0000',
      'max_price' => '1599.0000',
      'tax_id' => '0',
      'count' => NULL,
      'count_denominator' => '1',
      'order_multiplicity_factor' => '1.000',
      'stock_unit_id' => '0',
      'base_unit_id' => '0',
      'stock_base_ratio' => '1.00000000',
      'order_count_min' => '1.000',
      'order_count_step' => '1.000',
      'base_price' => '1599.0000',
      'min_base_price' => '1599.0000',
      'max_base_price' => '1599.0000',
      'cross_selling' => NULL,
      'upselling' => NULL,
      'rating_count' => '0',
      'total_sales' => '35178.0000',
      'category_id' => '3',
      'badge' => '',
      'sku_type' => '1',
      'base_price_selectable' => '1599.0000',
      'compare_price_selectable' => '0.0000',
      'purchase_price_selectable' => '0.0000',
      'sku_count' => '4',
      'scanbarcode_barcode' => NULL,
      'r5c_prodID' => NULL,
      'p5s_prodID' => NULL,
      'complex_plugin_toggle_prices' => '0',
      'flexdiscount_minimal_discount_price' => '0.0000',
      'flexdiscount_minimal_discount_currency' => NULL,
      'flexdiscount_item_discount' => NULL,
      'flexdiscount_discount_currency' => NULL,
      'flexdiscount_item_affiliate' => NULL,
      'flexdiscount_affiliate_currency' => NULL,
      'skus' => [
        6029 => [
          'id' => '6029',
          'product_id' => '387',
          'id_1c' => NULL,
          'sku' => 'od100400-02',
          'sort' => '1',
          'name' => 'красный, 46',
          'image_id' => NULL,
          'price' => '1599.0000',
          'primary_price' => '1599.0000',
          'purchase_price' => '0.0000',
          'compare_price' => '0.0000',
          'count' => NULL,
          'available' => '1',
          'status' => '1',
          'stock_base_ratio' => NULL,
          'order_count_min' => NULL,
          'order_count_step' => NULL,
          'dimension_id' => NULL,
          'file_name' => '',
          'file_size' => '0',
          'file_description' => NULL,
          'virtual' => '1',
          'scanbarcode_barcode' => NULL,
          'price_plugin_1' => '0.0000',
          'price_plugin_type_1' => '',
          'price_plugin_currency_1' => NULL,
          'price_plugin_markup_price_1' => 'price',
          'r5c_aID' => NULL,
          'p5s_aID' => NULL,
          'flexdiscount_minimal_discount_price' => '0.0000',
          'flexdiscount_minimal_discount_currency' => NULL,
          'flexdiscount_item_discount' => NULL,
          'flexdiscount_discount_currency' => NULL,
          'flexdiscount_item_affiliate' => NULL,
          'flexdiscount_affiliate_currency' => NULL,
          'complex_plugin_price_3' => '0.0000',
          'complex_plugin_type_3' => '',
          'complex_plugin_from_3' => '0',
          'complex_plugin_price_4' => '0.0000',
          'complex_plugin_type_4' => '',
          'complex_plugin_from_4' => '0',
          'unconverted_currency' => 'RUB',
          'currency' => 'RUB',
          'frontend_price' => '1599.0000',
          'unconverted_price' => '1599.0000',
          'frontend_compare_price' => '0.0000',
          'unconverted_compare_price' => '0.0000',
        ],
      ],
      'url_crop_small' => '/wa-data/public/shop/products/87/03/387/images/255/255.48x48.png',
      'unconverted_currency' => 'RUB',
      'unconverted_price' => '1599.0000',
      'frontend_price' => '1599.0000',
      'unconverted_min_price' => '1599.0000',
      'frontend_min_price' => '1599.0000',
      'unconverted_max_price' => '1599.0000',
      'frontend_max_price' => '1599.0000',
      'unconverted_compare_price' => '0.0000',
      'frontend_compare_price' => '0.0000',
    ],
    'parent_item' => [
      'type' => 'product',
      'service_id' => NULL,
      'service_variant_id' => NULL,
      '_index' => '0',
      'cart_item_id' => 1409,
      'price' => 1599.0,
      'quantity' => 1.0,
      'product_id' => 387,
      'sku_id' => 6029,
      'stock_id' => NULL,
      'name' => 'Юбка Marina (красный, 46)',
      'purchase_price' => '0.0000',
      'sku_code' => 'od100400-02',
      'sku_name' => 'красный, 46',
      'quantity_denominator' => '1',
      'tax_id' => 0,
    ],
    'total_discount' => 0,
    'currency' => '',
    'discount_description' => NULL,
  ],
]

Смотрим на type, _index, _parent_index, cart_item_id

product 0 нет 1409
service 0_0 0 1412
service 0_1 0 1413

 Второй дамп


[
  [
    'type' => 'product',
    'service_id' => NULL,
    'service_variant_id' => NULL,
    '_index' => '0',
    'price' => '1599',
    'quantity' => 1.0,
    'product_id' => 387,
    'sku_id' => 6029,
    'stock_id' => NULL,
    'name' => 'Юбка Marina (красный, 46)',
    'purchase_price' => '0',
    'sku_code' => 'od100400-02',
    'sku_name' => 'красный, 46',
    'sku' => [
      'id' => '6029',
      'product_id' => '387',
      'id_1c' => NULL,
      'sku' => 'od100400-02',
      'sort' => '1',
      'name' => 'красный, 46',
      'image_id' => NULL,
      'price' => '1599.0000',
      'primary_price' => '1599.0000',
      'purchase_price' => '0.0000',
      'compare_price' => '0.0000',
      'count' => NULL,
      'available' => '1',
      'status' => '1',
      'stock_base_ratio' => NULL,
      'order_count_min' => NULL,
      'order_count_step' => NULL,
      'dimension_id' => NULL,
      'file_name' => '',
      'file_size' => '0',
      'file_description' => NULL,
      'virtual' => '1',
      'scanbarcode_barcode' => NULL,
      'price_plugin_1' => '0.0000',
      'price_plugin_type_1' => '',
      'price_plugin_currency_1' => NULL,
      'price_plugin_markup_price_1' => 'price',
      'r5c_aID' => NULL,
      'p5s_aID' => NULL,
      'flexdiscount_minimal_discount_price' => '0.0000',
      'flexdiscount_minimal_discount_currency' => NULL,
      'flexdiscount_item_discount' => NULL,
      'flexdiscount_discount_currency' => NULL,
      'flexdiscount_item_affiliate' => NULL,
      'flexdiscount_affiliate_currency' => NULL,
      'complex_plugin_price_3' => '0.0000',
      'complex_plugin_type_3' => '',
      'complex_plugin_from_3' => '0',
      'complex_plugin_price_4' => '0.0000',
      'complex_plugin_type_4' => '',
      'complex_plugin_from_4' => '0',
      'unconverted_currency' => 'RUB',
      'currency' => 'RUB',
      'frontend_price' => '1599.0000',
      'unconverted_price' => '1599.0000',
      'frontend_compare_price' => '0.0000',
      'unconverted_compare_price' => '0.0000',
    ],
    'product' => [
      'id' => '387',
      'id_1c' => NULL,
      'name' => 'Юбка Marina',
      'summary' => '',
      'meta_title' => '',
      'meta_keywords' => '',
      'meta_description' => '',
      'description' => '<p>Эта модель юбки создаст для вас нежный и женственный образ. Юбка выполнена из высококачественного материала приятной расцветки. Отличный вариант для повседневного использования.</p>',
      'contact_id' => '1',
      'create_datetime' => '2019-04-11 15:03:23',
      'edit_datetime' => '2019-12-06 14:46:56',
      'status' => '1',
      'type_id' => '15',
      'image_id' => '255',
      'image_filename' => '',
      'video_url' => NULL,
      'sku_id' => '6029',
      'ext' => 'png',
      'url' => 'yubka-marina',
      'rating' => '0.00',
      'price' => '1599.0000',
      'compare_price' => '0.0000',
      'currency' => 'RUB',
      'min_price' => '1599.0000',
      'max_price' => '1599.0000',
      'tax_id' => '0',
      'count' => NULL,
      'count_denominator' => '1',
      'order_multiplicity_factor' => '1.000',
      'stock_unit_id' => '0',
      'base_unit_id' => '0',
      'stock_base_ratio' => '1.00000000',
      'order_count_min' => '1.000',
      'order_count_step' => '1.000',
      'base_price' => '1599.0000',
      'min_base_price' => '1599.0000',
      'max_base_price' => '1599.0000',
      'cross_selling' => NULL,
      'upselling' => NULL,
      'rating_count' => '0',
      'total_sales' => '35178.0000',
      'category_id' => '3',
      'badge' => '',
      'sku_type' => '1',
      'base_price_selectable' => '1599.0000',
      'compare_price_selectable' => '0.0000',
      'purchase_price_selectable' => '0.0000',
      'sku_count' => '4',
      'scanbarcode_barcode' => NULL,
      'r5c_prodID' => NULL,
      'p5s_prodID' => NULL,
      'complex_plugin_toggle_prices' => '0',
      'flexdiscount_minimal_discount_price' => '0.0000',
      'flexdiscount_minimal_discount_currency' => NULL,
      'flexdiscount_item_discount' => NULL,
      'flexdiscount_discount_currency' => NULL,
      'flexdiscount_item_affiliate' => NULL,
      'flexdiscount_affiliate_currency' => NULL,
      'url_crop_small' => '/wa-data/public/shop/products/87/03/387/images/255/255.48x48.png',
      'services' => [
        1 => [
          'id' => '1',
          'cml1c_id' => NULL,
          'name' => 'Постирать',
          'description' => NULL,
          'price' => '10.0000',
          'currency' => '%',
          'variant_id' => '1',
          'tax_id' => '0',
          'sort' => '0',
          'variants' => [
            1 => [
              'id' => '1',
              'service_id' => '1',
              'cml1c_id' => NULL,
              'name' => '',
              'price' => '10.0000',
              'primary_price' => '10.0000',
              'sort' => '0',
            ],
          ],
        ],
        2 => [
          'id' => '2',
          'cml1c_id' => NULL,
          'name' => 'Погладить',
          'description' => NULL,
          'price' => '100.0000',
          'currency' => 'RUB',
          'variant_id' => '2',
          'tax_id' => '0',
          'sort' => '0',
          'variants' => [
            2 => [
              'id' => '2',
              'service_id' => '2',
              'cml1c_id' => NULL,
              'name' => '',
              'price' => 100.0,
              'primary_price' => '100.0000',
              'sort' => '0',
              'unconverted_currency' => 'RUB',
              'currency' => 'RUB',
              'unconverted_price' => '100.0000',
              'frontend_price' => 100.0,
            ],
          ],
          'frontend_price' => '100.0000',
          'unconverted_price' => '100.0000',
          'unconverted_currency' => 'RUB',
        ],
      ],
      'unconverted_currency' => 'RUB',
      'unconverted_price' => '1599.0000',
      'frontend_price' => '1599.0000',
      'unconverted_min_price' => '1599.0000',
      'frontend_min_price' => '1599.0000',
      'unconverted_max_price' => '1599.0000',
      'frontend_max_price' => '1599.0000',
      'unconverted_compare_price' => '0.0000',
      'frontend_compare_price' => '0.0000',
    ],
    'quantity_denominator' => '1',
    'tax_id' => 0,
    'total_discount' => 0,
    'currency' => '',
  ],
  [
    'type' => 'product',
    'service_id' => NULL,
    'service_variant_id' => NULL,
    '_index' => '1',
    'price' => '160',
    'quantity' => 1.0,
    'product_id' => 387,
    'sku_id' => 6029,
    'stock_id' => NULL,
    'name' => 'Юбка Marina (красный, 46)',
    'purchase_price' => '0',
    'sku_code' => 'od100400-02',
    'sku_name' => 'красный, 46',
    'sku' => [
      'id' => '6029',
      'product_id' => '387',
      'id_1c' => NULL,
      'sku' => 'od100400-02',
      'sort' => '1',
      'name' => 'красный, 46',
      'image_id' => NULL,
      'price' => '1599.0000',
      'primary_price' => '1599.0000',
      'purchase_price' => '0.0000',
      'compare_price' => '0.0000',
      'count' => NULL,
      'available' => '1',
      'status' => '1',
      'stock_base_ratio' => NULL,
      'order_count_min' => NULL,
      'order_count_step' => NULL,
      'dimension_id' => NULL,
      'file_name' => '',
      'file_size' => '0',
      'file_description' => NULL,
      'virtual' => '1',
      'scanbarcode_barcode' => NULL,
      'price_plugin_1' => '0.0000',
      'price_plugin_type_1' => '',
      'price_plugin_currency_1' => NULL,
      'price_plugin_markup_price_1' => 'price',
      'r5c_aID' => NULL,
      'p5s_aID' => NULL,
      'flexdiscount_minimal_discount_price' => '0.0000',
      'flexdiscount_minimal_discount_currency' => NULL,
      'flexdiscount_item_discount' => NULL,
      'flexdiscount_discount_currency' => NULL,
      'flexdiscount_item_affiliate' => NULL,
      'flexdiscount_affiliate_currency' => NULL,
      'complex_plugin_price_3' => '0.0000',
      'complex_plugin_type_3' => '',
      'complex_plugin_from_3' => '0',
      'complex_plugin_price_4' => '0.0000',
      'complex_plugin_type_4' => '',
      'complex_plugin_from_4' => '0',
      'unconverted_currency' => 'RUB',
      'currency' => 'RUB',
      'frontend_price' => '1599.0000',
      'unconverted_price' => '1599.0000',
      'frontend_compare_price' => '0.0000',
      'unconverted_compare_price' => '0.0000',
    ],
    'product' => [
      'id' => '387',
      'id_1c' => NULL,
      'name' => 'Юбка Marina',
      'summary' => '',
      'meta_title' => '',
      'meta_keywords' => '',
      'meta_description' => '',
      'description' => '<p>Эта модель юбки создаст для вас нежный и женственный образ. Юбка выполнена из высококачественного материала приятной расцветки. Отличный вариант для повседневного использования.</p>',
      'contact_id' => '1',
      'create_datetime' => '2019-04-11 15:03:23',
      'edit_datetime' => '2019-12-06 14:46:56',
      'status' => '1',
      'type_id' => '15',
      'image_id' => '255',
      'image_filename' => '',
      'video_url' => NULL,
      'sku_id' => '6029',
      'ext' => 'png',
      'url' => 'yubka-marina',
      'rating' => '0.00',
      'price' => '1599.0000',
      'compare_price' => '0.0000',
      'currency' => 'RUB',
      'min_price' => '1599.0000',
      'max_price' => '1599.0000',
      'tax_id' => '0',
      'count' => NULL,
      'count_denominator' => '1',
      'order_multiplicity_factor' => '1.000',
      'stock_unit_id' => '0',
      'base_unit_id' => '0',
      'stock_base_ratio' => '1.00000000',
      'order_count_min' => '1.000',
      'order_count_step' => '1.000',
      'base_price' => '1599.0000',
      'min_base_price' => '1599.0000',
      'max_base_price' => '1599.0000',
      'cross_selling' => NULL,
      'upselling' => NULL,
      'rating_count' => '0',
      'total_sales' => '35178.0000',
      'category_id' => '3',
      'badge' => '',
      'sku_type' => '1',
      'base_price_selectable' => '1599.0000',
      'compare_price_selectable' => '0.0000',
      'purchase_price_selectable' => '0.0000',
      'sku_count' => '4',
      'scanbarcode_barcode' => NULL,
      'r5c_prodID' => NULL,
      'p5s_prodID' => NULL,
      'complex_plugin_toggle_prices' => '0',
      'flexdiscount_minimal_discount_price' => '0.0000',
      'flexdiscount_minimal_discount_currency' => NULL,
      'flexdiscount_item_discount' => NULL,
      'flexdiscount_discount_currency' => NULL,
      'flexdiscount_item_affiliate' => NULL,
      'flexdiscount_affiliate_currency' => NULL,
      'url_crop_small' => '/wa-data/public/shop/products/87/03/387/images/255/255.48x48.png',
      'services' => [
        1 => [
          'id' => '1',
          'cml1c_id' => NULL,
          'name' => 'Постирать',
          'description' => NULL,
          'price' => '10.0000',
          'currency' => '%',
          'variant_id' => '1',
          'tax_id' => '0',
          'sort' => '0',
          'variants' => [
            1 => [
              'id' => '1',
              'service_id' => '1',
              'cml1c_id' => NULL,
              'name' => '',
              'price' => '10.0000',
              'primary_price' => '10.0000',
              'sort' => '0',
            ],
          ],
        ],
        2 => [
          'id' => '2',
          'cml1c_id' => NULL,
          'name' => 'Погладить',
          'description' => NULL,
          'price' => '100.0000',
          'currency' => 'RUB',
          'variant_id' => '2',
          'tax_id' => '0',
          'sort' => '0',
          'variants' => [
            2 => [
              'id' => '2',
              'service_id' => '2',
              'cml1c_id' => NULL,
              'name' => '',
              'price' => 100.0,
              'primary_price' => '100.0000',
              'sort' => '0',
              'unconverted_currency' => 'RUB',
              'currency' => 'RUB',
              'unconverted_price' => '100.0000',
              'frontend_price' => 100.0,
            ],
          ],
          'frontend_price' => '100.0000',
          'unconverted_price' => '100.0000',
          'unconverted_currency' => 'RUB',
        ],
      ],
      'unconverted_currency' => 'RUB',
      'unconverted_price' => '1599.0000',
      'frontend_price' => '1599.0000',
      'unconverted_min_price' => '1599.0000',
      'frontend_min_price' => '1599.0000',
      'unconverted_max_price' => '1599.0000',
      'frontend_max_price' => '1599.0000',
      'unconverted_compare_price' => '0.0000',
      'frontend_compare_price' => '0.0000',
    ],
    'quantity_denominator' => '1',
    'tax_id' => 0,
    'total_discount' => 0,
    'currency' => '',
  ],
  [
    'type' => 'product',
    'service_id' => NULL,
    'service_variant_id' => NULL,
    '_index' => '2',
    'price' => '100',
    'quantity' => 1.0,
    'product_id' => 387,
    'sku_id' => 6029,
    'stock_id' => NULL,
    'name' => 'Юбка Marina (красный, 46)',
    'purchase_price' => '0',
    'sku_code' => 'od100400-02',
    'sku_name' => 'красный, 46',
    'sku' => [
      'id' => '6029',
      'product_id' => '387',
      'id_1c' => NULL,
      'sku' => 'od100400-02',
      'sort' => '1',
      'name' => 'красный, 46',
      'image_id' => NULL,
      'price' => '1599.0000',
      'primary_price' => '1599.0000',
      'purchase_price' => '0.0000',
      'compare_price' => '0.0000',
      'count' => NULL,
      'available' => '1',
      'status' => '1',
      'stock_base_ratio' => NULL,
      'order_count_min' => NULL,
      'order_count_step' => NULL,
      'dimension_id' => NULL,
      'file_name' => '',
      'file_size' => '0',
      'file_description' => NULL,
      'virtual' => '1',
      'scanbarcode_barcode' => NULL,
      'price_plugin_1' => '0.0000',
      'price_plugin_type_1' => '',
      'price_plugin_currency_1' => NULL,
      'price_plugin_markup_price_1' => 'price',
      'r5c_aID' => NULL,
      'p5s_aID' => NULL,
      'flexdiscount_minimal_discount_price' => '0.0000',
      'flexdiscount_minimal_discount_currency' => NULL,
      'flexdiscount_item_discount' => NULL,
      'flexdiscount_discount_currency' => NULL,
      'flexdiscount_item_affiliate' => NULL,
      'flexdiscount_affiliate_currency' => NULL,
      'complex_plugin_price_3' => '0.0000',
      'complex_plugin_type_3' => '',
      'complex_plugin_from_3' => '0',
      'complex_plugin_price_4' => '0.0000',
      'complex_plugin_type_4' => '',
      'complex_plugin_from_4' => '0',
      'unconverted_currency' => 'RUB',
      'currency' => 'RUB',
      'frontend_price' => '1599.0000',
      'unconverted_price' => '1599.0000',
      'frontend_compare_price' => '0.0000',
      'unconverted_compare_price' => '0.0000',
    ],
    'product' => [
      'id' => '387',
      'id_1c' => NULL,
      'name' => 'Юбка Marina',
      'summary' => '',
      'meta_title' => '',
      'meta_keywords' => '',
      'meta_description' => '',
      'description' => '<p>Эта модель юбки создаст для вас нежный и женственный образ. Юбка выполнена из высококачественного материала приятной расцветки. Отличный вариант для повседневного использования.</p>',
      'contact_id' => '1',
      'create_datetime' => '2019-04-11 15:03:23',
      'edit_datetime' => '2019-12-06 14:46:56',
      'status' => '1',
      'type_id' => '15',
      'image_id' => '255',
      'image_filename' => '',
      'video_url' => NULL,
      'sku_id' => '6029',
      'ext' => 'png',
      'url' => 'yubka-marina',
      'rating' => '0.00',
      'price' => '1599.0000',
      'compare_price' => '0.0000',
      'currency' => 'RUB',
      'min_price' => '1599.0000',
      'max_price' => '1599.0000',
      'tax_id' => '0',
      'count' => NULL,
      'count_denominator' => '1',
      'order_multiplicity_factor' => '1.000',
      'stock_unit_id' => '0',
      'base_unit_id' => '0',
      'stock_base_ratio' => '1.00000000',
      'order_count_min' => '1.000',
      'order_count_step' => '1.000',
      'base_price' => '1599.0000',
      'min_base_price' => '1599.0000',
      'max_base_price' => '1599.0000',
      'cross_selling' => NULL,
      'upselling' => NULL,
      'rating_count' => '0',
      'total_sales' => '35178.0000',
      'category_id' => '3',
      'badge' => '',
      'sku_type' => '1',
      'base_price_selectable' => '1599.0000',
      'compare_price_selectable' => '0.0000',
      'purchase_price_selectable' => '0.0000',
      'sku_count' => '4',
      'scanbarcode_barcode' => NULL,
      'r5c_prodID' => NULL,
      'p5s_prodID' => NULL,
      'complex_plugin_toggle_prices' => '0',
      'flexdiscount_minimal_discount_price' => '0.0000',
      'flexdiscount_minimal_discount_currency' => NULL,
      'flexdiscount_item_discount' => NULL,
      'flexdiscount_discount_currency' => NULL,
      'flexdiscount_item_affiliate' => NULL,
      'flexdiscount_affiliate_currency' => NULL,
      'url_crop_small' => '/wa-data/public/shop/products/87/03/387/images/255/255.48x48.png',
      'services' => [
        1 => [
          'id' => '1',
          'cml1c_id' => NULL,
          'name' => 'Постирать',
          'description' => NULL,
          'price' => '10.0000',
          'currency' => '%',
          'variant_id' => '1',
          'tax_id' => '0',
          'sort' => '0',
          'variants' => [
            1 => [
              'id' => '1',
              'service_id' => '1',
              'cml1c_id' => NULL,
              'name' => '',
              'price' => '10.0000',
              'primary_price' => '10.0000',
              'sort' => '0',
            ],
          ],
        ],
        2 => [
          'id' => '2',
          'cml1c_id' => NULL,
          'name' => 'Погладить',
          'description' => NULL,
          'price' => '100.0000',
          'currency' => 'RUB',
          'variant_id' => '2',
          'tax_id' => '0',
          'sort' => '0',
          'variants' => [
            2 => [
              'id' => '2',
              'service_id' => '2',
              'cml1c_id' => NULL,
              'name' => '',
              'price' => 100.0,
              'primary_price' => '100.0000',
              'sort' => '0',
              'unconverted_currency' => 'RUB',
              'currency' => 'RUB',
              'unconverted_price' => '100.0000',
              'frontend_price' => 100.0,
            ],
          ],
          'frontend_price' => '100.0000',
          'unconverted_price' => '100.0000',
          'unconverted_currency' => 'RUB',
        ],
      ],
      'unconverted_currency' => 'RUB',
      'unconverted_price' => '1599.0000',
      'frontend_price' => '1599.0000',
      'unconverted_min_price' => '1599.0000',
      'frontend_min_price' => '1599.0000',
      'unconverted_max_price' => '1599.0000',
      'frontend_max_price' => '1599.0000',
      'unconverted_compare_price' => '0.0000',
      'frontend_compare_price' => '0.0000',
    ],
    'quantity_denominator' => '1',
    'tax_id' => 0,
    'total_discount' => 0,
    'currency' => '',
  ],
]

Смотрим на type, _index, _parent_index, cart_item_id

product 0 нет нет
product 1 нет нет
product 2 нет нет

6 комментариев

  • +1

    В итоге заказ из 1 товара и 2 услуг превратился в 3 товара.

    • +1

      Чуть доработаем код, чтобы посмотреть на различия массивов 

      wa('shop', 1);
      $order = new shopOrder([
      	'contact_id' => ifempty(ref(wa()->getUser()->getId()), null),
      	'currency'   => wa('shop')->getConfig()->getCurrency(false),
      	'items'      => (new shopCart())->items(true),
      	'discount'   => 'calculate',
      	'tax'        => 'calculate',
      ], [
      	'items_format'       => 'cart',
      	'items_extend_round' => true,
      	'return_stock' => true,
      ]);
      $oi = $order->items;
      wa_dumpc($a = $order->items);
      foreach($oi as $item){}
      unset($item);
      $order->items = $oi;
      wa_dumpc($b = $order->items);
      $result=array_diff_assoc($a[0],$b[0]);
      wa_dumpc($result);
      $result=array_diff_assoc($b[0],$a[0]);
      wa_dumpc($result);
      $result=array_diff_assoc($a[1],$b[1]);
      wa_dumpc($result);
      $result=array_diff_assoc($b[1],$a[1]);
      wa_dumpc($result);
      $result=array_diff_assoc($a[2],$b[2]);
      wa_dumpc($result);
      $result=array_diff_assoc($b[2],$a[2]);
      wa_dumpc($result);

    • +1

      Во втором

      [
        '_parent_index' => '0',
        '_index' => '0_0',
        'type' => 'service',
        'cart_item_id' => 1412,
        'service_id' => 1,
        'service_variant_id' => 1,
        'name' => 'Постирать',
        'service_variant' => [
          'id' => '1',
          'service_id' => '1',
          'cml1c_id' => NULL,
          'name' => '',
          'price' => '10.0000',
          'primary_price' => '10.0000',
          'sort' => '0',
        ],
        'service' => [
          'id' => '1',
          'cml1c_id' => NULL,
          'name' => 'Постирать',
          'description' => NULL,
          'price' => '10.0000',
          'currency' => '%',
          'variant_id' => '1',
          'tax_id' => '0',
          'sort' => '0',
        ],
        'parent_item' => [
          'type' => 'product',
          'service_id' => NULL,
          'service_variant_id' => NULL,
          '_index' => '0',
          'cart_item_id' => 1409,
          'price' => 1599.0,
          'quantity' => 1.0,
          'product_id' => 387,
          'sku_id' => 6029,
          'stock_id' => NULL,
          'name' => 'Юбка Marina (красный, 46)',
          'purchase_price' => '0.0000',
          'sku_code' => 'od100400-02',
          'sku_name' => 'красный, 46',
          'quantity_denominator' => '1',
          'tax_id' => 0,
        ],
        'discount_description' => NULL,
      ]
      


      [
        'type' => 'product',
        'service_id' => NULL,
        'service_variant_id' => NULL,
        '_index' => '1',
        'name' => 'Юбка Marina (красный, 46)',
        'sku_code' => 'od100400-02',
        'sku_name' => 'красный, 46',
        'sku' => [
          'id' => '6029',
          'product_id' => '387',
          'id_1c' => NULL,
          'sku' => 'od100400-02',
          'sort' => '1',
          'name' => 'красный, 46',
          'image_id' => NULL,
          'price' => '1599.0000',
          'primary_price' => '1599.0000',
          'purchase_price' => '0.0000',
          'compare_price' => '0.0000',
          'count' => NULL,
          'available' => '1',
          'status' => '1',
          'stock_base_ratio' => NULL,
          'order_count_min' => NULL,
          'order_count_step' => NULL,
          'dimension_id' => NULL,
          'file_name' => '',
          'file_size' => '0',
          'file_description' => NULL,
          'virtual' => '1',
          'scanbarcode_barcode' => NULL,
          'price_plugin_1' => '0.0000',
          'price_plugin_type_1' => '',
          'price_plugin_currency_1' => NULL,
          'price_plugin_markup_price_1' => 'price',
          'r5c_aID' => NULL,
          'p5s_aID' => NULL,
          'flexdiscount_minimal_discount_price' => '0.0000',
          'flexdiscount_minimal_discount_currency' => NULL,
          'flexdiscount_item_discount' => NULL,
          'flexdiscount_discount_currency' => NULL,
          'flexdiscount_item_affiliate' => NULL,
          'flexdiscount_affiliate_currency' => NULL,
          'complex_plugin_price_3' => '0.0000',
          'complex_plugin_type_3' => '',
          'complex_plugin_from_3' => '0',
          'complex_plugin_price_4' => '0.0000',
          'complex_plugin_type_4' => '',
          'complex_plugin_from_4' => '0',
          'unconverted_currency' => 'RUB',
          'currency' => 'RUB',
          'frontend_price' => '1599.0000',
          'unconverted_price' => '1599.0000',
          'frontend_compare_price' => '0.0000',
          'unconverted_compare_price' => '0.0000',
        ],
        'quantity_denominator' => '1',
      ]
      

      • +1

        В третьем 



        [
          '_parent_index' => '0',
          '_index' => '0_1',
          'type' => 'service',
          'cart_item_id' => 1413,
          'service_id' => 2,
          'service_variant_id' => 2,
          'name' => 'Погладить',
          'service_variant' => [
            'id' => '2',
            'service_id' => '2',
            'cml1c_id' => NULL,
            'name' => '',
            'price' => 100.0,
            'primary_price' => '100.0000',
            'sort' => '0',
            'unconverted_currency' => 'RUB',
            'currency' => 'RUB',
            'unconverted_price' => '100.0000',
            'frontend_price' => 100.0,
          ],
          'service' => [
            'id' => '2',
            'cml1c_id' => NULL,
            'name' => 'Погладить',
            'description' => NULL,
            'price' => '100.0000',
            'currency' => 'RUB',
            'variant_id' => '2',
            'tax_id' => '0',
            'sort' => '0',
            'frontend_price' => '100.0000',
            'unconverted_price' => '100.0000',
            'unconverted_currency' => 'RUB',
          ],
          'parent_item' => [
            'type' => 'product',
            'service_id' => NULL,
            'service_variant_id' => NULL,
            '_index' => '0',
            'cart_item_id' => 1409,
            'price' => 1599.0,
            'quantity' => 1.0,
            'product_id' => 387,
            'sku_id' => 6029,
            'stock_id' => NULL,
            'name' => 'Юбка Marina (красный, 46)',
            'purchase_price' => '0.0000',
            'sku_code' => 'od100400-02',
            'sku_name' => 'красный, 46',
            'quantity_denominator' => '1',
            'tax_id' => 0,
          ],
          'discount_description' => NULL,
        ]

        [
          'type' => 'product',
          'service_id' => NULL,
          'service_variant_id' => NULL,
          '_index' => '2',
          'name' => 'Юбка Marina (красный, 46)',
          'sku_code' => 'od100400-02',
          'sku_name' => 'красный, 46',
          'sku' => [
            'id' => '6029',
            'product_id' => '387',
            'id_1c' => NULL,
            'sku' => 'od100400-02',
            'sort' => '1',
            'name' => 'красный, 46',
            'image_id' => NULL,
            'price' => '1599.0000',
            'primary_price' => '1599.0000',
            'purchase_price' => '0.0000',
            'compare_price' => '0.0000',
            'count' => NULL,
            'available' => '1',
            'status' => '1',
            'stock_base_ratio' => NULL,
            'order_count_min' => NULL,
            'order_count_step' => NULL,
            'dimension_id' => NULL,
            'file_name' => '',
            'file_size' => '0',
            'file_description' => NULL,
            'virtual' => '1',
            'scanbarcode_barcode' => NULL,
            'price_plugin_1' => '0.0000',
            'price_plugin_type_1' => '',
            'price_plugin_currency_1' => NULL,
            'price_plugin_markup_price_1' => 'price',
            'r5c_aID' => NULL,
            'p5s_aID' => NULL,
            'flexdiscount_minimal_discount_price' => '0.0000',
            'flexdiscount_minimal_discount_currency' => NULL,
            'flexdiscount_item_discount' => NULL,
            'flexdiscount_discount_currency' => NULL,
            'flexdiscount_item_affiliate' => NULL,
            'flexdiscount_affiliate_currency' => NULL,
            'complex_plugin_price_3' => '0.0000',
            'complex_plugin_type_3' => '',
            'complex_plugin_from_3' => '0',
            'complex_plugin_price_4' => '0.0000',
            'complex_plugin_type_4' => '',
            'complex_plugin_from_4' => '0',
            'unconverted_currency' => 'RUB',
            'currency' => 'RUB',
            'frontend_price' => '1599.0000',
            'unconverted_price' => '1599.0000',
            'frontend_compare_price' => '0.0000',
            'unconverted_compare_price' => '0.0000',
          ],
          'quantity_denominator' => '1',
        ]
        

      • +1

        Видимо тему можно закрывать .... вывод сделал - нельзя $oi обратно засовывать в том виде, что получен, надо подготовить новый массив в правильном формате и его уже отправлять в $order->items. Неожиданно, 


        $oi = $order->items;
        foreach($oi as &$item){ тут создаем новый массив, например $new_cart }
        unset($item);
        $order->items = $oi;
        $order->items = $new_cart;

        Добавить комментарий

        Чтобы добавить комментарий, зарегистрируйтесь или войдите