Your IP : 18.224.43.98


Current Path : /var/www/u0635749/data/www/hobbyclick.ru/hobbyclick.ru/ajax/
Upload File :
Current File : /var/www/u0635749/data/www/hobbyclick.ru/hobbyclick.ru/ajax/skidkaAdd.php

<?require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php");
CModule::IncludeModule("sale");


$arraydsa = array(
    "LID"=>$_GET["siteSkidka"],
     "NAME"=> "Скидка на товар ".$_GET["tovarId"]
    ,"CURRENCY" => "RUB"
    ,"DISCOUNT_VALUE" => $_GET["skikda"]
    ,"DISCOUNT_TYPE" => "P"
    ,"ACTIVE" =>"Y"
    ,"SORT" => 100
	,"XML_ID"=>""
    ,"PRIORITY" => 1
    ,"LAST_DISCOUNT" => 'N'
    ,"LAST_LEVEL_DISCOUNT" => 'N'
    ,"VERSION" => 3
    ,"CONDITIONS_LIST" => Array
        (
            "CLASS_ID" => 'CondGroup'
            ,"DATA" => Array
                (
                    "All" => "AND"
                    ,"True" => "True"
                )

            ,"CHILDREN" => Array
                (
                    "0" => Array
                        (
                            "CLASS_ID" => 'CondBsktProductGroup'
                            ,"DATA" => Array
                                (
                                    "Found" => 'Found'
                                    ,"All" =>"AND"
                                )

                            ,"CHILDREN" => Array
                                (
                                    "0" => Array
                                        (
                                            "CLASS_ID" => 'CondIBElement'
                                            ,"DATA" => Array
                                                (
                                                    "logic" =>'Equal'
                                                    ,"value" => Array
                                                        (
                                                            0 => intval($_GET["tovarId"])
                                                        )

                                                )

                                        )

                                )

                        )

                )

        )
	   ,"ACTIONS_LIST" => Array
        (
            "CLASS_ID" => 'CondGroup'
            ,"DATA" => Array
                (
                    "All" => "AND"
                )

            ,"CHILDREN" => Array
                (
                    "0" => Array
                        (
                            "CLASS_ID" => 'ActSaleBsktGrp'
                            ,"DATA" => Array
                                (
                                    "Type" => 'Discount'
                                    ,"Value" => $_GET["skikda"]
                                    ,"Unit" =>'Perc'
                                    ,"Max" => $_GET["skikda"]
                                    ,"All" => "AND"
                                    ,"True" => True
                                )

                            ,"CHILDREN" => Array
                                (
                            
                                    "1" => Array
                                        (
                                            "CLASS_ID" => 'ActSaleSubGrp'
                                            ,"DATA" => Array
                                                (
                                                    "All" => "AND"
                                                    ,"True" => True
                                                )

                                            ,"CHILDREN" => Array
                                                (
                                                    "0" => Array
                                                        (
                                                            "CLASS_ID" => 'CondIBElement'
                                                            ,"DATA" => Array
                                                                (
                                                                    "logic" =>'Equal'
                                                                    ,"value" => Array
                                                                        (
                                                                            0 => intval($_GET["tovarId"])
                                                                        )

                                                                )

                                                        )

                                                )

                                        )

                                )

                        )

                )

        )
    ,"USE_COUPONS" =>'N'
    ,"HAS_INDEX" => 'Y'
	,"USER_GROUPS" => array(2)
    ,"PRESET_ID" => "Sale\Handlers\DiscountPreset\SimpleProduct"
    ,"SHORT_DESCRIPTION_STRUCTURE" => Array
        (
            "TYPE" => 'Discount'
            ,"VALUE" => $_GET["skikda"]
            ,"LIMIT_VALUE" => '0'
            ,"VALUE_TYPE" => 'P'
        )

);
$iDiscountNumber = \CSaleDiscount::Add( $arraydsa );
var_dump($iDiscountNumber);
var_dump($APPLICATION->GetException());