diff --git a/install/components/opensource/order/class.php b/install/components/opensource/order/class.php index ebf26b4..f6c57b1 100644 --- a/install/components/opensource/order/class.php +++ b/install/components/opensource/order/class.php @@ -133,6 +133,26 @@ public function createVirtualOrder(int $personTypeId) return $this->order; } + public function getPropertiesFromRequest() + { + $properties = $this->request['properties'] ?? []; + $arFileProperties = $this->request->getFileList()->get('properties'); + + if (is_array($arFileProperties)) { + foreach ($arFileProperties as $fileKey => $arFileField) { + foreach ($arFileField as $fieldCode => $arFileFieldValue) { + if( ! isset($properties[$fieldCode])) { + $properties[$fieldCode] = array("ID" => ''); + } + // @todo Multiple property + $properties[$fieldCode][$fileKey] = current($arFileFieldValue); + } + } + } + + return $properties; + } + /** * @param array $propertyValues * @throws Exception @@ -374,7 +394,7 @@ public function executeComponent() try { $this->createVirtualOrder($this->arParams['PERSON_TYPE_ID']); - $propertiesList = $this->request['properties'] ?? $this->arParams['DEFAULT_PROPERTIES'] ?? []; + $propertiesList = $this->getPropertiesFromRequest() ?: $this->arParams['DEFAULT_PROPERTIES'] ?? []; if (!empty($propertiesList)) { $this->setOrderProperties($propertiesList); } diff --git a/install/components/opensource/order/templates/.default/form.php b/install/components/opensource/order/templates/.default/form.php index ee96e5d..ba6595b 100644 --- a/install/components/opensource/order/templates/.default/form.php +++ b/install/components/opensource/order/templates/.default/form.php @@ -19,7 +19,7 @@ /** @var OpenSourceOrderComponent $component */ ?> -
+ @@ -90,6 +90,14 @@ + +