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
//Добавить товар в корзину | |
$(document).on('click', '.pi__order-bucket, .tovar__bucket, .item-found__bucket', function(e){ | |
e.preventDefault(); | |
var id = $(this).data('id'), | |
price = $(this).data('price'), | |
name = $(this).data('name'), | |
count = $('.product2cart_count_'+id).text(), | |
src = $('.product2cart_img_'+id).attr('src'), | |
bg = ($('.product2cart_img_'+id).hasClass('empty') ? "#fff url("+src+")" : "url("+src+") no-repeat center"); | |
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"); | |
use \Bitrix\Catalog\CatalogViewedProductTable as CatalogViewedProductTable; | |
$user_id = CSaleBasket::GetBasketUserID(); | |
if($user_id > 0) { | |
$product_id = $arResult['ID']; | |
CatalogViewedProductTable::refresh($product_id, $user_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
<? | |
$GLOBALS['arrFilter'] = Array(); | |
foreach (explode(' ', $_REQUEST["q"]) as $key => $value) { | |
$GLOBALS['arrFilter'][] = array( | |
"LOGIC" => "OR", | |
array("NAME" => "%$value%"), | |
array("DETAIL_TEXT"=>"%$value%"), | |
array("PREVIEW_TEXT"=>"%$value%") | |
); | |
} |
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
foreach (explode(' ', $_REQUEST["q"]) as $key => $value) { | |
$arItem["NAME"] = preg_replace('/'.$value.'/iu', '<span class="search-term">\\0</span>', $arItem["NAME"]); | |
$arItem["PREVIEW_TEXT"] = preg_replace('/'.$value.'/iu', '<span class="search-term">\\0</span>', $arItem["PREVIEW_TEXT"]); | |
} |
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
<? | |
define("LOG_FILENAME", $_SERVER["DOCUMENT_ROOT"]."/log.txt"); | |
//define('siteType', 'dev'); | |
//Определяем мобильные устройства библиотекой http://mobiledetect.net/ | |
require_once 'include/Mobile_Detect.php'; | |
$detect = new Mobile_Detect; | |
//Все мобилные устройства кроме планшетов | |
if( $detect->isMobile() && !$detect->isTablet() ){ |
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
$(document).on('hidden.bs.modal', '.modal', function () { | |
$('.modal:visible').length && $(document.body).addClass('modal-open'); | |
}); |
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
<nav class="catalog__nav"> | |
<?if(($arResult["NAV_RESULT"]->PAGEN - 1) > 0):?> | |
<a href="?PAGEN_1=<?=($arResult["NAV_RESULT"]->PAGEN - 1);?>" class="catalog__nav-active">← Предыдущая</a> | |
<?else:?> | |
<a href="#">← Предыдущая</a> | |
<?endif;?> | |
<?if(($arResult["NAV_RESULT"]->PAGEN + 1) <= $arResult["NAV_RESULT"]->NavPageCount):?> | |
<a href="?PAGEN_1=<?=($arResult["NAV_RESULT"]->PAGEN + 1);?>" class="catalog__nav-active">Следующая →</a> | |
<?else:?> | |
<a href="#">Следующая →</a> |
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\Catalog\CatalogViewedProductTable as CatalogViewedProductTable; | |
$user_id = CSaleBasket::GetBasketUserID(); | |
if($user_id > 0) { | |
$product_id = $arResult['ID']; | |
CatalogViewedProductTable::refresh($product_id, $user_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
<?if($arResult["PRICE"]["DISCOUNT_PRICE"] < $arResult["PRICE"]["RESULT_PRICE"]["BASE_PRICE"]):?> | |
<p class="tovar__price">Цена без скидки: <del><?=str_replace('.', ',', $arResult["PRICE"]["RESULT_PRICE"]["BASE_PRICE"])?></del> руб.</p> | |
<p class="tovar__price">Цена со скидкой: <span><?=str_replace('.', ',', $arResult["PRICE"]["DISCOUNT_PRICE"])?></span> руб.</p> | |
<p class="tovar__price--discount">Скидка: <span><?=str_replace('.', ',', $arResult["PRICE"]["RESULT_PRICE"]["DISCOUNT"])?> руб. (<?=$arResult["PRICE"]["RESULT_PRICE"]["PERCENT"]?>%)</span></p> | |
<?else:?> | |
<p class="tovar__price">Цена: <span><?=str_replace('.', ',', $arResult["PRICE"]["DISCOUNT_PRICE"])?></span> руб.</p> | |
<?endif;?> |
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->IncludeComponent( | |
"bitrix:iblock.vote", | |
"ajax", | |
Array( | |
"IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"], | |
"IBLOCK_ID" => $arParams["IBLOCK_ID"], | |
"ELEMENT_ID" =>$arResult["ID"], | |
"MAX_VOTE" => $arParams["MAX_VOTE"], | |
"VOTE_NAMES" => $arParams["VOTE_NAMES"], | |
"CACHE_TYPE" => $arParams["CACHE_TYPE"], |