Created
November 19, 2018 10:29
-
-
Save anoriar/3b9485ba02ed7928c52f9fef3a809626 to your computer and use it in GitHub Desktop.
addItems cleaned
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//если остались товары, то их надо удалить | |
if (!empty($arBasketItems)) { | |
foreach ($arBasketItems as $arBasketItem) { | |
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/upload/CSaleBasketDelete891679812.log", time("c") . " Заказ " . $OrderID . ", попытка удалить товар " . $arBasketItem["ID"] . "\n", FILE_APPEND | LOCK_EX); | |
//CSaleBasket::Delete($arBasketItem["ID"]); | |
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/upload/CSaleBasketDelete891679812.log", time("c") . " Заказ " . $OrderID . ", удален товар " . $arBasketItem["ID"] . "\n", FILE_APPEND | LOCK_EX); | |
$arLoadProductArray = Array( | |
"ACTIVE" => "Y" | |
); | |
$r = $el->Update($arFields["ID"], $arLoadProductArray, false, true, false, false); | |
$productId = $arFields["PROPERTY_SKU_PROPERTY_ID_VALUE"]; | |
if ($productId) { | |
//нашли родителя у торгового предложения, | |
//проверим, есть ли у него активные торговые предложения | |
$resSKU = false; | |
if ($this->activeProducts && in_array($productId, $this->activeProducts)) | |
$resSKU = true; | |
if ($resSKU) { | |
$arProductArray = Array( | |
"ACTIVE" => "Y" | |
); | |
$r = $el->Update($productId, $arProductArray, false, true, false, false); | |
} | |
} | |
\CIBlockElement::SetPropertyValuesEx($arFields["ID"], $arFields["IBLOCK_ID"], array("ADD_TO_ORDER" => "")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment