8 (351) 220-01-90
8 (800) 550-21-90
8 (351) 220-01-90
8 (351) 220-01-90
8 (800) 550-21-90
8 (800) 550-21-90
8 (351) 220-01-90
8 (351) 220-01-90
8 (351) 220-01-90
8 (800) 550-21-90
8 (800) 550-21-90
8 (800) 550-21-90
8 (800) 550-21-90
8 (800) 550-21-90
8 (351) 220-01-90
8 (800) 550-21-90
8 (351) 220-01-90
8 (351) 220-01-90
8 (800) 550-21-90
8 (351) 220-01-90
8 (351) 220-01-90
8 (800) 550-21-90
8 (800) 550-21-90
8 (800) 550-21-90
8 (800) 550-21-90
8 (351) 220-01-90
Главная

Title

CModule::IncludeModule('iblock'); $arStores = array(); $dbStore = CCatalogStore::GetList( array("SORT" => "ASC"), array("ACTIVE" => "Y"), false, false, array('DESCRIPTION', 'PHONE', 'UF_MAIN') ); while ($aStore = $dbStore->GetNext()) { $arStores[$aStore["DESCRIPTION"]][] = array("TITLE" => $aStore["PHONE"], "MAIN" => $aStore["UF_MAIN"]); } //print_r($arStores); $arProductStore = array(); $dbCount = CCatalogStoreProduct::GetList(array("AMOUNT" => "ASC"), array('PRODUCT_ID' => array(58440, 62163, 62162, 58450), ">AMOUNT" => 0), false, false, array()); while ($arStore = $dbCount->GetNext()){ $arProductStore[$arStore["PRODUCT_ID"]][$arStore["STORE_DESCR"]][$arStore["STORE_PHONE"]] = $arStore["AMOUNT"]; // print_r($arStore); } //print_r($arProductStore); foreach($arProductStore as $id => $arProd) { $store = ''; $last_store = ''; $kol = 0; print_r($arProd); foreach($arStores['chelyabinsk'] as $v) { if ($v["MAIN"]) { $kol = $arProd['chelyabinsk'][$v["TITLE"]]; if ($kol > 3) { $store = $v["TITLE"]; } else { $last_store = $v["TITLE"]; } } elseif ($kol > $arProd['chelyabinsk'][$v["TITLE"]]) { $kol = $arProd['chelyabinsk'][$v["TITLE"]]; if ($kol > 3) { $store = $v["TITLE"]; } else { $last_store = $v["TITLE"]; } } } echo "Количество: ".$kol; if (strlen($store) > 0) { } }