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("sale"); | |
| $order = \Bitrix\Sale\Order::load(25336); | |
| $basket = $order->getBasket(); | |
| $basketItem = $basket->getItemById(1890381); | |
| $basketPropertyCollection = $basketItem->getPropertyCollection(); | |
| $basketPropertyCollection->setProperty(array( | |
| array( | |
| 'NAME' => 'Добавлен в заказ', |
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
| <?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php"); | |
| use Bitrix\Iblock\SectionTable; | |
| use Bitrix\Iblock\ElementTable; | |
| use Bitrix\Main\Loader; | |
| use Bitrix\Main\SystemException; | |
| Loader::includeModule('iblock'); | |
| // $elementId = 495982; | |
| // $element = ElementTable::getRow([ |
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
| ymaps.ready(function() { | |
| var mapCenter = [<?=$arResult['ITEMS'][0]['PROPERTIES']['MAP']['VALUE']?>], | |
| map = new ymaps.Map('map_general', { | |
| center: mapCenter, | |
| zoom: 10, | |
| controls: [] | |
| }); | |
| map.controls.add('routeEditor'); | |
| map.controls.add('typeSelector'); | |
| map.controls.add('zoomControl'); |
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 soapToArray($soap){ | |
| $response = preg_replace("/(<\/?)(\w+):([^>]*>)/", "$1$2$3", $soap); | |
| $xml = new SimpleXMLElement($response); | |
| $body = $xml->xpath('//SBody')[0]; | |
| $array = json_decode(json_encode((array)$body), TRUE); | |
| return $array; | |
| } |
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 redirect($url){ | |
| $ch = curl_init(); | |
| curl_setopt($ch, CURLOPT_URL, $url); | |
| curl_setopt($ch, CURLOPT_HEADER, true); | |
| curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); | |
| $a = curl_exec($ch); | |
| if(preg_match('#Location: (.*)#', $a, $r)) | |
| $l = trim($r[1]); |
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
| <? | |
| $reflFunc = new ReflectionFunction('custom_mail'); | |
| print $reflFunc->getFileName() . ':' . $reflFunc->getStartLine(); |
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("search", "BeforeIndex", "BeforeIndexHandler"); | |
| function BeforeIndexHandler($arFields) { | |
| $arrIblock = array(2, 3); //ID инфоблоков, для которых производить модификацию | |
| $arDelFields = array("DETAIL_TEXT" /*, "PREVIEW_TEXT"*/); //стандартные поля, которые нужно исключить | |
| if (CModule::IncludeModule('iblock') && $arFields["MODULE_ID"] == 'iblock' && in_array($arFields["PARAM2"], $arrIblock) && intval($arFields["ITEM_ID"]) > 0){ | |
| $dbElement = CIblockElement::GetByID($arFields["ITEM_ID"]); | |
| if ($arElement = $dbElement->Fetch()){ | |
| foreach ($arDelFields as $value) { | |
| if (isset ($arElement[$value]) && strlen($arElement[$value])> 0){ |
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", "OnBeforeProlog", Array("MyClass", "MyOnBeforePrologHandler"), 50); | |
| class MyClass | |
| { | |
| function MyOnBeforePrologHandler() | |
| { | |
| // if(strpos($_SERVER['REQUEST_URI'],'/catalog/')!==false){ | |
| $old_url = $_SERVER['REQUEST_URI']; | |
| Bitrix\Main\Loader::includeModule("highloadblock"); |
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
| <? | |
| $postdata = http_build_query( | |
| array( | |
| 'var1' => 'some content', | |
| 'var2' => 'doh' | |
| ) | |
| ); | |
| $opts = array('http' => | |
| array( |