-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_chenges.php
More file actions
41 lines (37 loc) · 934 Bytes
/
Copy pathget_chenges.php
File metadata and controls
41 lines (37 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php");
$APPLICATION->SetTitle("Title");
?>
<?
CModule::IncludeModule('my_module');
CModule::IncludeModule('iblock');
CModule::IncludeModule('catalog');
$time = microtime();
$res = velo::GetPriceVeloByComPredlozh();
foreach ($res as $item) {
$fields = array(
'PRODUCT_ID' => $item['ID'],
'CATALOG_GROUP_ID' => 2,
'PRICE' => $item['price'],
'CURRENCY' => "RUB",
);
$res = CPrice::GetList(
array(),
array(
"PRODUCT_ID" => $item['ID'],
"CATALOG_GROUP_ID" => 2
)
);
if ($arr = $res->Fetch())
{
CPrice::Update($arr["ID"], $fields);
}
else
{
CPrice::Add($fields);
}
}
echo $time = microtime() - $time;
?>
<pre><?print_r($res)?></pre>
<? require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_after.php"); ?>