This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
// Функция определения мобильного устройства | |
function isMobile() | |
{ | |
// Проверяем, что это не планшет | |
$isTablet = preg_match("/(tablet|ipad|playbook|silk)/i", $_SERVER["HTTP_USER_AGENT"]); | |
if ($isTablet) { | |
return false; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
// Добавление города в <title> | |
EventManager::getInstance()->addEventHandler("main", "OnEndBufferContent", function (&$content) { | |
global $APPLICATION; | |
// Получаем поддомен | |
$subdomain = SaleOrderEvents::getSubdomain(); | |
// Определяем город | |
$domainToCity = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
EventManager::getInstance()->addEventHandler("catalog", "OnGetOptimalPrice", 'OnGetOptimalPriceHandler'); | |
global $TYPE_PRICE; | |
$TYPE_PRICE = 1; | |
function OnGetOptimalPriceHandler($productID, $quantity = 1, $arUserGroups = [], $renewal = "N", $arPrices = [], $siteID = "sr", $arDiscountCoupons = false) | |
{ | |
CModule::IncludeModule("iblock"); | |
CModule::IncludeModule("catalog"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
EventManager::getInstance()->addEventHandlerCompatible( | |
'sale', | |
'OnSaleComponentOrderProperties', | |
['SaleOrderEvents', 'fillLocation'] | |
); | |
class SaleOrderEvents | |
{ | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
use Bitrix\Main\Loader; | |
use Bitrix\Iblock\SectionTable; | |
use Bitrix\Iblock\InheritedProperty; | |
Loader::includeModule('iblock'); | |
$iblockId = 28; // ID инфоблока | |
$sectionId = 189; // ID родительского раздела |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
AddEventHandler("main", "OnAfterUserRegister", "OnAfterUserRegisterHandler"); | |
function OnAfterUserRegisterHandler(&$arFields) | |
{ | |
if (intval($arFields["ID"]) > 0) { | |
$userId = $arFields["ID"]; | |
$PhoneAuthTable = \Bitrix\Main\UserPhoneAuthTable::getList($parameters = array( | |
'filter'=>array('USER_ID' =>$userId) | |
)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/www | |
find . -type d -exec chmod 775 {} \; | |
find . -type f -exec chmod 664 {} \; | |
find . -type d -exec chown bitrix:bitrix {} \; | |
find . -type f -exec chown bitrix:bitrix {} \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?$APPLICATION->ShowViewContent('sidebar'); // для вывода результата ?> | |
<?$this->SetViewTarget('sidebar');?> | |
<?//your content for show?> | |
<?$this->EndViewTarget();?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BX.Sale.BasketComponent.sendRequest('refreshAjax', {fullRecalculation: 'Y'}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?CModule::IncludeModule("catalog"); | |
$arSelect = Array("ID", "IBLOCK_ID", "CATALOG_PRICE_1"); | |
$arFilter = Array("IBLOCK_ID"=>17); | |
//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>'; |
NewerOlder