P
P
Philipp R.2018-05-23 15:57:14
1C-Bitrix
Philipp R., 2018-05-23 15:57:14

How to display a property from an order by its ID. After the user has placed an order?

Hello.
Help inferring a property from an order by its ID. After the user has formed an order, I need to get the value of the "VALUE_NAME" field. And how to find out if a product in the composition of the product has changed the price. Code examples if possible.
Thanks in advance.
This is how my property is displayed on the cart page, but I don’t know how to get it by order number:

<?
            if(isset($arItem["PROPERTY_TSVET_VALUE"])) {
              foreach ($arItem["PROPS"] as $val):
                if (is_array($arItem["SKU_DATA"]))
                {
                  $bSkip = false;
                  foreach ($arItem["SKU_DATA"] as $propId => $arProp)
                  {
                    if ($arProp["CODE"] == $val["CODE"])
                    {
                      $bSkip = true;
                      break;
                    }
                  }
                  if ($bSkip)
                    continue;
                }

                echo "<br>".$val["NAME"].":&nbsp;<span>".$val["VALUE"]."<span><br/>";
              endforeach;
            }
            
          ?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pcsezam, 2018-05-23
@RFV_online

$db_vals = CSaleOrderPropsValue::GetList(
  [],
  [
    "ORDER_ID" => $orderId,
    "ORDER_PROPS_CODE" => $propCode
  ]
);

if ($arVals = $db_vals->Fetch()) {
  ...
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question