A
A
Alexey2015-11-09 13:29:44
1C
Alexey, 2015-11-09 13:29:44

How to programmatically add a bitrix order?

You need to programmatically add an order. I am doing the integration of 1c and bitrix. I wrote a script that pulls new orders from the site and sends them as json to the 1c server, after which the orders are processed, but when I add an order to 1c, I can’t add it to bitrix. I looked in the documentation how to add an order programmatically, but when adding an order, the goods are not indicated anywhere. Tell those who know)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaliy K, 2016-08-16
@alexeyshi

All items from the cart are programmatically added using the 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" => "
var_dump($ORDER_ID);
CSaleBasket::OrderBasket($ORDER_ID, CSaleBasket::GetBasketUserID(), SITE_ID, false);
if (!$ORDER_ID)
die("Order not added".var_dump($arFields));
else
echo $ORDER_ID;
$ORDER_ID = IntVal($ORDER_ID);
?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question