Аспро Макс: по успешному добавлению товара в корзину выводим не уведомление, а модалку с рекомендуемыми товарами



Задача: по успешному добавлению в корзину выводить не уведомление JNoticeSurface.get().onAdd2cart([th[0]]);, а модалку с рекомендуемыми товарами
Аспро использует данную модалку https://github.com/briceburg/jqModal/issues
при обновлении слетит в main.js и element.php надо будет добавить еще раз

/bitrix/templates/aspro_max/js/main.js
$(document).on("click", ".to-cart:not(.read_more), .basket_item_add", function (e) {
//...
if (typeof JNoticeSurface !== "undefined") {
                    if(fill_prop.add_item == "Y" && fill_prop.item>0 ){
                          
                        let id = fill_prop.item*1;
                        let triggerAddtobasket =  $('<span></span>');                          
                        $('<div id="addtobasketSuccessModal"  class="fast_view_frame  fast_view_frame_addtobasket jqmWindow popup scrollblock show" ></div>').appendTo("#popup_iframe_wrapper");
                        $('#addtobasketSuccessModal').jqm({
                          ajax: '/ajax/fast_view_addtobasket.php?&id='+id, 
                          trigger: triggerAddtobasket,
                           onLoad: function (hash) {
                                let time = 1000;
                                if(window.innerWidth>1000){
                                  time = 200;
                                }
                                onLoadjqm("fast_view_frame_addtobasket", hash);             
                                $('#addtobasketSuccessModal').prepend('<a href="#" class="close jqmClose"><i class="svg inline  svg-inline-" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path data-name="Rounded Rectangle 114 copy 3" class="cccls-1" d="M334.411,138l6.3,6.3a1,1,0,0,1,0,1.414,0.992,0.992,0,0,1-1.408,0l-6.3-6.306-6.3,6.306a1,1,0,0,1-1.409-1.414l6.3-6.3-6.293-6.3a1,1,0,0,1,1.409-1.414l6.3,6.3,6.3-6.3A1,1,0,0,1,340.7,131.7Z" transform="translate(-325 -130)"></path></svg></i></a>');
                                $('#popup_iframe_wrapper').css('z-index', 3000);
                                $('#popup_iframe_wrapper').css('display', 'flex');

                                setTimeout(function(){                
                                  $('#addtobasketSuccessModal').css('z-index', $('#popup_iframe_wrapper .jqmOverlay').first().css('z-index')+1);
                                  $('#addtobasketSuccessModal').css('display','block!important');

                                },time);
                                
                              

                              },
                              onHide: function (hash) {
                                onHidejqm("fast_view_frame_addtobasket", hash);
                                $('#popup_iframe_wrapper').css('z-index', 0);
                                $('#popup_iframe_wrapper').hide();

                                $('#addtobasketSuccessModal').remove();
                              },
                        });
                        triggerAddtobasket.trigger('click');
                      
                    }
                    else{
                      JNoticeSurface.get().onAdd2cart([th[0]]);
                    } 
//...
}
/ajax/fast_view_addtobasket.php
<?define("STATISTIC_SKIP_ACTIVITY_CHECK", "true");?>
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");?>

<?
if(isset($_GET['id']) && $_GET['id']){
   global $APPLICATION, $arRegion, $arTheme;
   $arRegion = CMaxRegionality::getCurrentRegion();
   $arTheme = CMax::GetFrontParametrsValues(SITE_ID);   
   $context = \Bitrix\Main\Application::getInstance()->getContext();
   $request = $context->getRequest();
   \Bitrix\Main\Loader::includeModule('catalog');
   $arFilter = Array(      
      "ACTIVE"=>"Y",
      "ID" => $_GET['id']
   );
   $arSelect = Array("ID", "DETAIL_PAGE_URL","NAME");
   $res = CIBlockElement::GetList(Array("sort"=>"asc"), $arFilter, false, Array("nPageSize"=>1,"iNumPage"=>1), $arSelect);   
   if($arItem = $res->GetNext()){
    //обрабатывает детальную страницу из шаблона пути
      $href = $arItem["DETAIL_PAGE_URL"]; // from fastViewNav.php
      $url = str_replace('&', '&', $href );
      $name = $arItem["NAME"];
      \Bitrix\Main\Loader::includeModule('sale');
      \Bitrix\Main\Loader::includeModule('currency');?>
      
      
      <script>
         var objUrl = parseUrlQuery(),
            add_url = '<?=(strpos($url, '?') !== false ? '&' : '?')?>ADDTOBASKET=Y';
         if('clear_cache' in objUrl)
         {
            if(objUrl.clear_cache == 'Y')
               add_url += '&clear_cache=Y';
         }
         $('.fast_view_frame').addClass('loading_block');
         
         BX.ajax({
            url: decodeURIComponent('<?=$url?>') + add_url,
            method: 'POST',
            data: BX.ajax.prepareData({'ADDTOBASKET':'Y'}),
            dataType: 'html',
            processData: false,
            start: true,
            headers: [{'name': 'X-Requested-With', 'value': 'XMLHttpRequest'}],
            onfailure: function(data) {
               alert('Error connecting server');
            },
            onsuccess: function(html){               
               var ob = BX.processHTML(html);

               <?if($_GET['skip_preview'] == true):?>
                  ob.HTML = ob.HTML.replace(/(calculate-delivery[^>]*?)with_preview/, '$1').replace(/<span class=\"calculate-delivery-preview\"><\/span>/, '');
               <?endif;?>

               // inject
               BX('fast_view_item_addtobasket').innerHTML = ob.HTML;
               BX.ajax.processScripts(ob.SCRIPT);
               $('#fast_view_item_addtobasket').closest('.form').addClass('init');

               $('.fast_view_frame_addtobasket').removeClass('loading_block');

               initCountdown();
               setBasketStatusBtn();
               // InitFlexSlider();
               InitZoomPict($('#fast_view_item_addtobasket .zoom_picture'));

               InitLazyLoad();
               //InitOwlSlider();
               BX.loadScript(arAsproOptions.SITE_TEMPLATE_PATH + '/js/jquery.fancybox.min.js', function(event){
                  BX.loadCSS(arAsproOptions.SITE_TEMPLATE_PATH + '/css/jquery.fancybox.min.css');
                  InitFancyBox();
                  InitFancyBoxVideo();
               })
               
               // init calculate delivery with preview
               if($('#fast_view_item_addtobasket .fastview-product.noffer').length){
                  initCalculatePreview();
               }

               setTimeout(function(){
                  showTotalSummItem('Y');
               }, 100);

               InitScrollBar($('.fastview-product__info'));

               $('.popup .animate-load').click(function(){
                  if(!jQuery.browser.mobile)
                     $(this).parent().addClass('loadings');
               })

               $('#fast_view_item_addtobasket .counter_block input[type=text]').numeric({allow:"."});

               $('.navigation-wrapper-fast-view .fast-view-nav').removeClass('noAjax');

               $(window).scroll();
            }
         })
         $(document).on('click', '.jqmClose', function(e){
            e.preventDefault();
            $(this).closest('.jqmWindow').jqmHide();
         })
      </script>
      <div id="fast_view_item_addtobasket"><div class="loading_block"></div></div>
   <?
   }
   
}

die();
?>

/bitrix/templates/aspro_max/components/bitrix/catalog/main/element.php
if($bFastViewMode)
   include_once('element_fast_view.php');
else if((isset($_REQUEST['ADDTOBASKET']) && $_REQUEST['ADDTOBASKET'] == 'Y') //вот эти 2 строчки в конце
   include_once('element_addtobasket_view.php');
else if($bReviewsSort)
   include_once('element_reviews.php');
else
   include_once('element_normal.php');
/bitrix/templates/aspro_max/components/bitrix/catalog/main/element_addtobasket_view.php
<?global $APPLICATION;?>

<!--после добавления в корзину-->
<div class="form_wrapper_addtobasket">
   <?$ElementID = $APPLICATION->IncludeComponent(
      "bitrix:catalog.element",
      "main3_addtobasket",
      Array(
         "USE_REGION" => ($arRegion ? "Y" : "N"),
         "USE_PREDICTION" => $arParams['USE_DETAIL_PREDICTION'],
         "SECTION_TIZERS"=>false,
         //"SECTION_TIZERS"=>$arSection["UF_SECTION_TIZERS"],
         "HELP_TEXT"=>$arSection["UF_HELP_TEXT"],
         "ALT_TITLE_GET" => $arParams["ALT_TITLE_GET"],
         "GRUPPER_PROPS" => $arParams["GRUPPER_PROPS"],
         "USE_CUSTOM_RESIZE" => $arParams["USE_CUSTOM_RESIZE"],
         "SHOW_DISCOUNT_TIME_EACH_SKU" => $arParams["SHOW_DISCOUNT_TIME_EACH_SKU"],
         "SHOW_UNABLE_SKU_PROPS"=>$arParams["SHOW_UNABLE_SKU_PROPS"],
         "SHOW_ARTICLE_SKU" => $arParams["SHOW_ARTICLE_SKU"],
         "SHOW_MEASURE_WITH_RATIO" => $arParams["SHOW_MEASURE_WITH_RATIO"],
         "STORES_FILTER" => ($arParams["STORES_FILTER"] ? $arParams["STORES_FILTER"] : "TITLE"),
         "STORES_FILTER_ORDER" => ($arParams["STORES_FILTER_ORDER"] ? $arParams["STORES_FILTER_ORDER"] : "SORT_ASC"),
         "BUNDLE_ITEMS_COUNT" => $arParams["BUNDLE_ITEMS_COUNT"],
         "WIDE_BLOCK" => $isWideBlock,
         "PICTURE_RATIO" => (isset($sViewPictureDetail) ? $sViewPictureDetail : ''),
         "DETAIL_DOCS_PROP"=>false,
         "SHOW_DISCOUNT_TIME"=>$arParams["SHOW_DISCOUNT_TIME"],
         "TYPE_SKU" => ($typeSKU ? $typeSKU : $arTheme["TYPE_SKU"]["VALUE"]),
         "SEF_URL_TEMPLATES" => $arParams["SEF_URL_TEMPLATES"],
         "IBLOCK_REVIEWS_TYPE" => $arParams["IBLOCK_REVIEWS_TYPE"],
         "IBLOCK_REVIEWS_ID" => $arParams["IBLOCK_REVIEWS_ID"],
         "SHOW_ONE_CLICK_BUY" => $arParams["SHOW_ONE_CLICK_BUY"],
         "SEF_MODE_BRAND_SECTIONS" => $arParams["SEF_MODE_BRAND_SECTIONS"],
         "SEF_MODE_BRAND_ELEMENT" => $arParams["SEF_MODE_BRAND_ELEMENT"],
         "DISPLAY_COMPARE" => false,
         "IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"],
         "IBLOCK_ID" => $arParams["IBLOCK_ID"],
         "PROPERTY_CODE" => $arParams["DETAIL_PROPERTY_CODE"],
         "META_KEYWORDS" => $arParams["DETAIL_META_KEYWORDS"],
         "META_DESCRIPTION" => $arParams["DETAIL_META_DESCRIPTION"],
         "BROWSER_TITLE" => $arParams["DETAIL_BROWSER_TITLE"],
         "BASKET_URL" => $arParams["BASKET_URL"],
         'OFFER_SHOW_PREVIEW_PICTURE_PROPS' => $arParams['OFFER_SHOW_PREVIEW_PICTURE_PROPS'],
         "ACTION_VARIABLE" => $arParams["ACTION_VARIABLE"],
         "PRODUCT_ID_VARIABLE" => $arParams["PRODUCT_ID_VARIABLE"],
         "SECTION_ID_VARIABLE" => $arParams["SECTION_ID_VARIABLE"],
         "DISPLAY_PANEL" => $arParams["DISPLAY_PANEL"],
         "CACHE_TYPE" => $arParams["CACHE_TYPE"],
         "CACHE_TIME" => $arParams["CACHE_TIME"],
         "CACHE_GROUPS" => $arParams["CACHE_GROUPS"],
         "SET_TITLE" => $arParams["SET_TITLE"],
         "SHOW_CHEAPER_FORM" => $arParams["SHOW_CHEAPER_FORM"],
         "SET_CANONICAL_URL" => $arParams["DETAIL_SET_CANONICAL_URL"],
         "SET_LAST_MODIFIED" => "Y",
         "SET_STATUS_404" => $arParams["SET_STATUS_404"],
         "MESSAGE_404" => $arParams["MESSAGE_404"],
         "SHOW_404" => $arParams["SHOW_404"],
         "FILE_404" => $arParams["FILE_404"],
         "SORT_REGION_PRICE" => $arParams["SORT_REGION_PRICE"],
         "PRICE_CODE" => $arParams['PRICE_CODE'],
         "USE_PRICE_COUNT" => $arParams["USE_PRICE_COUNT"],
         "SHOW_PRICE_COUNT" => $arParams["SHOW_PRICE_COUNT"],
         "USE_RATIO_IN_RANGES" => $arParams["USE_RATIO_IN_RANGES"],
         "PRICE_VAT_INCLUDE" => $arParams["PRICE_VAT_INCLUDE"],
         "PRICE_VAT_SHOW_VALUE" => $arParams["PRICE_VAT_SHOW_VALUE"],
         "LINK_IBLOCK_TYPE" => $arParams["LINK_IBLOCK_TYPE"],
         "LINK_IBLOCK_ID" => $arParams["LINK_IBLOCK_ID"],
         "LINK_PROPERTY_SID" => $arParams["LINK_PROPERTY_SID"],
         "LINK_ELEMENTS_URL" => $arParams["LINK_ELEMENTS_URL"],
         "USE_ALSO_BUY" => $arParams["USE_ALSO_BUY"],
         'ADD_PICT_PROP' => $arParams['ADD_PICT_PROP'],
         'OFFER_ADD_PICT_PROP' => $arParams['OFFER_ADD_PICT_PROP'],
         "OFFERS_CART_PROPERTIES" => $arParams["OFFERS_CART_PROPERTIES"],
         "OFFERS_FIELD_CODE" => $arParams["DETAIL_OFFERS_FIELD_CODE"],
         "OFFERS_PROPERTY_CODE" => $arParams["DETAIL_OFFERS_PROPERTY_CODE"],
         "OFFERS_SORT_FIELD" => $arParams["OFFERS_SORT_FIELD"],
         "OFFERS_SORT_ORDER" => $arParams["OFFERS_SORT_ORDER"],
         "OFFERS_SORT_FIELD2" => $arParams["OFFERS_SORT_FIELD2"],
         "OFFERS_SORT_ORDER2" => $arParams["OFFERS_SORT_ORDER2"],
         "LINKED_ELEMENT_TAB_SORT_FIELD" => $arParams["LINKED_ELEMENT_TAB_SORT_FIELD"],
         "LINKED_ELEMENT_TAB_SORT_ORDER" => $arParams["LINKED_ELEMENT_TAB_SORT_ORDER"],
         "LINKED_ELEMENT_TAB_SORT_FIELD2" => $arParams["LINKED_ELEMENT_TAB_SORT_FIELD2"],
         "LINKED_ELEMENT_TAB_SORT_ORDER2" => $arParams["LINKED_ELEMENT_TAB_SORT_ORDER2"],
         "SKU_DETAIL_ID" => $arParams["SKU_DETAIL_ID"],
         "SKU_DISPLAY_LOCATION" => $arParams["SKU_DISPLAY_LOCATION"],
         "ELEMENT_ID" => $arResult["VARIABLES"]["ELEMENT_ID"],
         "ELEMENT_CODE" => $arResult["VARIABLES"]["ELEMENT_CODE"],
         "SECTION_ID" => $arResult["VARIABLES"]["SECTION_ID"],
         "SECTION_CODE" => $arResult["VARIABLES"]["SECTION_CODE"],
         "SECTION_URL" => $arResult["FOLDER"].$arResult["URL_TEMPLATES"]["section"],
         "DETAIL_URL" => $arResult["FOLDER"].$arResult["URL_TEMPLATES"]["element"],
         "ADD_SECTIONS_CHAIN" => $arParams["ADD_SECTIONS_CHAIN"],
         "ADD_ELEMENT_CHAIN" => $arParams["ADD_ELEMENT_CHAIN"],
         "USE_STORE" => $arParams["USE_STORE"],
         "USE_STORE_PHONE" => $arParams["USE_STORE_PHONE"],
         "USE_STORE_SCHEDULE" => $arParams["USE_STORE_SCHEDULE"],
         "USE_MIN_AMOUNT" => $arParams["USE_MIN_AMOUNT"],
         "MIN_AMOUNT" => $arParams["MIN_AMOUNT"],
         "STORE_PATH" => $arParams["STORE_PATH"],
         "MAIN_TITLE" => $arParams["MAIN_TITLE"],
         "USE_PRODUCT_QUANTITY" => $arParams["USE_PRODUCT_QUANTITY"],
         "PRODUCT_QUANTITY_VARIABLE" => $arParams["PRODUCT_QUANTITY_VARIABLE"],
         "BLOG_URL" => $arParams["BLOG_URL"],
         "SHOW_SEND_GIFT" => $arParams['SHOW_SEND_GIFT'],
         "RECOMEND_COUNT" => $arParams["RECOMEND_COUNT"],
         "SEND_GIFT_FORM_NAME" => $arParams['SEND_GIFT_FORM_NAME'],

         "IBLOCK_LINK_SALE_ID" => $arParams["IBLOCK_STOCK_ID"],
         "IBLOCK_LINK_NEWS_ID" => $arParams["IBLOCK_LINK_NEWS_ID"],
         "IBLOCK_SERVICES_ID" => $arParams["IBLOCK_SERVICES_ID"],
         "IBLOCK_LINK_REVIEWS_ID" => $arParams["IBLOCK_LINK_REVIEWS_ID"],
         "IBLOCK_LINK_BLOG_ID" => $arParams["BLOG_IBLOCK_ID"],
         "IBLOCK_TIZERS_ID" => false,
         //"IBLOCK_TIZERS_ID" => $arParams["IBLOCK_TIZERS_ID"],
         "IBLOCK_LINK_STAFF_ID" => $arParams["STAFF_IBLOCK_ID"],
         "IBLOCK_LINK_VACANCY_ID" => $arParams["VACANCY_IBLOCK_ID"],

         "SEF_MODE_STOCK_SECTIONS" => $arParams["SEF_MODE_STOCK_SECTIONS"],
         "SHOW_QUANTITY" => $arParams["SHOW_QUANTITY"],
         "SHOW_QUANTITY_COUNT" => $arParams["SHOW_QUANTITY_COUNT"],
         "CONVERT_CURRENCY" => $arParams["CONVERT_CURRENCY"],
         "CURRENCY_ID" => $arParams["CURRENCY_ID"],
         'HIDE_NOT_AVAILABLE' => $arParams["HIDE_NOT_AVAILABLE"],
         'HIDE_NOT_AVAILABLE_OFFERS' => $arParams["HIDE_NOT_AVAILABLE_OFFERS"],
         'SHOW_DEACTIVATED' => $arParams['SHOW_DEACTIVATED'],
         "USE_ELEMENT_COUNTER" => $arParams["USE_ELEMENT_COUNTER"],
         "STAFF_VIEW_TYPE" => ($arParams["STAFF_VIEW_TYPE"] ? $arParams["STAFF_VIEW_TYPE"] : "staff_block"),
         'STRICT_SECTION_CHECK' => (isset($arParams['DETAIL_STRICT_SECTION_CHECK']) ? $arParams['DETAIL_STRICT_SECTION_CHECK'] : ''),
         'RELATIVE_QUANTITY_FACTOR' => (isset($arParams['RELATIVE_QUANTITY_FACTOR']) ? $arParams['RELATIVE_QUANTITY_FACTOR'] : ''),

         "USE_RATING" => false,
         "USE_REVIEW" => false,
         "REVIEWS_VIEW" => $arTheme["REVIEWS_VIEW"]["VALUE"],
         "REVIEW_COMMENT_REQUIRED" => $arParams["REVIEW_COMMENT_REQUIRED"],
         "REVIEW_FILTER_BUTTONS" => $arParams["REVIEW_FILTER_BUTTONS"],
         "REAL_CUSTOMER_TEXT" => $arParams["REAL_CUSTOMER_TEXT"],
         "FORUM_ID" => $arParams["FORUM_ID"],
         "MESSAGES_PER_PAGE" => $arParams["MESSAGES_PER_PAGE"],
         "MAX_AMOUNT" => $arParams["MAX_AMOUNT"],
         "USE_ONLY_MAX_AMOUNT" => $arParams["USE_ONLY_MAX_AMOUNT"],
         "DISPLAY_WISH_BUTTONS" => false,
         "DEFAULT_COUNT" => $arParams["DEFAULT_COUNT"],
         "SHOW_BRAND_PICTURE" => $arParams["SHOW_BRAND_PICTURE"],
         "PROPERTIES_DISPLAY_LOCATION" => $arParams["PROPERTIES_DISPLAY_LOCATION"],
         "PROPERTIES_DISPLAY_TYPE" => $arParams["PROPERTIES_DISPLAY_TYPE"],
         "SHOW_ADDITIONAL_TAB" => $arParams["SHOW_ADDITIONAL_TAB"],
         "SHOW_ASK_BLOCK" => $arParams["SHOW_ASK_BLOCK"],
         "ASK_FORM_ID" => $arParams["ASK_FORM_ID"],
         "SHOW_MEASURE" => $arParams["SHOW_MEASURE"],
         "SHOW_HINTS" => $arParams["SHOW_HINTS"],
         "OFFER_HIDE_NAME_PROPS" => $arParams["OFFER_HIDE_NAME_PROPS"],
         "SHOW_KIT_PARTS" => $arParams["SHOW_KIT_PARTS"],
         "SHOW_KIT_PARTS_PRICES" => $arParams["SHOW_KIT_PARTS_PRICES"],
         "SHOW_KIT_ALL" => $arParams['SHOW_KIT_ALL'],
         "SHOW_DISCOUNT_PERCENT_NUMBER" => $arParams["SHOW_DISCOUNT_PERCENT_NUMBER"],
         "SHOW_DISCOUNT_PERCENT" => $arParams["SHOW_DISCOUNT_PERCENT"],
         "SHOW_OLD_PRICE" => $arParams["SHOW_OLD_PRICE"],
         'OFFER_TREE_PROPS' => $arParams['OFFER_TREE_PROPS'],
         'ADD_DETAIL_TO_SLIDER' => (isset($arParams['DETAIL_ADD_DETAIL_TO_SLIDER']) ? $arParams['DETAIL_ADD_DETAIL_TO_SLIDER'] : ''),
         "SHOW_EMPTY_STORE" => $arParams['SHOW_EMPTY_STORE'],
         "SHOW_GENERAL_STORE_INFORMATION" => $arParams['SHOW_GENERAL_STORE_INFORMATION'],
         "USER_FIELDS" => $arParams['USER_FIELDS'],
         "FIELDS" => $arParams['FIELDS'],
         "STORES" => $arParams['STORES'],
         "BIG_DATA_RCM_TYPE" => $arParams['BIG_DATA_RCM_TYPE'],
         "USE_BIG_DATA" => $arParams['USE_BIG_DATA'],
         "USE_MAIN_ELEMENT_SECTION" => $arParams["USE_MAIN_ELEMENT_SECTION"],
         "PARTIAL_PRODUCT_PROPERTIES" => (isset($arParams["PARTIAL_PRODUCT_PROPERTIES"]) ? $arParams["PARTIAL_PRODUCT_PROPERTIES"] : ''),
         "ADD_PROPERTIES_TO_BASKET" => (isset($arParams["ADD_PROPERTIES_TO_BASKET"]) ? $arParams["ADD_PROPERTIES_TO_BASKET"] : ''),
         "PRODUCT_PROPERTIES" => false,
         "SALE_STIKER" => $arParams["SALE_STIKER"],
         "STIKERS_PROP" => $arParams["STIKERS_PROP"],
         "SHOW_RATING" => $arParams["SHOW_RATING"],

         "MAX_GALLERY_ITEMS" => $arParams["MAX_GALLERY_ITEMS"],
         "SHOW_GALLERY" => $arParams["SHOW_GALLERY"],
         "SHOW_PROPS" => (CMax::GetFrontParametrValue("SHOW_PROPS_BLOCK") == "Y" ? "Y" : "N"),
         'SHOW_POPUP_PRICE' => (CMax::GetFrontParametrValue('SHOW_POPUP_PRICE') == 'Y' ? "Y" : "N"),

         "OFFERS_LIMIT" => $arParams["DETAIL_OFFERS_LIMIT"],

         'SHOW_BASIS_PRICE' => (isset($arParams['DETAIL_SHOW_BASIS_PRICE']) ? $arParams['DETAIL_SHOW_BASIS_PRICE'] : 'Y'),
         "DETAIL_PICTURE_MODE" => (isset($arTheme["DETAIL_PICTURE_MODE"]["VALUE"]) ? $arTheme["DETAIL_PICTURE_MODE"]["VALUE"] : 'POPUP'),

         'DISABLE_INIT_JS_IN_COMPONENT' => (isset($arParams['DISABLE_INIT_JS_IN_COMPONENT']) ? $arParams['DISABLE_INIT_JS_IN_COMPONENT'] : ''),
         'COMPATIBLE_MODE' => (isset($arParams['COMPATIBLE_MODE']) ? $arParams['COMPATIBLE_MODE'] : ''),
         'SET_VIEWED_IN_COMPONENT' => (isset($arParams['DETAIL_SET_VIEWED_IN_COMPONENT']) ? $arParams['DETAIL_SET_VIEWED_IN_COMPONENT'] : ''),

         'SHOW_SLIDER' => (isset($arParams['DETAIL_SHOW_SLIDER']) ? $arParams['DETAIL_SHOW_SLIDER'] : ''),
         'SLIDER_INTERVAL' => (isset($arParams['DETAIL_SLIDER_INTERVAL']) ? $arParams['DETAIL_SLIDER_INTERVAL'] : ''),
         'SLIDER_PROGRESS' => (isset($arParams['DETAIL_SLIDER_PROGRESS']) ? $arParams['DETAIL_SLIDER_PROGRESS'] : ''),
         'USE_ENHANCED_ECOMMERCE' => (isset($arParams['USE_ENHANCED_ECOMMERCE']) ? $arParams['USE_ENHANCED_ECOMMERCE'] : ''),
         'DATA_LAYER_NAME' => (isset($arParams['DATA_LAYER_NAME']) ? $arParams['DATA_LAYER_NAME'] : ''),
         'GALLERY_THUMB_POSITION' => CMax::GetFrontParametrValue('CATALOG_PAGE_DETAIL_THUMBS'),


         "USE_GIFTS_DETAIL" => false,
         "USE_GIFTS_MAIN_PR_SECTION_LIST" => $arParams['USE_GIFTS_MAIN_PR_SECTION_LIST']?: 'Y',
         "GIFTS_SHOW_DISCOUNT_PERCENT" => $arParams['GIFTS_SHOW_DISCOUNT_PERCENT'],
         "GIFTS_SHOW_OLD_PRICE" => $arParams['GIFTS_SHOW_OLD_PRICE'],
         "GIFTS_DETAIL_PAGE_ELEMENT_COUNT" => $arParams['GIFTS_DETAIL_PAGE_ELEMENT_COUNT'],
         "GIFTS_DETAIL_HIDE_BLOCK_TITLE" => $arParams['GIFTS_DETAIL_HIDE_BLOCK_TITLE'],
         "GIFTS_DETAIL_TEXT_LABEL_GIFT" => $arParams['GIFTS_DETAIL_TEXT_LABEL_GIFT'],
         "GIFTS_DETAIL_BLOCK_TITLE" => $arParams["GIFTS_DETAIL_BLOCK_TITLE"],
         "GIFTS_SHOW_NAME" => $arParams['GIFTS_SHOW_NAME'],
         "GIFTS_SHOW_IMAGE" => $arParams['GIFTS_SHOW_IMAGE'],
         "GIFTS_MESS_BTN_BUY" => $arParams['GIFTS_MESS_BTN_BUY'],
         "VISIBLE_PROP_COUNT" => $arParams['VISIBLE_PROP_COUNT'],

         "GIFTS_MAIN_PRODUCT_DETAIL_PAGE_ELEMENT_COUNT" => $arParams['GIFTS_MAIN_PRODUCT_DETAIL_PAGE_ELEMENT_COUNT'],
         "GIFTS_MAIN_PRODUCT_DETAIL_BLOCK_TITLE" => $arParams['GIFTS_MAIN_PRODUCT_DETAIL_BLOCK_TITLE'],

         "TAB_OFFERS_NAME" => ($arParams["TAB_OFFERS_NAME"] ? $arParams["TAB_OFFERS_NAME"] : GetMessage("OFFER_PRICES")),
         "TAB_VIDEO_NAME" => ($arParams["TAB_VIDEO_NAME"] ? $arParams["TAB_VIDEO_NAME"] : GetMessage("VIDEO_TAB")),
         "TAB_BUY_SERVICES_NAME" => ($arParams["TAB_BUY_SERVICES_NAME"] ? $arParams["TAB_BUY_SERVICES_NAME"] : GetMessage("BUY_SERVICES_TAB")),
         "TAB_REVIEW_NAME" => ($arParams["TAB_REVIEW_NAME"] ? $arParams["TAB_REVIEW_NAME"] : GetMessage("REVIEW_TAB")),
         "TAB_FAQ_NAME" => $arParams["TAB_FAQ_NAME"],
         "TAB_STOCK_NAME" => ($arParams["TAB_STOCK_NAME"] ? $arParams["TAB_STOCK_NAME"] : GetMessage("STORES_TAB")),
         "TAB_NEWS_NAME" => ($arParams["TAB_NEWS_NAME"] ? $arParams["TAB_NEWS_NAME"] : GetMessage("TAB_NEWS_NAME")),
         "TAB_DOPS_NAME" => ($arParams["TAB_DOPS_NAME"] ? $arParams["TAB_DOPS_NAME"] : GetMessage("ADDITIONAL_TAB")),
         "TAB_STAFF_NAME" => ($arParams["TAB_STAFF_NAME"] ? $arParams["TAB_STAFF_NAME"] : GetMessage("TAB_STAFF_NAME")),
         "TAB_VACANCY_NAME" => ($arParams["TAB_VACANCY_NAME"] ? $arParams["TAB_VACANCY_NAME"] : GetMessage("TAB_VACANCY_NAME")),
         "TAB_BLOG_NAME" => ($arParams["BLOCK_BLOG_NAME"] ? $arParams["BLOCK_BLOG_NAME"] : GetMessage("TAB_BLOG_NAME")),
         "BLOCK_SERVICES_NAME" => ($arParams["BLOCK_SERVICES_NAME"] ? $arParams["BLOCK_SERVICES_NAME"] : GetMessage("SERVICES_TITLE")),
         "BLOCK_DOCS_NAME" => ($arParams["BLOCK_DOCS_NAME"] ? $arParams["BLOCK_DOCS_NAME"] : GetMessage("DOCUMENTS_TITLE")),
         "CHEAPER_FORM_NAME" => $arParams["CHEAPER_FORM_NAME"],
         "USE_ADDITIONAL_GALLERY" => $arParams["USE_ADDITIONAL_GALLERY"],
         "ADDITIONAL_GALLERY_TYPE" => $arParams["ADDITIONAL_GALLERY_TYPE"],
         "ADDITIONAL_GALLERY_PROPERTY_CODE" => $arParams["ADDITIONAL_GALLERY_PROPERTY_CODE"],
         "ADDITIONAL_GALLERY_OFFERS_PROPERTY_CODE" => $arParams["ADDITIONAL_GALLERY_OFFERS_PROPERTY_CODE"],
         "BLOCK_ADDITIONAL_GALLERY_NAME" => ($arParams["BLOCK_ADDITIONAL_GALLERY_NAME"] ? $arParams["BLOCK_ADDITIONAL_GALLERY_NAME"] : GetMessage("BLOCK_ADDITIONAL_GALLERY_NAME")),

         "T_KOMPLECT" => $arParams["TAB_KOMPLECT_NAME"],
         "T_NABOR" => $arParams["TAB_NABOR_NAME"],
         "T_DESC" => $arParams["TAB_DESCR_NAME"],
         "T_CHARACTERISTICS" => $arParams["TAB_CHAR_NAME"],

         "DETAIL_LINKED_GOODS_SLIDER" => $arParams["DETAIL_LINKED_GOODS_SLIDER"],
         "DETAIL_LINKED_GOODS_TABS" => $arParams["DETAIL_LINKED_GOODS_TABS"],

         "DETAIL_ASSOCIATED_TITLE" => $arParams["DETAIL_ASSOCIATED_TITLE"],
         "DETAIL_EXPANDABLES_TITLE" => "С этим товаром покупают",

         "LINKED_FILTER_BY_PROP" => $arAllValues,
         "LINKED_FILTER_BY_FILTER" => $arTab,
         "BIG_DATA_TEMPLATE" => $_SERVER["DOCUMENT_ROOT"].$this->__folder.'/page_blocks/'.$sViewBigDataExtTemplate.'.php',
         "TITLE_SLIDER" => $arParams['TITLE_SLIDER'],
         "LINKED_BLOG" => false,

         
         "SHOW_PAYMENT" => false,
         "SHOW_DELIVERY" => false,
         "SHOW_HOW_BUY" => false,
         
         "TITLE_HOW_BUY" => ($arParams["TITLE_HOW_BUY"] ? $arParams["TITLE_HOW_BUY"] : GetMessage("TITLE_HOW_BUY")),
         "TITLE_DELIVERY" => ($arParams["TITLE_DELIVERY"] ? $arParams["TITLE_DELIVERY"] : GetMessage("TITLE_DELIVERY")),
         "TITLE_PAYMENT" => ($arParams["TITLE_PAYMENT"] ? $arParams["TITLE_PAYMENT"] : GetMessage("TITLE_PAYMENT")),

         "CALCULATE_DELIVERY" => $arTheme["CALCULATE_DELIVERY"]["VALUE"],
         "EXPRESSION_FOR_CALCULATE_DELIVERY" => $arTheme["EXPRESSION_FOR_CALCULATE_DELIVERY"]["VALUE"],
         "DISPLAY_ELEMENT_SLIDER" => $arParams['DISPLAY_ELEMENT_SLIDER'],

         //"DETAIL_USE_COMMENTS" => (isset($arParams['DETAIL_USE_COMMENTS']) ? $arParams['DETAIL_USE_COMMENTS'] : 'N'),
         "DETAIL_USE_COMMENTS" => false,
         "COMMENTS_COUNT" => (isset($arParams['COMMENTS_COUNT']) ? $arParams['COMMENTS_COUNT'] : '5'),
         "DETAIL_BLOG_EMAIL_NOTIFY" => (isset($arParams['DETAIL_BLOG_EMAIL_NOTIFY']) ? $arParams['DETAIL_BLOG_EMAIL_NOTIFY'] : 'Y'),
         "MAX_IMAGE_SIZE" => (isset($arParams['MAX_IMAGE_SIZE']) ? $arParams['MAX_IMAGE_SIZE'] : '0.5'),

         "DETAIL_BLOCKS_ORDER" => ($arParams["DETAIL_BLOCKS_ORDER"] ? $arParams["DETAIL_BLOCKS_ORDER"] : ''),
         "DETAIL_BLOCKS_TAB_ORDER" => ($arParams["DETAIL_BLOCKS_TAB_ORDER"] ? $arParams["DETAIL_BLOCKS_TAB_ORDER"] : ''),
         "DETAIL_BLOCKS_ALL_ORDER" => ($arParams["DETAIL_BLOCKS_ALL_ORDER"] ? $arParams["DETAIL_BLOCKS_ALL_ORDER"] : ''),
         "COUNT_SERVICES_IN_ANNOUNCE" => (isset($arParams["COUNT_SERVICES_IN_ANNOUNCE"]) ? $arParams["COUNT_SERVICES_IN_ANNOUNCE"] : '2') ,
         "SHOW_ALL_SERVICES_IN_SLIDE" => (isset($arParams["SHOW_ALL_SERVICES_IN_SLIDE"]) ? $arParams["SHOW_ALL_SERVICES_IN_SLIDE"] : 'N') ,
         "FILTER_NAME" => $arParams["FILTER_NAME"],
         "DISPLAY_LINKED_PAGER" => ($arParams["DETAIL_LINKED_GOODS_SLIDER"] == "Y") ? "N" : $arParams["DISPLAY_LINKED_PAGER"],
         "DETAIL_SET_PRODUCT_TITLE" => ($arParams["DETAIL_SET_PRODUCT_TITLE"] ? $arParams["DETAIL_SET_PRODUCT_TITLE"] : GetMessage("DETAIL_SET_PRODUCT")),
         "LIST_OFFERS_FIELD_CODE" => $arParams["LIST_OFFERS_FIELD_CODE"],
         "LIST_OFFERS_PROPERTY_CODE" => $arParams["LIST_OFFERS_PROPERTY_CODE"],
         "LIST_OFFERS_LIMIT" => $arParams["LIST_OFFERS_LIMIT"],
         "MODULES_ELEMENT_COUNT" => $arParams["MODULES_ELEMENT_COUNT"],
         "OID" => $arParams["OID"],
         "SHOW_SKU_DESCRIPTION" => $arParams["SHOW_SKU_DESCRIPTION"],
         "VISIBLE_PROP_WITH_OFFER" => $arParams["VISIBLE_PROP_WITH_OFFER"],
      ),
      $component
   );?>
</div>

/bitrix/templates/aspro_max/components/bitrix/catalog.element/templates/main3_addtobasket
script.js - почистила (полностью)

result_modifier - можно не чистить


template.php
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
use \Bitrix\Main\Localization\Loc;
$title = $arResult['IPROPERTY_VALUES']["ELEMENT_PAGE_TITLE"] ?? $arResult["NAME"];
$href = $arResult["DETAIL_PAGE_URL"];
if(isset($arResult['OFFERS_SELECTED']) && isset($arResult['OFFERS'][$arResult['OFFERS_SELECTED']])){
   $title = $arResult['OFFERS'][$arResult['OFFERS_SELECTED']]['IPROPERTY_VALUES']["ELEMENT_PAGE_TITLE"] ?? $arResult['OFFERS'][$arResult['OFFERS_SELECTED']]["NAME"];   
   $href = $arResult["DETAIL_PAGE_URL"]."/".$arResult['OFFERS'][$arResult['OFFERS_SELECTED']]["CODE"];
   $href = str_replace("#OFER#/","",$href);
}
?>
      <?if ($arResult['SKU_CONFIG']):?><div class="js-sku-config" data-params='<?=str_replace('\'', '"', CUtil::PhpToJSObject($arResult['SKU_CONFIG'], false))?>'></div><?endif;?>

      <?
      $currencyList = '';
      if (!empty($arResult['CURRENCIES']))
      {
         $templateLibrary[] = 'currency';
         $currencyList = CUtil::PhpToJSObject($arResult['CURRENCIES'], false, true, true);
      }

      $bComplect = $arResult["PROPERTIES"]["PRODUCT_SET"]["VALUE"] === "Y";
      $addParams = array();
      if($bComplect){
         $addParams = array("DISPLAY_WISH_BUTTONS" => "N");
      }

      $templateData = array(
         'TEMPLATE_LIBRARY' => $templateLibrary,
         'CURRENCIES' => $currencyList,
         'STORES' => array(
            "USE_STORE_PHONE" => $arParams["USE_STORE_PHONE"],
            "SCHEDULE" => $arParams["SCHEDULE"],
            "USE_MIN_AMOUNT" => $arParams["USE_MIN_AMOUNT"],
            "MIN_AMOUNT" => $arParams["MIN_AMOUNT"],
            "ELEMENT_ID" => $arResult["ID"],
            "STORE_PATH"  =>  $arParams["STORE_PATH"],
            "MAIN_TITLE"  =>  $arParams["MAIN_TITLE"],
            "MAX_AMOUNT"=>$arParams["MAX_AMOUNT"],
            "USE_ONLY_MAX_AMOUNT" => $arParams["USE_ONLY_MAX_AMOUNT"],
            "SHOW_EMPTY_STORE" => $arParams['SHOW_EMPTY_STORE'],
            "SHOW_GENERAL_STORE_INFORMATION" => $arParams['SHOW_GENERAL_STORE_INFORMATION'],
            "USE_ONLY_MAX_AMOUNT" => $arParams["USE_ONLY_MAX_AMOUNT"],
            "USER_FIELDS" => $arParams['USER_FIELDS'],
            "FIELDS" => $arParams['FIELDS'],
            "STORES_FILTER_ORDER" => $arParams['STORES_FILTER_ORDER'],
            "STORES_FILTER" => $arParams['STORES_FILTER'],
            "STORES" => $arParams['STORES'] = array_diff($arParams['STORES'], array('')),
            "SET_ITEMS" => $arResult["SET_ITEMS"],
            'OFFERS_ID' => is_array($arResult['OFFERS']) ? array_column($arResult['OFFERS'], 'ID') : [],
         ),
         'OFFERS_INFO' => array(
            'OFFERS' => is_array($arResult['OFFERS']) ? array_column($arResult['OFFERS'], 'OFFER_GROUP', 'ID') : [],
            'OFFER_GROUP' => $arResult['OFFER_GROUP'],
            'OFFERS_IBLOCK' => $arResult['OFFERS_IBLOCK'],
         ),
         'LINK_SALES' => $arResult['STOCK'],
         'LINK_SERVICES' => $arResult['SERVICES'],
         'LINK_NEWS' => $arResult['NEWS'],
         'LINK_TIZERS' => $arParams['SECTION_TIZERS'],
         'LINK_REVIEWS' => $arResult['LINK_REVIEWS'],
         'LINK_BLOG' => $arResult['BLOG'],
         'LINK_STAFF' => $arResult['LINK_STAFF'],
         'LINK_VACANCY' => $arResult['LINK_VACANCY'],
         'CATALOG_SETS' => array(
            'SET_ITEMS_QUANTITY' => $arResult["SET_ITEMS_QUANTITY"],
            'SET_ITEMS' => $arResult["SET_ITEMS"]
         ),
         'VIDEO' => $arResult['VIDEO'],
         'ASSOCIATED' => $arResult['ASSOCIATED'],
         'EXPANDABLES' => $arResult['EXPANDABLES'],
         'REVIEWS_COUNT' => $arResult['PROPERTIES']['BLOG_COMMENTS_CNT']['VALUE'],
         'PRODUCT_SET_OPTIONS' => array(
            'PRODUCT_SET' => $bComplect,
            'PRODUCT_SET_FILTER' => $arResult["PROPERTIES"]["PRODUCT_SET_FILTER"]["~VALUE"],
            'PRODUCT_SET_GROUP' => $arResult["PROPERTIES"]["PRODUCT_SET_GROUP"]["VALUE"] === "Y",
         ),
         'XML_ID' => $arResult['XML_ID'],
      );
      unset($currencyList, $templateLibrary);

      if($arResult["PROPERTIES"]["YM_ELEMENT_ID"] && $arResult["PROPERTIES"]["YM_ELEMENT_ID"]["VALUE"])
         $templateData["YM_ELEMENT_ID"] = $arResult["PROPERTIES"]["YM_ELEMENT_ID"]["VALUE"];

      $arSkuTemplate = array();
      if(!empty($arResult['SKU_PROPS']))
         $arSkuTemplate=CMax::GetSKUPropsArray($arResult['SKU_PROPS'], $arResult["SKU_IBLOCK_ID"], "list", $arParams["OFFER_HIDE_NAME_PROPS"], "N", $arResult, $arParams['OFFER_SHOW_PREVIEW_PICTURE_PROPS']);
         //$arSkuTemplate=CMax::GetSKUPropsArray($arResult['SKU_PROPS'], $arResult["SKU_IBLOCK_ID"], "list", $arParams["OFFER_HIDE_NAME_PROPS"]);

      $strMainID = $this->GetEditAreaId($arResult['ID']);
      $strObName = 'ob'.preg_replace("/[^a-zA-Z0-9_]/", "x", $strMainID);

      $arResult["strMainID"] = $this->GetEditAreaId($arResult['ID']);
      $arItemIDs=CMax::GetItemsIDs($arResult, "Y");

      $showCustomOffer=(($arResult['OFFERS'] && $arParams["TYPE_SKU"] !="N") ? true : false);

      if( $showCustomOffer && isset($arResult['OFFERS'][$arResult['OFFERS_SELECTED']]) ){
         $arCurrentSKU = $arResult['OFFERS'][$arResult['OFFERS_SELECTED']];
         $templateData['TOTAL_COUNT'] = $totalCount = CMax::GetTotalCount($arCurrentSKU, $arParams);
         $templateData['QUANTITY_DATA'] = $arQuantityData = CMax::GetQuantityArray($totalCount, array('ID' => $arCurrentSKU["ID"]), ($arParams["USE_STORE"] == "Y" && $arResult["STORES_COUNT"] && $arResult['CATALOG_TYPE'] != CCatalogProduct::TYPE_SET ? "Y" : "N"));
      } else {
         $templateData['TOTAL_COUNT'] = $totalCount = CMax::GetTotalCount($arResult, $arParams);
         $templateData['QUANTITY_DATA'] = $arQuantityData = CMax::GetQuantityArray($totalCount, $arItemIDs["ALL_ITEM_IDS"], ($arParams["USE_STORE"] == "Y" && $arResult["STORES_COUNT"] && $arResult['CATALOG_TYPE'] != CCatalogProduct::TYPE_SET && (!$arResult["OFFERS"] || ($arResult["OFFERS"] && $arParams["TYPE_SKU"]!="N")) ? "Y" : "N"));
      }
      $templateData['ID_OFFER_GROUP'] = $arItemIDs['ALL_ITEM_IDS']['OFFER_GROUP'];

      $arParams["BASKET_ITEMS"]=($arParams["BASKET_ITEMS"] ? $arParams["BASKET_ITEMS"] : array());
      $useStores = $arParams["USE_STORE"] == "Y" && $arResult["STORES_COUNT"] && $arQuantityData["RIGHTS"]["SHOW_QUANTITY"] && $arResult['CATALOG_TYPE'] != CCatalogProduct::TYPE_SET;
      $templateData['STORES']['USE_STORES'] = $useStores;

      if($showCustomOffer)
         $templateData['JS_OBJ'] = $strObName;

      $strMeasure='';
      $arAddToBasketData = array();

      $templateData['STR_ID'] = $strObName;
      $item_id = $arResult["ID"];

      $currentSKUID = $currentSKUIBlock = '';

      $bUseSkuProps = ($arResult["OFFERS"] && !empty($arResult['OFFERS_PROP']));
      $popupVideo = $arResult['PROPERTIES']['POPUP_VIDEO']['VALUE'];
      $bOfferDetailText = false;
      if( $showCustomOffer && isset($arResult['OFFERS'][$arResult['OFFERS_SELECTED']]) ){
         //$arCurrentSKU = $arResult['OFFERS'][$arResult['OFFERS_SELECTED']];
         $item_id = $arCurrentSKU["ID"];
         $bOfferDetailText = $arParams['SHOW_SKU_DESCRIPTION'] === 'Y' && $arCurrentSKU["DETAIL_TEXT"];
         if(strlen($arParams["SKU_DETAIL_ID"]))
            $arResult['DETAIL_PAGE_URL'].= '?'.$arParams["SKU_DETAIL_ID"].'='.$arCurrentSKU['ID'];
         $templateData["OFFERS_INFO"]["CURRENT_OFFER"] = $arCurrentSKU["ID"];   
         $templateData["OFFERS_INFO"]["CURRENT_OFFER_TITLE"] = $arCurrentSKU['IPROPERTY_VALUES']["ELEMENT_PAGE_TITLE"] ?? $arCurrentSKU["NAME"];
         $templateData["OFFERS_INFO"]["CURRENT_OFFER_WINDOW_TITLE"] = $arCurrentSKU['IPROPERTY_VALUES']["ELEMENT_META_TITLE"] ?? $templateData["OFFERS_INFO"]["CURRENT_OFFER_TITLE"];

         $templateData["CURRENT_OFFER_SIZE"] = str_replace("х","x",trim($arCurrentSKU['DISPLAY_PROPERTIES']['RAZMER']["VALUE"]));
         if ($arCurrentSKU["DISPLAY_PROPERTIES"]["ARTICLE"]["VALUE"]) {
            $arCurrentSKU['DISPLAY_PROPERTIES']['ARTICLE']["VALUE"] = (is_array($arCurrentSKU['DISPLAY_PROPERTIES']['ARTICLE']["VALUE"]) ? reset($arCurrentSKU['DISPLAY_PROPERTIES']['ARTICLE']["VALUE"]) : $arCurrentSKU['DISPLAY_PROPERTIES']['ARTICLE']["VALUE"]);
              $article = $arCurrentSKU['DISPLAY_PROPERTIES']['ARTICLE'];
            unset($arCurrentSKU['DISPLAY_PROPERTIES']['ARTICLE']);
          } elseif($arParams['SHOW_ARTICLE_SKU'] === 'Y') {
            $article = $arResult["CML2_ARTICLE"];
         }
         if($arCurrentSKU['PROPERTIES']['POPUP_VIDEO']['VALUE']){
            $popupVideo = $arCurrentSKU['PROPERTIES']['POPUP_VIDEO']['VALUE'];
         }
         $arResult['OFFER_PROP'] = $arCurrentSKU['DISPLAY_PROPERTIES'];
         CIBlockPriceTools::clearProperties($arResult['OFFER_PROP'], $arParams['OFFER_TREE_PROPS']);
         $arResult['OFFER_PROP'] = CMax::PrepareItemProps($arResult['OFFER_PROP']);
      } else {
         $article = $arResult["CML2_ARTICLE"];
         $templateData["CURRENT_OFFER_SIZE"] = str_replace("х","x",trim($arResult['PROPERTIES']['GARN_D_S_razmer_spalnogo_m']["VALUE"]));
         
      }

      if($arResult["OFFERS"])
      {
         $strMeasure=$arResult["MIN_PRICE"]["CATALOG_MEASURE_NAME"];
         $templateData["STORES"]["OFFERS"]="Y";

         if($showCustomOffer){
            $currentSKUIBlock = $arResult["OFFERS"][$arResult["OFFERS_SELECTED"]]["IBLOCK_ID"];
            $currentSKUID = $arResult["OFFERS"][$arResult["OFFERS_SELECTED"]]["ID"];
            $arResult["OFFERS"][$arResult["OFFERS_SELECTED"]]["IS_OFFER"] = "Y";

            /* need for add basket props */
            $arResult["OFFERS"][$arResult["OFFERS_SELECTED"]]["IBLOCK_ID"] = $arResult['IBLOCK_ID'];
            /* */
            // for current offer buy block
            $arAddToBasketData = CMax::GetAddToBasketArray($arResult["OFFERS"][$arResult["OFFERS_SELECTED"]], $totalCount, $arParams["DEFAULT_COUNT"], $arParams["BASKET_URL"], false, $arItemIDs["ALL_ITEM_IDS"], 'btn-lg', $arParams);
            /* restore IBLOCK_ID */
            $arResult["OFFERS"][$arResult["OFFERS_SELECTED"]]["IBLOCK_ID"] = $currentSKUIBlock;
            /* */
         }
      }
      else
      {
         if(($arParams["SHOW_MEASURE"]=="Y")&&($arResult["CATALOG_MEASURE"]))
         {
            $arMeasure = CCatalogMeasure::getList(array(), array("ID"=>$arResult["CATALOG_MEASURE"]), false, false, array())->GetNext();
            $strMeasure=$arMeasure["SYMBOL_RUS"];
         }
         $arAddToBasketData = CMax::GetAddToBasketArray($arResult, $totalCount, $arParams["DEFAULT_COUNT"], $arParams["BASKET_URL"], true, $arItemIDs["ALL_ITEM_IDS"], 'btn-lg', $arParams);
      }
      $arOfferProps = implode(';', $arParams['OFFERS_CART_PROPERTIES']);

      // save item viewed
      $arFirstPhoto = reset($arResult['MORE_PHOTO']);
      $viwedItem = $arCurrentSKU ?? $arResult;
      $arItemPrices = $viwedItem['MIN_PRICE'];   
      if(isset($viwedItem['PRICE_MATRIX']) && $viwedItem['PRICE_MATRIX'])
      {
         $rangSelected = $viwedItem['ITEM_QUANTITY_RANGE_SELECTED'];
         $priceSelected = $viwedItem['ITEM_PRICE_SELECTED'];
         if(isset($viwedItem['FIX_PRICE_MATRIX']) && $viwedItem['FIX_PRICE_MATRIX'])
         {
            $rangSelected = $viwedItem['FIX_PRICE_MATRIX']['RANGE_SELECT'];
            $priceSelected = $viwedItem['FIX_PRICE_MATRIX']['PRICE_SELECT'];
         }
         $arItemPrices = $viwedItem['ITEM_PRICES'][$priceSelected];
         $arItemPrices['VALUE'] = $arItemPrices['BASE_PRICE'];
         $arItemPrices['PRINT_VALUE'] = \Aspro\Functions\CAsproMaxItem::getCurrentPrice('BASE_PRICE', $arItemPrices);
         $arItemPrices['DISCOUNT_VALUE'] = $arItemPrices['PRICE'];
         $arItemPrices['PRINT_DISCOUNT_VALUE'] = \Aspro\Functions\CAsproMaxItem::getCurrentPrice('PRICE', $arItemPrices);
      }
      $arViewedData = array(
         'PRODUCT_ID' => $arResult['ID'],
         'IBLOCK_ID' => $viwedItem['IBLOCK_ID'],
         'NAME' => $viwedItem['NAME'],
         'DETAIL_PAGE_URL' => $viwedItem['DETAIL_PAGE_URL'],
         'PICTURE_ID' => $viwedItem['PREVIEW_PICTURE'] ? $viwedItem['PREVIEW_PICTURE']['ID'] : ($arFirstPhoto ? $arFirstPhoto['ID'] : false),
         'CATALOG_MEASURE_NAME' => $viwedItem['CATALOG_MEASURE_NAME'],
         'MIN_PRICE' => $arItemPrices,
         'CAN_BUY' => $viwedItem['CAN_BUY'] ? 'Y' : 'N',
         'IS_OFFER' => $arCurrentSKU ? 'Y' : 'N',
         'WITH_OFFERS' => $arResult['OFFERS'] && !isset($arCurrentSKU) ? 'Y' : 'N',
      );

      $actualItem = $arResult["OFFERS"] ? (isset($arResult['OFFERS'][$arResult['OFFERS_SELECTED']]) ? $arResult['OFFERS'][$arResult['OFFERS_SELECTED']] : reset($arResult['OFFERS'])) : $arResult;

      if($arResult["OFFERS"] && $arParams["TYPE_SKU"]=="N")
         unset($templateData['STORES']);
      $offerPropCount = $arParams["VISIBLE_PROP_WITH_OFFER"] ==="Y" && is_array($arResult['OFFER_PROP']) ? count($arResult['OFFER_PROP']) : 0;
      $iCountProps = count($arResult['DISPLAY_PROPERTIES']) + $offerPropCount;
      ?>

      <?if($arResult["OFFERS"] && $arParams["TYPE_SKU"]=="N"):?>
         <?$templateData['OFFERS_INFO']['OFFERS_MORE'] = true;?>
         <?
         $showSkUName = ((in_array('NAME', $arParams['OFFERS_FIELD_CODE'])));
         $showSkUImages = false;
         if(((in_array('PREVIEW_PICTURE', $arParams['OFFERS_FIELD_CODE']) || in_array('DETAIL_PICTURE', $arParams['OFFERS_FIELD_CODE']))))
         {
            foreach ($arResult["OFFERS"] as $key => $arSKU)
            {
               if($arSKU['PREVIEW_PICTURE'] || $arSKU['DETAIL_PICTURE'])
               {
                  $showSkUImages = true;
                  break;
               }
            }
         }?>      
         
      <?endif;?>

   
      

      

            

   <div class="form_head">
      <h2>Товар в корзине</h2>
   </div>   
   <div class="form_body">
      <div class="flexbox flexbox--row">               
         <div class="product-img flex-50">
            <a href="<?=$href?>">
               <img src="<?=($arFirstPhoto["SMALL"]["src"] ? $arFirstPhoto["SMALL"]["src"] : $arFirstPhoto["SRC"]);?>">
            </a>   
         </div>

         <div class="product-info flex-50">                  
            
            
            <?$isArticle=(strlen($article["VALUE"]) || ($arResult['SHOW_OFFERS_PROPS'] && $showCustomOffer));?>                        
            <?if($isArticle):?>                        
               <div class="article muted font_xs" itemprop="additionalProperty" itemscope itemtype="http://schema.org/PropertyValue" <?if(!strlen($article["VALUE"])){?>id="<? echo $arItemIDs["ALL_ITEM_IDS"]['DISPLAY_PROP_ARTICLE_DIV'] ?>" style="display: none;"<?}?>>
                  <span class="article__title" itemprop="name"><?=$article["NAME"];?>:</span>
                  <span class="article__value" itemprop="value"><?=$article["VALUE"]?></span>
                  <br>
               </div>                              
            <?endif;?>
            <a href="<?=$href?>"><h3><?=$title?></h3></a>
            <div >                              
                  <?if($bComplect):?>
                     <div class="complect_prices_block">
                        <div class="cost prices detail prices_block">
                           <div class="prices-wrapper">
                              <div class="price font-bold font_mxs">
                                 <div class="price_value_block values_wrapper">
                                    <span class="price_value complect_price_value">0</span>                                    
                                    <span class="price_currency">
                                       <?// print_r($arResult["CURRENCIES"]);?>
                                       <?=str_replace("999", "", \CCurrencyLang::CurrencyFormat("999", $arResult["CURRENCIES"][0]["CURRENCY"]))?>
                                    </span>
                                 </div>
                              </div>
                           </div>
                        </div>
                        <div class="buy_complect_wrap hidden">
                           <span data-currency="RUB" class="button_buy_complect opt_action btn btn-default btn-sm no-action" data-action="buy" data-iblock_id="<?=$arParams["IBLOCK_ID"]?>"><span><?=\Bitrix\Main\Config\Option::get("aspro.max", "EXPRESSION_ADDTOBASKET_BUTTON_DEFAULT", GetMessage("EXPRESSION_ADDTOBASKET_BUTTON_DEFAULT"));?></span></span>
                        </div>
                        <span class="btn btn-default btn-lg type_block has-ripple choise btn-wide" data-block=".js-scroll-complect"><span><?=Loc::getMessage("COMPLECT_BUTTON")?></span></span>
                     </div>
                  <?else:?>
                     <?$frame = $this->createFrame()->begin('');?>

                        <?//composite fix for offers?>
                        <?/*
                        <?if($arResult["OFFERS"] && $showCustomOffer):?>
                           <?$arItemJSParams=CMax::GetSKUJSParams($arResult, $arParams, $arResult, "Y");?>

                           <script type="text/javascript">
                              var <? echo $arItemIDs["strObName"]; ?> = new JCCatalogElement(<? echo CUtil::PhpToJSObject($arItemJSParams, false, true); ?>);
                           </script>
                        <?endif;?>
                        <?*/?>
                        <?//dicount timer?>
                        <?if($arParams["SHOW_DISCOUNT_TIME"]=="Y"){?>
                           <?$arUserGroups = $USER->GetUserGroupArray();?>
                           <?$arDiscount = []?>
                           <?if($arParams['SHOW_DISCOUNT_TIME_EACH_SKU'] != 'Y' || ($arParams['SHOW_DISCOUNT_TIME_EACH_SKU'] == 'Y' && (!$arResult['OFFERS'] || ($arResult['OFFERS'] && $arParams['TYPE_SKU'] != 'TYPE_1')))):?>
                              <?\Aspro\Functions\CAsproMax::showDiscountCounter($totalCount, $arDiscount, $arQuantityData, $arResult, $strMeasure, 'compact red', $arResult["ID"]);?>
                           <?else:?>
                              <?\Aspro\Functions\CAsproMax::showDiscountCounter($totalCount, $arDiscount, $arQuantityData, $arResult, $strMeasure, 'compact red', $item_id);?>
                           <?endif;?>
                        <?}?>
                        <div class="prices_block">
                           <?//prices?>
                           <div class="cost prices detail">
                              <?if($arResult["OFFERS"]):?>
                              <? //alexandr plusnin
                                 //   if(isset($arResult["PROPERTIES"]["MAXIMUM_PRICE"]["VALUE"])){
                                 //$oldprice=rtrim(rtrim(number_format($arResult["PROPERTIES"]["MAXIMUM_PRICE"]["VALUE"], 2, ',', ' '), '\0'), '\,').' руб.';
                                 //   echo '<div class="price-old"><s>'.$oldprice.'</s></div>'; 
                                 //   }
                              ?>
                                 <?=\Aspro\Functions\CAsproMaxItem::showItemPricesDefault($arParams);?>
                                 <div class="js_price_wrapper">
                                    <?if($arCurrentSKU):?>
                                       <?$arParams['HIDE_PRICE'] = false?>
                                       <?
                                       $arCurrentSKU['CATALOG_MEASURE_NAME'] = $arCurrentSKU['MEASURE'];
                                       if(isset($arCurrentSKU['PRICE_MATRIX']) && $arCurrentSKU['PRICE_MATRIX'] && $arCurrentSKU['ITEM_PRICE_MODE'] == 'Q'): // USE_PRICE_COUNT?>
                                          <?if (!$arParams['USE_PRICE_COUNT']):?>
                                             <?$arParams['HIDE_PRICE'] = true?>
                                             <?\Aspro\Functions\CAsproMaxItem::showItemPrices($arParams, $arCurrentSKU["PRICES"], $strMeasure, $min_price_id, ($arParams["SHOW_DISCOUNT_PERCENT_NUMBER"] == "Y" ? "N" : "Y"));?>
                                          <?endif;?>
                                          <?if($arCurrentSKU['ITEM_PRICE_MODE'] == 'Q' && count($arCurrentSKU['PRICE_MATRIX']['ROWS']) > 1):?>
                                             <?=CMax::showPriceRangeTop($arCurrentSKU, $arParams, Loc::getMessage("CATALOG_ECONOMY"));?>
                                          <?endif;?>
                                          <?if ($arParams['USE_PRICE_COUNT']):?>
                                             <?=CMax::showPriceMatrix($arCurrentSKU, $arParams, $strMeasure, $arAddToBasketData);?>
                                          <?endif;?>
                                       <?else:?>
                                          <?\Aspro\Functions\CAsproMaxItem::showItemPrices($arParams, $arCurrentSKU["PRICES"], $strMeasure, $min_price_id, ($arParams["SHOW_DISCOUNT_PERCENT_NUMBER"] == "Y" ? "N" : "Y"));?>
                                       <?endif;?>
                                    <?else:?>
                                          <?\Aspro\Functions\CAsproMaxSku::showItemPrices($arParams, $arResult, $item_id, $min_price_id, $arItemIDs, ($arParams["SHOW_DISCOUNT_PERCENT_NUMBER"] == "Y" ? "N" : "Y"));?>
                                    <?endif;?>
                                 </div>
                              <?else:?>
                                 <?if(isset($arResult['PRICE_MATRIX']) && $arResult['PRICE_MATRIX']): // USE_PRICE_COUNT?>
                                    <?if(\CMax::GetFrontParametrValue('SHOW_POPUP_PRICE') == 'Y' || $arResult['ITEM_PRICE_MODE'] == 'Q' || (\CMax::GetFrontParametrValue('SHOW_POPUP_PRICE') != 'Y' && $arResult['ITEM_PRICE_MODE'] != 'Q' && count($arResult['PRICE_MATRIX']['COLS']) <= 1)):?>
                                       <?=CMax::showPriceRangeTop($arResult, $arParams, Loc::getMessage("CATALOG_ECONOMY"));?>
                                    <?endif;?>
                                    <?if(count($arResult['PRICE_MATRIX']['ROWS']) > 1 || count($arResult['PRICE_MATRIX']['COLS']) > 1):?>
                                       <?=CMax::showPriceMatrix($arResult, $arParams, $strMeasure, $arAddToBasketData);?>
                                    <?endif;?>
                                 <?elseif(isset($arResult["PRICES"])):?>
                                    <?\Aspro\Functions\CAsproMaxItem::showItemPrices($arParams, $arResult["PRICES"], $strMeasure, $min_price_id, ($arParams["SHOW_DISCOUNT_PERCENT_NUMBER"] == "Y" ? "N" : "Y"));?>
                                 <?endif;?>
                              <?endif;?>
                           </div>
                           <div class="" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
                              <meta itemprop="price" content="<?=($arResult['MIN_PRICE']['DISCOUNT_VALUE'] ? $arResult['MIN_PRICE']['DISCOUNT_VALUE'] : $arResult['MIN_PRICE']['VALUE'])?>" />
                              <meta itemprop="priceCurrency" content="<?=$arResult['MIN_PRICE']['CURRENCY']?>" />
                              <link itemprop="availability" href="http://schema.org/<?=($templateData['TOTAL_COUNT'] ? 'InStock' : 'OutOfStock')?>" />
                              <?
                              if($arDiscount["ACTIVE_TO"]){?>
                                 <meta itemprop="priceValidUntil" content="<?=date("Y-m-d", MakeTimeStamp($arDiscount["ACTIVE_TO"]))?>" />
                              <?}?>
                              <link itemprop="url" href="<?=$arResult["DETAIL_PAGE_URL"]?>" />
                           </div>
                           
                           <?//for product wo POPUP_PRICE in fixed header?>
                           <?if($arParams['SHOW_POPUP_PRICE'] !== "Y" && !$arResult["OFFERS"]):?>
                              <script>
                                 <?if(isset($arResult['PRICE_MATRIX']) && $arResult['PRICE_MATRIX']): // USE_PRICE_COUNT?>
                                    <?$priceHtml = CMax::showPriceMatrix($arResult, $arParams, $strMeasure, $arAddToBasketData);?>
                                    <?$countPricesMatrix = count($arResult['PRICE_MATRIX']['MATRIX'])?>
                                    <?$countPricesRows = count($arResult['PRICE_MATRIX']['ROWS'])?>
                                    <?$countPrices = ($countPricesMatrix > $countPricesRows ? $countPricesMatrix : $countPricesRows)?>
                                    BX.message({
                                       ASPRO_ITEM_PRICE_MATRIX: <?=CUtil::PhpToJSObject($priceHtml, false, true);?>
                                    })
                                 <?elseif($arResult["PRICES"]):?>
                                    <?$priceHtml = \Aspro\Functions\CAsproMaxItem::showItemPrices($arParams, $arResult["PRICES"], $strMeasure, $min_price_id, ($arParams["SHOW_DISCOUNT_PERCENT_NUMBER"] == "Y" ? "N" : "Y"), false, true);?>
                                    <?$countPrices = count($arResult['PRICES'])?>
                                    BX.message({
                                       ASPRO_ITEM_PRICE: <?=CUtil::PhpToJSObject($priceHtml, false, true);?>
                                    })
                                 <?endif;?>
                                 BX.message({
                                    ASPRO_ITEM_POPUP_PRICE: 'Y',
                                    ASPRO_ITEM_PRICES: <?=$countPrices;?>
                                 })
                              </script>
                           <?endif;?>

                           <?//for offer product wo POPUP_PRICE in fixed header?>
                           <?if($arParams['SHOW_POPUP_PRICE'] !== "Y" && $arCurrentSKU):?>
                              <script>
                                 <?if(isset($arCurrentSKU['PRICE_MATRIX']) && $arCurrentSKU['PRICE_MATRIX']): // USE_PRICE_COUNT?>
                                    <?$priceHtml = CMax::showPriceMatrix($arCurrentSKU, $arParams, $strMeasure, $arAddToBasketData);?>
                                    <?$countPricesMatrix = count($arCurrentSKU['PRICE_MATRIX']['MATRIX'])?>
                                    <?$countPricesRows = count($arCurrentSKU['PRICE_MATRIX']['ROWS'])?>
                                    <?$countPrices = ($countPricesMatrix > $countPricesRows ? $countPricesMatrix : $countPricesRows)?>
                                    BX.message({
                                       ASPRO_ITEM_PRICE_MATRIX: <?=CUtil::PhpToJSObject($priceHtml, false, true);?>
                                    })
                                 <?elseif($arCurrentSKU["PRICES"]):?>
                                    <?$priceHtml = \Aspro\Functions\CAsproMaxItem::showItemPrices($arParams, $arCurrentSKU["PRICES"], $strMeasure, $min_price_id, ($arParams["SHOW_DISCOUNT_PERCENT_NUMBER"] == "Y" ? "N" : "Y"), false, true);?>
                                    <?$countPrices = count($arCurrentSKU['PRICES'])?>
                                    BX.message({
                                       ASPRO_ITEM_PRICE: <?=CUtil::PhpToJSObject($priceHtml, false, true);?>
                                    })
                                 <?endif;?>
                                 BX.message({
                                    ASPRO_ITEM_POPUP_PRICE: 'Y',
                                    ASPRO_ITEM_PRICES: <?=$countPrices;?>
                                 })
                              </script>
                           <?endif;?>

                           <?//stock?>
                           <div class="quantity_block_wrapper">
                              <?=$arQuantityData["HTML"];?>                                          
                           </div>
                        </div>

                        <?//buttons?>   
                                                   
                     <?$frame->end();?>
                  <?endif;?>                           
            </div>                           
                              
         </div>
      </div>   
      <div class="flexbox flexbox--row to-order-page-wrapper">         
         <a href="/basket/" class="btn-lg in-cart to-order-page btn btn-default transition_bg has-ripple" >Оформить заказ</a>            
      </div>   
      <div class="flexbox flexbox--row to-order-page-wrapper">            
         <a href="#" class="btn-lg in-cart to-order-page btn  transition_bg has-ripple  jqmClose" >Продолжить покупки </a>            
      </div>   
   </div>   
component_epilog.php
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
   __IncludeLang($_SERVER["DOCUMENT_ROOT"].$templateFolder."/lang/".LANGUAGE_ID."/template.php");

use Bitrix\Main\Loader,
   Bitrix\Main\ModuleManager,
   Bitrix\Main\Localization\Loc;

global $arTheme, $arRegion;

$arBlockOrder = explode(",", $arParams["DETAIL_BLOCKS_ORDER"]);
$arTabOrder = explode(",", $arParams["DETAIL_BLOCKS_TAB_ORDER"]);

//add new blocks in update
if( !in_array('buy_services', $arTabOrder) ){
   $arTabOrder[] = 'buy_services';
}

$bCombineStoresMode = ($arTheme['STORE_AMOUNT_VIEW']['VALUE'] == "COMBINE_AMOUNT");

$bServicesRegionality = $arTheme['SERVICES_REGIONALITY']['VALUE'] === 'Y' && $arTheme['USE_REGIONALITY']['VALUE'] === 'Y' && $arTheme['USE_REGIONALITY']['DEPENDENT_PARAMS']['REGIONALITY_FILTER_ITEM']['VALUE'] === 'Y';

if($arTheme['USE_DETAIL_TABS']['VALUE'] != 'Y'){
   $arBlockOrder = explode(",", $arParams["DETAIL_BLOCKS_ALL_ORDER"]);
   
   //add new blocks in update
   if( !in_array('buy_services', $arBlockOrder) ){
      $arBlockOrder[] = 'buy_services';
   }
}

//add new blocks in update
if( !in_array('modules', $arBlockOrder) ){
   $arBlockOrder[] = 'modules';
}

$currentProductId = $templateData['OFFERS_INFO']["CURRENT_OFFER"] ?? $arResult['ID'] ;

?>
<?if($arResult["ID"]):?>
   <?//sales?>


   

   <?$i = 0;
   $templateData["STORES"]["SITE_ID"] = SITE_ID;
   $bShowDocs = false;
   $bShowAdditionalGallery = false;
   $bShowDetailText = false;
   $bShowDetailTextTab = false;
   $bShowPropsTab = false;
   $bShowVideoTab = false;
   $bShowFaqTab = false;
   $bShowProjecTab = false;
   $bShowHowBuyTab = false;
   $bShowPaymentTab = false;
   $bShowDeliveryTab = false;
   $bShowCustomTab = false;
   $bShowStoresTab = false;
   $bShowReviewsTab = false;
   $bShowBuyServicesTab = false;

   if($bShowPropsTab && $arParams["PROPERTIES_DISPLAY_LOCATION"] != "TAB")
      --$i;?>

   <div class="maxwidth-theme ">
      <div class="bottom-info product-view--side-left">
         <?foreach($arBlockOrder as $code):?>
            <?//complect?>
            <?if($code == 'complect' && $templateData['CATALOG_SETS']['SET_ITEMS'] && $arParams['SHOW_KIT_PARTS'] == "Y"):?>   
            <?elseif($code == 'nabor'):?>
            <?elseif($code == 'tabs'):?>
            <?elseif($code == 'offers' && $templateData["OFFERS_INFO"]["OFFERS_MORE"]):?>
            <?elseif($code == 'desc' && $bShowDetailTextTab):?>
            <?elseif($code == 'char' && $bShowPropsTab):?>
            <?elseif($code == 'buy' && $bShowHowBuyTab):?>
            <?elseif($code == 'payment' && $bShowPaymentTab):?>
            <?elseif($code == 'delivery' && $bShowDeliveryTab):?>
            <?elseif($code == "video" && $bShowVideoTab):?>            
            <?elseif($code == "buy_services" && $bShowBuyServicesTab):?>            
            <?elseif($code == "reviews" && $bShowReviewsTab):?>            
            <?elseif($code == 'custom_tabs' && $bShowCustomTab):?>            
            <?elseif($code == 'gifts'):?>            
            <?elseif($code == 'stores' && $bShowStoresTab):?>
            <?elseif($code == 'services' && $templateData['LINK_SERVICES']):?>
            <?elseif($code == 'news' && $templateData['LINK_NEWS']):?>
            <?elseif($code == 'blog' && $templateData['LINK_BLOG']):?>
            <?elseif($code == 'staff' && $templateData['LINK_STAFF']):?>
            <?elseif($code == 'vacancy' && $templateData['LINK_VACANCY']):?>
            <?elseif($code == 'modules'):?>
            <?elseif($code == 'goods'):?>
               <?if($arParams['DETAIL_LINKED_GOODS_TABS'] != 'N'):?>
                  <?//tabs mode?>
                  <div class="ordered-block <?=$code?>">
                     <?$bNavTabs = false;?>
                     <?if($templateData['EXPANDABLES']):?>
                        <?
                        $bShowAssociatedTab = \Aspro\Functions\CAsproMax::checkAvailable($templateData['ASSOCIATED'], array('REGION'), $arParams);
                        $bShowExpandablesTab = \Aspro\Functions\CAsproMax::checkAvailable($templateData['EXPANDABLES'], array('REGION'), $arParams);
                        ?>
                        <?if($bShowAssociatedTab || $bShowExpandablesTab):?>
                           <div class="tabs arrow_scroll bottom-line" data-plugin-options='{"axis": "x", "scrollInertia": 200, "snapAmount": 70, "scrollButtons": {"enable": true}}'>
                              <ul class="nav nav-tabs">
                                 <?if($bShowAssociatedTab):?>
                                    <li class="active"><a href="#assoc" data-toggle="tab" class="linked"><?=$arParams["DETAIL_ASSOCIATED_TITLE"];?></a></li>
                                 <?endif;?>
                                 <?if($bShowExpandablesTab):?>
                                    <li class="<?=$bShowAssociatedTab ? '' : 'active'?>"><a href="#expandables" data-toggle="tab" class="linked"><?=$arParams["DETAIL_EXPANDABLES_TITLE"];?></a></li>
                                 <?endif;?>
                              </ul>
                           </div>
                        <div class="tab-content">
                        <?$bNavTabs = true;?>
                        <?endif;?>
                     <?endif;?>                     
                     <?if($templateData['EXPANDABLES']):?>
                        <?
                        $bShowExpandablesTab = \Aspro\Functions\CAsproMax::checkAvailable($templateData['EXPANDABLES'], array('REGION'), $arParams);
                        ?>
                        <?if($bShowExpandablesTab):?>
                           <?if($bNavTabs):?>
                              <div class="tab-pane <?=(!$templateData['ASSOCIATED'] ? "active cur" : "");?>" id="expandables">
                           <?else:?>
                              <div class="ordered-block__title option-font-bold font_lg">
                                 <?=$arParams["DETAIL_EXPANDABLES_TITLE"];?>
                              </div>
                              <div class="cur">
                           <?endif;?>

                              <div class="expandables-block" data-block="expandables" data-file="<?=$APPLICATION->GetCurURI()?>" id="mattress-list">
                                 
                                 <?//CMax::checkRestartBuffer(true, 'expandables');?>
                                    <?//if(CMax::checkAjaxRequest()):?>
                                       <?//if(!$templateData['ASSOCIATED'])
                                          //$APPLICATION->ShowAjaxHead();?>
                                    <?$GLOBALS['arrProductsFilter'] = [];?>
                                    <?$GLOBALS['arrProductsFilter'] = $templateData['EXPANDABLES'];?>
                                    <?$arParams["CURRENT_OFFER_SIZE"] = $templateData["CURRENT_OFFER_SIZE"]?>
                                    <?include($_SERVER['DOCUMENT_ROOT'].SITE_DIR.'include/detail.linked_products_block_custom.php');?>
                                    <?//endif;?>
                                 <?//CMax::checkRestartBuffer(true, 'expandables');?>
                              </div>

                           </div>
                        <?endif;?>
                     <?endif;?>

                     <?if($templateData['ASSOCIATED'] && $templateData['EXPANDABLES']):?>
                        <?if($bShowAssociatedTab || $bShowExpandablesTab):?>
                           </div>
                        <?endif;?>
                     <?endif;?>
                  </div>
               <?else:?>                  
                  <?if($templateData['EXPANDABLES']):?>
                     <?
                     $bShowExpandablesTab = \Aspro\Functions\CAsproMax::checkAvailable($templateData['EXPANDABLES'], array('REGION'), $arParams);
                     ?>
                     <?if($bShowExpandablesTab): //блок матрасы?>
                        <div class="ordered-block <?=$code?> cur">
                           <div class="ordered-block__title option-font-bold font_lg test">
                              <?=$arParams["DETAIL_EXPANDABLES_TITLE"];?>
                           </div>
                           <div class="expandables-block" data-block="expandables" data-file="<?=$APPLICATION->GetCurURI()?>" id="mattress-list">
                              
                              <?//CMax::checkRestartBuffer(true, 'expandables');?>
                                 <?//if(CMax::checkAjaxRequest()):?>
                                    <?//$APPLICATION->ShowAjaxHead();?>
                                    <?$GLOBALS['arrProductsFilter'] = [];?>
                                    <?$GLOBALS['arrProductsFilter'] = $templateData['EXPANDABLES'];?>
                                    <?$arParams["CURRENT_OFFER_SIZE"] = $templateData["CURRENT_OFFER_SIZE"]?>
                                    <?include($_SERVER['DOCUMENT_ROOT'].SITE_DIR.'include/detail.linked_products_block_custom.php');?>
                                 <?//endif;?>
                              <?//CMax::checkRestartBuffer(true, 'expandables');?>
                           </div>
                        </div>
                     <?endif;?>
                  <?endif;?>
               <?endif;?>
            <?endif;?>
         <?endforeach;?>
         
      </div>      
   </div>
<?endif;?>
<?if (isset($templateData['TEMPLATE_LIBRARY']) && !empty($templateData['TEMPLATE_LIBRARY'])){
   $loadCurrency = false;
   if (!empty($templateData['CURRENCIES']))
      $loadCurrency = Loader::includeModule('currency');
   CJSCore::Init($templateData['TEMPLATE_LIBRARY']);
   if ($loadCurrency){?>
      <script type="text/javascript">
         BX.Currency.setCurrencies(<? echo $templateData['CURRENCIES']; ?>);
      </script>
   <?}
}?>
<script type="text/javascript">
   
</script>

<?$des = new \Bitrix\Main\Page\FrameStatic('des');$des->startDynamicArea();?>

<?$des->finishDynamicArea();?>
<?if($_GET["RID"]){?><script>$(document).ready(function(){$("<div class='rid_item' data-rid='<?=htmlspecialcharsbx($_GET["RID"]);?>'></div>").appendTo($('body'));});</script><?}?>
<?
if( $templateData["OFFERS_INFO"]["CURRENT_OFFER"] && $arTheme['CHANGE_TITLE_ITEM_DETAIL']['VALUE'] === "Y" ){
   global $currentOfferTitle;
   $currentOfferTitle["CURRENT_OFFER_TITLE"] = $templateData["OFFERS_INFO"]["CURRENT_OFFER_TITLE"];
   $currentOfferTitle["CURRENT_OFFER_WINDOW_TITLE"] = $templateData["OFFERS_INFO"]["CURRENT_OFFER_WINDOW_TITLE"];
}

$arScripts = ['swiper', 'swiper_main_styles'];
\Aspro\Max\Functions\Extensions::init($arScripts);
?>
/bitrix/templates/aspro_max/css/custom.js
#addtobasketSuccessModal .catalog_block .item_block .catalog_item:not(.big) .footer_button,
#addtobasketSuccessModal .catalog_block .item_block .catalog_item:not(.big) .ce_cmp_visible{
    display: none!important;

} 

#addtobasketSuccessModal .to-order-page-wrapper{
    padding: 10px 37px;
}
#addtobasketSuccessModal .in-cart.to-order-page{
    width: 100%;
}
#addtobasketSuccessModal .form_head{
    border-bottom: 1px solid #f2f2f2;
    border-color: var(--stroke_black);
    padding: 35px 37px 24px;
    z-index: 2;
    background: #fff;
    background: var(--black_bg_black);
    position: relative;
}
#addtobasketSuccessModal .product-img{
    padding: 20px 15px;
    display: flex;
    justify-content: center;

}

#addtobasketSuccessModal .catalog_detail .like_icons>div.fast_view_button{
    display: none!important;
}
#addtobasketSuccessModal .product-img img{
    max-height: 300px;
}    

@media screen and (max-width: 991px), projection and (max-width: 991px), tv and (max-width: 991px), handheld and (max-width: 991px){
    .mobile:not(.previewMode) #addtobasketSuccessModal.fast_view_frame.popup {
        display: block!important;
    }
}
@media (max-width: 768px){
    #addtobasketSuccessModal h3{
        font-size: 18px;
    }
    #addtobasketSuccessModal .product-img img{
        max-width: min(200px, 100%);
        max-height: 250px;
    }
}