function InstallEvents()
{
RegisterModuleDependences('search', 'BeforeIndex', 'mymodule.smartsearch', '\\MyModule\\SmartSearch\\EventHandler', 'BeforeIndex');
}
function UnInstallEvents()
{
UnRegisterModuleDependences('search', 'BeforeIndex', 'mymodule.smartsearch', '\\MyModule\\SmartSearch\\EventHandler', 'BeforeIndex');
}
namespace MyModule\SmartSearch;
class EventHandler
{
function BeforeIndex($arFields)
{
\CModule::IncludeModule("iblock");
if ($arFields["MODULE_ID"] == "iblock") {
$result = \CIBlockElement::GetByID($arFields["ITEM_ID"]);
if ($element = $result->Fetch()) {
$arFields['PARAM1'] = $element['IBLOCK_SECTION_ID'];
}
}
return $arFields;
}
}
$result = CIBlockElement::GetList([], ["PROPERTY_TOVAR_DAY" => "Y"]);
<?
global $arrFilter;
$arrFilter= array(
"PROPERTY_TOVAR_DAY" => "Y"
);
?>
<? $APPLICATION->IncludeComponent(
"bitrix:catalog.section",
"main_events",
Array(
//...
"FILTER_NAME" => "arrFilter",
//...
)
); ?>
mysql soft nofile 65535
mysql hard no file 65535
session required pam_limits.so
Request URL: http://www.mpatrol.ru/events/2016/10/
Request Method: GET
Status Code: 302 Found
Location: http://www.mpatrol.ru/events/2016/08/
<?php
// Include Sale module
Bitrix\Main\Loader::includeModule("sale");
// Query: Get all cart items for current user
$res = CSaleBasket::GetList(
array(),
array(
"FUSER_ID" => CSaleBasket::GetBasketUserID(),
"LID" => SITE_ID,
"ORDER_ID" => NULL,
"CAN_BUY" => "Y"
),
false,
false,
array(
"QUANTITY",
"BASE_PRICE",
"PRICE",
"DISCOUNT_PRICE"
)
);
$totalPrice = 0;
// Temp array with cart items
$arItems = array();
// Fetching query
while($arFields = $res->Fetch()){
// Check for base price
if(!isset($arFields['BASE_PRICE']) || (float)$arFields['BASE_PRICE'] <= 0){
$arFields['BASE_PRICE'] = $arFields['PRICE'] + $arFields['DISCOUNT_PRICE'];
}
// Calculate total price without discount
$totalPrice += $arFields["PRICE"] * $arFields["QUANTITY"];
$arItems[] = $arFields;
}
// Make array for discount calculation
$arOrder = array(
'SITE_ID' => SITE_ID,
'ORDER_PRICE' => $totalPrice,
'BASKET_ITEMS' => $arItems
);
// Checking for authorized user
if(is_object($GLOBALS["USER"])){
$arOrder['USER_ID'] = $GLOBALS["USER"]->GetID();
$arErrors = array();
// Calculate discount
CSaleDiscount::DoProcessOrder($arOrder, array(), $arErrors);
}
// All done!
echo $arOrder['ORDER_PRICE'];
echo 'dfsdf \t dfsdfsd';
<?php
$APPLICATION->AddChainItem("Форум "Отзывы"", "/ru/forum/list.php?FID=3");
?>