$arrAttrs = array (
"LID" => SITE_ID,
"PERSON_TYPE_ID" => $_SESSION["order"]["person_type_id"],
"PAYED" => "N",
"CANCELED" => "N",
"STATUS_ID" => "N",
"PRICE_DELIVERY" => $nPriceDelivery,
"PRICE" => $nPrice,
"DISCOUNT_VALUE" => $nDiscount,
"CURRENCY" => "RUR",
"USER_ID" => IntVal ($USER->GetID()),
"PAY_SYSTEM_ID" => $_SESSION["order"]["pay_system_id"],
"DELIVERY_ID" => $_SESSION["order"]["delivery_id"]
);
$nId = CSaleOrder::Add ($arrAttrs);
if ($nId === false) return $nId;
$arrKeys = array_keys ($_SESSION["order"]["props"]);
for ($i = 0; $i < sizeof ($arrKeys); $i++)
{
$arrFields = array (
"ORDER_ID" => $nId,
"ORDER_PROPS_ID" => $_SESSION["order"]["props"][$arrKeys[$i]]["id"],
"VALUE" => $_SESSION["order"]["props"][$arrKeys[$i]]["value"]
);
CSaleOrderPropsValue::Add ($arrFields);
}
CSaleBasket::OrderBasket($nId);
|