<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("Деактивация товаров");
?>
<?
if(!CModule::IncludeModule("catalog"))
{
ShowError(GetMessage("IBLOCK_MODULE_NOT_INSTALLED"));
return;
}
$ind = 0;
$db_res = CCatalogProduct::GetList(
array("SORT"=>"ASC"),
array("QUANTITY" => 0),
false,
false,
false
);
while ($ar_res = $db_res->Fetch())
{
$res = CIBlockElement::GetByID($ar_res['ID']);
if($ar_res = $res->GetNext())
if($ar_res['ACTIVE']=="Y"){
print $ar_res['ACTIVE'];
echo " ";
print $ar_res['ID'];
echo " ";
print $ar_res['NAME'];
echo "</br>";
$el = new CIBlockElement;
$arLoadProductArray = Array( "ACTIVE" => "N",);
$res = $el->Update($ar_res['ID'], $arLoadProductArray);
}
$ind++;
}
?>
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>
|