A
A
ayapergenov2015-10-12 13:48:33
1C-Bitrix
ayapergenov, 2015-10-12 13:48:33

How to transfer an additional user profile field to the buyer profile in the Business version on Bitrix?

From everything that will be described, I need to implement only a call to one method. At what I apply codes of a call of methods.
I describe in detail to understand the overall picture and features of our online store.
In the USER profile, an additional a field with multiple choice, so that the buyer can choose from among his consignees (Outlets) the one to which the ordered cargo will be delivered.
0a7b9d9a6c2c4d2ebfb2ea814e6a5ae5.png
In the properties of the order, the property "Consignee" with the code UF_TT_ADRESS was created, which is transmitted in the exchange profile with 1C.
4ae894123e6147408288fe6b60f72246.png
It is necessary that the value of this field be transferred to the field of the BUYER profile.
At the moment, only the field without the required values ​​of the authorized user is displayed.
8edbd044ef7c412992ce1b55687531a5.png
So far, I have made some progress towards solving this problem.
There is a script that displays an array of all consignees

<?
  global $USER;
  $arFilter = array("ID" => $USER->GetID());
  $arParams["SELECT"] = array("UF_TT_ADRESS");
  $arRes = CUser::GetList($by,$desc,$arFilter,$arParams);
      if ($res = $arRes->Fetch()) {
          ?><select>
            <option><? print_r($res["UF_TT_ADRESS"])?></option>	       
          </select><?
      }
  ?>

Also, Bitrix technical support advised that to solve the problem, you need to use the CSaleOrderUserPropsValue::Add
method. I registered the call of the value I need in this way
<?
    $arFields = array(
       "ORDER_PROPS_ID" => 45
    );
    CSaleOrderUserPropsValue::Add($arFields);
  ?>

Now the main question is
Where and how to correctly register this code so that the values ​​of the additional fields of the USER profile are transferred to the BUYER profile?
Analyzing the component code, I found that order properties are passed through class="ORDER_PROPS_ID". This class occurs:
In component files
I don't know where to write the above scripts correctly.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question