Guest User

btrx

a guest
Dec 18th, 2012
116
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $rsEl = CIBlockElement::GetList(array("ID" => "ASC"), array("IBLOCK_ID" => $BID, ">ID" => $_REQUEST["lastid"]), false, array("nTopCount" => $limit));
  2.     while ($arEl = $rsEl->Fetch())
  3.     {
  4.         if($arEl["IBLOCK_SECTION_ID"] == 169 || $arEl["IBLOCK_SECTION_ID"] == 170){
  5.             $ar_res = CPrice::GetBasePrice($arEl["EXTERNAL_ID"]);
  6.             $newprice = $ar_res["PRICE"] + $ar_res["PRICE"]*50/100;
  7.             $newprice = number_format($newprice, 2, '.', '');
  8.             #printr($ar_res);
  9.             CPrice::SetBasePrice($ar_res["ID"], $newprice, "RUB");
  10.             $lastID = intval($arEl["ID"]);
  11.         }else{
  12.             $ar_res = CPrice::GetBasePrice($arEl["EXTERNAL_ID"]);
  13.             $newprice = $ar_res["PRICE"] + $ar_res["PRICE"]*30/100;
  14.             $newprice = number_format($newprice, 2, '.', '');
  15.             #printr($ar_res);
  16.             CPrice::SetBasePrice($ar_res["ID"], $newprice, "RUB");
  17.             $lastID = intval($arEl["ID"]);
  18.         }
  19.     }
RAW Paste Data