Answer the question
In order to leave comments, you need to log in
Why does the CSaleBasket::Add method overwrite delivery information?
I import orders from another site - it's not the most rewarding thing, since some of the goods are not in the store already. As for adding the order itself:
CModule::IncludeModule('iblock');
CModule::IncludeModule('sale');
$arFields = array(
"LID" => "s1",
"PERSON_TYPE_ID" => 1,
"PAYED" => "N",
"CANCELED" => "N",
"STATUS_ID" => "N",
"PRICE" => 800.00,
"CURRENCY" => "RUB",
"USER_ID" => 1,
"PAY_SYSTEM_ID" => 1,
"PRICE_DELIVERY" => 500.00,
"USER_DESCRIPTION" => "Пробный заказ"
)
$ORDER_ID = CSaleOrder::Add($arFields);
$arFields = array(
"PRODUCT_ID" => 1,
"PRICE" => 300.00,
"CURRENCY" => "RUB",
"QUANTITY" => 1,
"ORDER_ID" => $ORDER_ID,
"LID" => "s1",
"NAME" => "Чемодан кожаный",
);
CSaleBasket::Add($arFields);
$arFields = array(
"PAYED" => "N",
"CANCELED" => "N",
"STATUS_ID" => "N",
"PRICE" => 800.00,
"CURRENCY" => "RUB",
"USER_ID" => 1,
"PAY_SYSTEM_ID" => 1,
"DELIVERY_ID" => 1,
"PRICE_DELIVERY" => 500.00,
);
$ORDER_ID = CSaleOrder::Update($ORDER_ID, $arFields);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question