$data = json_decode(file_get_contents('php://input'), true);
if ((!empty($data['message']['text'])) and ($data['message']['text'] == '/start')){
$parameters =
array(
'chat_id' => $data['message']['chat']['id'],
'text' => 'Здравствуйте!'
);
send('sendMessage', $parameters);
};
function send($method, $data)
{
$url = "https://api.telegram.org/bot11111111111111111111111111111. "/" . $method;
if (!$curld = curl_init()) {
exit;
}
curl_setopt($curld, CURLOPT_POST, true);
curl_setopt($curld, CURLOPT_POSTFIELDS, $data);
curl_setopt($curld, CURLOPT_URL, $url);
curl_setopt($curld, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($curld);
curl_close($curld);
return $output;
}
оценивал, что мы сделаем сайта за 60 000 рублей
<?php
//Пример увеличения цены
//Задача поднять цены у товаров с 9500 до 10500
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php");
CModule::IncludeModule("catalog");
$arSelect = Array("ID", "IBLOCK_ID", "CATALOG_PRICE_1");
$arFilter = Array("IBLOCK_ID"=>8, "CATALOG_PRICE_1" => '9500');
//ID инфоблока с ТП, а не с простыми товарами
$resw = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>1000000), $arSelect);
while($ob = $resw->GetNextElement()){
$arFields = $ob->GetFields();
$arProps = $ob->GetProperties();
{
echo $arFields[ID].' - '.$arFields['CATALOG_PRICE_1'].'</br>';
$PRODUCT_ID = $arFields[ID];
$PRICE_TYPE_ID = 1;
//Тип цены смотрим в админке, обычно 1
$arFields = Array(
"PRODUCT_ID" => $PRODUCT_ID,
"CATALOG_GROUP_ID" => $PRICE_TYPE_ID,
"PRICE" => '10500',
"CURRENCY" => "RUB"
);
$res = CPrice::GetList(
array(),
array(
"PRODUCT_ID" => $PRODUCT_ID,
"CATALOG_GROUP_ID" => $PRICE_TYPE_ID
)
);
if ($arr = $res->Fetch())
{
CPrice::Update($arr["ID"], $arFields);
}
else
{
CPrice::Add($arFields);
};
}
};
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
use Bitrix\Sale\Internals;
CModule::IncludeModule("catalog");
CModule::IncludeModule("iblock");
CModule::IncludeModule("sale");
CSaleDiscount::Update(5, array("ACTIVE" => "Y"));
Options -Indexes
ErrorDocument 404 /404.php
php_flag display_errors on
php_value error_reporting 6143
php_value memory_limit 256M
RewriteEngine on
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ https://site.ru/ [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
RewriteRule ^index\.html$ https://site.ru/ [R=301,L]
RewriteCond %{REQUEST_URI} !^/bitrix/admin/1c_exchange\.php$
RewriteCond %{REQUEST_URI} !^/system/import/from1c_custom\.php$
RewriteCond %{SERVER_PORT} !^443$ [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.*)$ https://site.ru/$1 [R=301,L]
RewriteCond %{THE_REQUEST} //
RewriteRule .* /$0 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ /$1/ [R=301,L]
<IfModule mod_php7.c>
php_flag session.use_trans_sid of
php_value display_errors 1
#php_value mbstring.internal_encoding UTF-8
</IfModule>
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{THE_REQUEST} /(.*)index.php.*$
RewriteCond %{THE_REQUEST} !bitrix/admin/
RewriteRule .* /%1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php index.html
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/jpeg "access plus 3 day"
ExpiresByType image/gif "access plus 3 day"
ExpiresByType image/png "access plus 3 day"
ExpiresByType text/css "access plus 3 day"
ExpiresByType application/javascript "access plus 3 day"
</IfModule>