konratnox
5/25/2016 - 10:05 AM

Псведостатика делаем инфоблок с псевдостатикой, у элементов свойства, такие же свойства добавляем для элемента каталога, если хотим, чтобы э

Псведостатика делаем инфоблок с псевдостатикой, у элементов свойства, такие же свойства добавляем для элемента каталога, если хотим, чтобы этот товар выбирался в псевдостатики выводим этот раздел в урлрерайт делаем, чтобы запрос шел на файл для выборки псведо, выковыриваем урл и помешаем в переменную рекуест, потом делаем выборку по коду, находим элемент и смотрим свойства и добавляем в фильтр, передаем в компонент

<? require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php"); ?>
<?

  $IBLOCK_ID_FILTER = 8;
  $saticUrl = htmlspecialcharsbx($_REQUEST['fillter']);
  $staticFilterOb = CIBlockElement::GetList(
    array("SORT" => "ASC"),
    array("IBLOCK_ID" => $IBLOCK_ID_FILTER, "CODE" => $saticUrl, "ACTIVE"=>"Y"),
    false,
    false,
    array("ID", "IBLOCK_ID", "NAME", "DETAIL_PAGE_URL", "PROPERTY_*")
  );

  if ($staticFilterArray = $staticFilterOb->GetNextElement()) {
    global $arrFilter;

    $staticFilterFieldsArray = $staticFilterArray->GetFields();
    $staticFilterPropsArray = $staticFilterArray->GetProperties();

    $APPLICATION->AddChainItem($staticFilterFieldsArray['NAME'], $staticFilterFieldsArray['DETAIL_PAGE_URL']);
    $APPLICATION->SetTitle($staticFilterFieldsArray['NAME']);

    foreach ($staticFilterPropsArray as $key => $staticFilterProps) {
        foreach ($staticFilterProps['VALUE'] as $value) {
            $arrFilter['PROPERTY_'.$key][] = $value;
        }
    }

    $APPLICATION->IncludeComponent(
      "bitrix:catalog.section",
      "pseudoStatic",
      Array(
        "ACTION_VARIABLE" => "action",
        "ADD_PICT_PROP" => "-",
        "ADD_PROPERTIES_TO_BASKET" => "Y",
        "ADD_SECTIONS_CHAIN" => "N",
        "ADD_TO_BASKET_ACTION" => "ADD",
        "AJAX_MODE" => "N",
        "AJAX_OPTION_ADDITIONAL" => "",
        "AJAX_OPTION_HISTORY" => "N",
        "AJAX_OPTION_JUMP" => "N",
        "AJAX_OPTION_STYLE" => "Y",
        "BACKGROUND_IMAGE" => "-",
        "BASKET_URL" => "/personal/basket.php",
        "BROWSER_TITLE" => "-",
        "CACHE_FILTER" => "N",
        "CACHE_GROUPS" => "Y",
        "CACHE_TIME" => "36000000",
        "CACHE_TYPE" => "A",
        "CONVERT_CURRENCY" => "N",
        "DETAIL_URL" => "",
        "DISABLE_INIT_JS_IN_COMPONENT" => "N",
        "DISPLAY_BOTTOM_PAGER" => "Y",
        "DISPLAY_TOP_PAGER" => "N",
        "ELEMENT_SORT_FIELD" => "sort",
        "ELEMENT_SORT_FIELD2" => "id",
        "ELEMENT_SORT_ORDER" => "asc",
        "ELEMENT_SORT_ORDER2" => "desc",
        "FILTER_NAME" => "arrFilter",
        "HIDE_NOT_AVAILABLE" => "N",
        "IBLOCK_ID" => "5",
        "IBLOCK_TYPE" => "golfStore",
        "INCLUDE_SUBSECTIONS" => "Y",
        "LABEL_PROP" => "-",
        "LINE_ELEMENT_COUNT" => "3",
        "MESSAGE_404" => "",
        "MESS_BTN_ADD_TO_BASKET" => "В корзину",
        "MESS_BTN_BUY" => "Купить",
        "MESS_BTN_DETAIL" => "Подробнее",
        "MESS_BTN_SUBSCRIBE" => "Подписаться",
        "MESS_NOT_AVAILABLE" => "Нет в наличии",
        "META_DESCRIPTION" => "-",
        "META_KEYWORDS" => "-",
        "OFFERS_CART_PROPERTIES" => array(),
        "OFFERS_FIELD_CODE" => array("", ""),
        "OFFERS_LIMIT" => "5",
        "OFFERS_PROPERTY_CODE" => array("", ""),
        "OFFERS_SORT_FIELD" => "sort",
        "OFFERS_SORT_FIELD2" => "id",
        "OFFERS_SORT_ORDER" => "asc",
        "OFFERS_SORT_ORDER2" => "desc",
        "PAGER_BASE_LINK_ENABLE" => "N",
        "PAGER_DESC_NUMBERING" => "N",
        "PAGER_DESC_NUMBERING_CACHE_TIME" => "36000",
        "PAGER_SHOW_ALL" => "N",
        "PAGER_SHOW_ALWAYS" => "N",
        "PAGER_TEMPLATE" => ".default",
        "PAGER_TITLE" => "Товары",
        "PAGE_ELEMENT_COUNT" => "30",
        "PARTIAL_PRODUCT_PROPERTIES" => "N",
        "PRICE_CODE" => array(),
        "PRICE_VAT_INCLUDE" => "Y",
        "PRODUCT_DISPLAY_MODE" => "N",
        "PRODUCT_ID_VARIABLE" => "id",
        "PRODUCT_PROPERTIES" => array(),
        "PRODUCT_PROPS_VARIABLE" => "prop",
        "PRODUCT_QUANTITY_VARIABLE" => "",
        "PRODUCT_SUBSCRIPTION" => "N",
        "PROPERTY_CODE" => array("", ""),
        "SECTION_CODE" => "",
        "SECTION_ID" => $_REQUEST["SECTION_ID"],
        "SECTION_ID_VARIABLE" => "SECTION_ID",
        "SECTION_URL" => "",
        "SECTION_USER_FIELDS" => array("", ""),
        "SEF_MODE" => "N",
        "SET_BROWSER_TITLE" => "Y",
        "SET_LAST_MODIFIED" => "N",
        "SET_META_DESCRIPTION" => "Y",
        "SET_META_KEYWORDS" => "Y",
        "SET_STATUS_404" => "N",
        "SET_TITLE" => "Y",
        "SHOW_404" => "N",
        "SHOW_ALL_WO_SECTION" => "Y",
        "SHOW_CLOSE_POPUP" => "N",
        "SHOW_DISCOUNT_PERCENT" => "N",
        "SHOW_OLD_PRICE" => "N",
        "SHOW_PRICE_COUNT" => "1",
        "TEMPLATE_THEME" => "blue",
        "USE_MAIN_ELEMENT_SECTION" => "N",
        "USE_PRICE_COUNT" => "N",
        "USE_PRODUCT_QUANTITY" => "N"
      )
    );
  } else {
    CHTTP::SetStatus("404 Not Found");
    @define("ERROR_404","Y");

    require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
    $APPLICATION->SetPageProperty("NOT_SHOW_NAV_CHAIN", "Y");
    $APPLICATION->SetTitle("404 Страница не найдена");
    ?>
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <div class="page404 row">
                    <div class="col-sm-7 img-holder">
                        <div class="alert-404">
                            Страница не найдена
                        </div>
                        <img src="<?=SITE_TEMPLATE_PATH;?>/images/404.png" alt="">
                    </div>
                    <div class="col-sm-5 text-holder">
                        <p>Данной страницы не существует, возможно она была удалена или перемещена.</p>
                        <p>Вы можете вернуться <a href="" onclick="history.back();">назад</a>, воспользоваться поиском</p>
                        <form action="/search/index.php">
                            <input type="text" name="q" placeholder="Поиск">
                        </form>
                        <p>или перейти на <a href="/">главную страницу</a></p>
                        <p>Для получения подробной консультации свяжитесь с нами по телефону +7 (921) 960-40-06 или e-mail <a href="mailto:support@golfart.ru">support@golfart.ru</a>.</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <style type="text/css">
        
    .page404 {
      padding: 50px 0; }
      @media (min-width: 768px) {
        .page404 {
          padding: 150px 0 120px; } }
      .page404 .img-holder {
        padding: 0;
        position: relative;
        text-align: center; }
        @media (min-width: 992px) {
          .page404 .img-holder {
            text-align: left; } }
        .page404 .img-holder img {
          max-width: 100%; }
        .page404 .img-holder .alert-404 {
          font-size: 28px;
          font-weight: 700;
          text-transform: uppercase; }
          @media (min-width: 992px) {
            .page404 .img-holder .alert-404 {
              position: absolute;
              width: 200px;
              top: 40%;
              right: 0; } }
          @media (min-width: 1200px) {
            .page404 .img-holder .alert-404 {
              right: 10%; } }
      @media (min-width: 768px) {
        .page404 .text-holder {
          padding-top: 70px; } }
      .page404 .text-holder p {
        font-size: 18px; }
        .page404 .text-holder p a {
          color: #cabfb0;
          text-decoration: underline; }
          .page404 .text-holder p a:hover {
            text-decoration: none; }
        .page404 .text-holder p .dottted-link {
          text-decoration: none;
          border-bottom: 2px dotted #cabfb0; }
          .page404 .text-holder p .dottted-link:hover {
            border-bottom: none; }
      .page404 .text-holder input {
        border: 1px solid #d8d8d8;
        font-size: 14px;
        color: #7f7f7f;
        padding: 5px 27px 5px 14px;
        width: 100%;
        background: url(<?=SITE_TEMPLATE_PATH;?>/images/search.png) 98% 50% no-repeat; }
        .page404 .text-holder input:focus, .page404 .text-holder input:active {
          outline: none; }

    </style>
    <?
  }

// die();
  
  // $arrFilter = array('PROPERTY_STATIC_TAGS' => "Подарок для мужчины");
?>
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>