Ejemplo n.º 1
0
	/**
	* The function updates delivery and paysystem
	*
	* @param int $ID - code delivery
	* @param array $arFields - paysytem
	* @return int $ID - code delivery
	*/
	function UpdateDeliveryPay($ID, $arFields)
	{
		$ID = trim($ID);

		if (strlen($ID) <= 0 || !is_array($arFields) || empty($arFields))
			return false;

		if ($arFields[0] == "")
			unset($arFields[0]);

		return CSaleDelivery2PaySystem::UpdateDelivery($ID, array("PAYSYSTEM_ID" => $arFields));
	}
Ejemplo n.º 2
0
        }
        if (!empty($arPicture)) {
            $arHandlersData["ALL"]["LOGOTIP"] = $arPicture;
        }
        foreach ($arHandlersData as $SITE_ID => $arHandlerData) {
            $APPLICATION->ResetException();
            $arHandlerData["PROFILE_USE_DEFAULT"] == "N";
            CSaleDeliveryHandler::Set($SID, $arHandlerData, $SITE_ID == "ALL" ? false : $SITE_ID);
            if ($ex = $APPLICATION->GetException()) {
                $errorsList .= $ex->GetString() . "<br />";
            }
        }
        //pay system for delivery
        if (is_set($_POST["PAY_SYSTEM"]) && is_array($_POST["PAY_SYSTEM"])) {
            foreach ($_POST["PAY_SYSTEM"] as $profileName => $arPSIds) {
                CSaleDelivery2PaySystem::UpdateDelivery($SID, array("PAYSYSTEM_ID" => $arPSIds, "DELIVERY_PROFILE_ID" => $profileName));
            }
        }
        if (strlen($errorsList) <= 0) {
            if (strlen($_REQUEST["apply"]) > 0) {
                LocalRedirect($APPLICATION->GetCurPage() . "?lang=" . LANG . "&SID=" . urlencode($SID));
            } else {
                LocalRedirect('/bitrix/admin/sale_delivery_handlers.php?lang=' . LANG);
            }
            die;
        }
    } else {
        $errorsList .= GetMessage('SALE_DH_ERROR_UNRECOGNIZED') . "<br />";
    }
}
$rsDeliveryInfo = CSaleDeliveryHandler::GetBySID($SID);