Skip to content

Instantly share code, notes, and snippets.

<?if(CModule::IncludeModule("sale"))
echo Number2Word_Rus(1425.43);?>
<?define("LOG_FILENAME", $_SERVER["DOCUMENT_ROOT"]."/log.txt");
AddMessage2Log('Моя мессага');?>
@d1i1m1o1n
d1i1m1o1n / bitrixOneClickOrder.php
Created December 8, 2015 12:44
Заказ в один клик Bitrix
<?php
require_once($_SERVER['DOCUMENT_ROOT']. "/bitrix/modules/main/include/prolog_before.php");
// добавление заказа в один клик, только по имени и телефону
CModule::IncludeModule("sale");
CModule::IncludeModule("catalog");
if(!empty($_REQUEST['name']) && !empty($_REQUEST['phone']))
{
$name = $_REQUEST['name'];
@d1i1m1o1n
d1i1m1o1n / .htaccess
Created November 23, 2015 14:35
Bitrix .htaccess
Options -Indexes
ErrorDocument 404 /404.php
<IfModule mod_php5.c>
php_flag session.use_trans_sid off
php_value display_errors 1
php_value mbstring.internal_encoding UTF-8
</IfModule>
<IfModule mod_rewrite.c>
@d1i1m1o1n
d1i1m1o1n / empty.php
Created November 23, 2015 14:34
Bitrix. Page without header and footer
<?php
define('NO_AGENT_CHECK', true);
define("STOP_STATISTICS", true);
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
//ajax
/*if (!isset($_SERVER['HTTP_X_REQUESTED_WITH']) || empty($_SERVER['HTTP_X_REQUESTED_WITH'])
|| strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') return;*/
@d1i1m1o1n
d1i1m1o1n / form.php
Created November 23, 2015 14:33
Bitrix. Standart bitrix form
<form method="post" action="<?php echo POST_FORM_ACTION_URI?>">
<?php echo bitrix_sessid_post()?>
<input type="submit" name="submit" value="Submit">
</form>
@d1i1m1o1n
d1i1m1o1n / header.php
Created November 23, 2015 14:32
Bitrix. Set data in component template and output in site template
<?php if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<div id="content">
<?php $APPLICATION->ShowViewContent('content'); ?>
</div>
@d1i1m1o1n
d1i1m1o1n / gist:0fb73df491d8fd3d8596
Last active November 15, 2015 21:27 — forked from marvell/gist:8330935
Bitrix: получение оптимальной цены (с учетом скидок) #snippet
CModule::IncludeModule("catalog");
global $USER;
//Цена
$arPrice = CCatalogProduct::GetOptimalPrice($arResult['ID'], 1, $USER->GetUserGroupArray());
$arResult['PRICE'] = $arPrice;
$arResult['DISCOUNT_PRICE'] = SaleFormatCurrency($arPrice["DISCOUNT_PRICE"], $arPrice["RESULT_PRICE"]["CURRENCY"]);