Skip to content

Instantly share code, notes, and snippets.

@anoriar
Created January 20, 2019 15:21
Show Gist options
  • Save anoriar/17cfb2e99a90b96a4454515ad8960638 to your computer and use it in GitHub Desktop.
Save anoriar/17cfb2e99a90b96a4454515ad8960638 to your computer and use it in GitHub Desktop.
$db_sales = CSaleOrder::GetList(array("DATE_INSERT" => "ASC"), $arFilter, false, ["nTopCount" => 1], ["ID", "STATUS_ID"]);
if($sale = $db_sales->Fetch())
{
$lastOrderId = $sale["ID"];
$arProps = array();
$orderProps = CSaleOrderPropsValue::GetList(
[],
array(
"ORDER_ID" => $lastOrderId,
"CODE" => ["DELIVERY_SHOP_ID"]
),
false,
false,
array()
);
while ($arRes = $orderProps->GetNext())
{
$arProps[$arRes["CODE"]] = $arRes;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment