59 $orderImport = $this->getEntityByTypeId(static::getParentEntityTypeId(), $items);
62 $orderFields = $orderImport->getFieldValues();
63 foreach ($items as $item)
67 $shipmentFields = $item->getFieldValues();
68 $orderFields[
'STORIES'][] = $shipmentFields[
'STORIES'];
71 $orderImport->setFields($orderFields);
75 foreach ($items as $item)
79 $shipmentFields = $item->getFieldValues();
80 $shipmentFields[
'TAXES'] = $orderFields[
'TAXES'];
81 $item->setFields($shipmentFields);
87 foreach ($items as $item)
97 $shipmentImport = $this->getEntityByTypeId(static::getShipmentEntityTypeId(), $items);
100 $shipmentFields = $shipmentImport->getFieldValues();
102 $orderFields = $orderImport->getFieldValues();
103 $orderFields[
'TRAITS'][
'DELIVERY_SERVICE'] = $shipmentFields[
'TRAITS'][
'DELIVERY_NAME'];
104 $orderFields[
'TRAITS'][
'DELIVERY_ID'] = $shipmentFields[
'TRAITS'][
'DELIVERY_ID'];
105 $orderImport->setFields($orderFields);
110 $orderFields = $orderImport->getFieldValues();
111 $paymentFields = array();
112 foreach ($items as $item)
116 $paymentFields = $item->getFieldValues();
120 if(count($paymentFields)>0)
122 $orderFields[
'TRAITS'][
'PAY_SYSTEM'] = $paymentFields[
'TRAITS'][
'PAY_SYSTEM_NAME'];
123 $orderFields[
'TRAITS'][
'PAY_SYSTEM_ID'] = $paymentFields[
'TRAITS'][
'PAY_SYSTEM_ID'];
124 $orderImport->setFields($orderFields);
128 return parent::convertEntityFields($items);