Программно добавляются все товары из корзины методом CSaleOrder::Add
<?
global $USER;
$arFields = array(
"LID" => SITE_ID,
"PERSON_TYPE_ID" => 1,
"PAYED" => "N",
"CANCELED" => "N",
"STATUS_ID" => "N",
"PRICE" => 1000.00,
"CURRENCY" => CSaleLang::GetLangCurrency(SITE_ID),
"USER_ID" => IntVal($USER->GetID()),
"PAY_SYSTEM_ID" => 2,
"PRICE_DELIVERY" => 100.00,
"DELIVERY_ID" => 2,
"TAX_VALUE" => 0.0,
"USER_DESCRIPTION" => "Регистрационный заказ"
);
echo "";
print_r($arFields);
echo "";
$ORDER_ID = CSaleOrder::Add($arFields);
var_dump($ORDER_ID);
CSaleBasket::OrderBasket($ORDER_ID, CSaleBasket::GetBasketUserID(), SITE_ID, false);
if (!$ORDER_ID)
die("Заказ не добавили".var_dump($arFields));
else
echo $ORDER_ID;
$ORDER_ID = IntVal($ORDER_ID);
?>