F
F
Frostik122021-03-23 20:50:01
PHP
Frostik12, 2021-03-23 20:50:01

How to hide a product whose picture is called "000.jpg"?

<?
/**
 * @var $APPLICATION CMain
 */
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/header.php");
$APPLICATION->SetPageProperty("title", "Каталог кровельных материалов");
$APPLICATION->SetPageProperty("keywords", "кровля, черепица");
$APPLICATION->SetPageProperty("description", "Широкий выбор кровли в Пятигорске и Новопавловске.");
$APPLICATION->SetTitle("Кровля.");
?><div class="catalog-page shingles">
  <div class="row">
    <div class="large-9 medium-12 columns">
       <?$APPLICATION->IncludeComponent(
  "bitrix:catalog.section.list",
  "item_list",
  Array(
      
    "ADD_SECTIONS_CHAIN" => "Y",
    "CACHE_GROUPS" => "N",
    "CACHE_TIME" => "36000000",
    "CACHE_TYPE" => "A",
    "COMPOSITE_FRAME_MODE" => "A",
    "COMPOSITE_FRAME_TYPE" => "AUTO",
    "COUNT_ELEMENTS" => "Y",
    "IBLOCK_ID" => 1,
    "IBLOCK_TYPE" => "catalog",
    "SECTION_CODE" => $_REQUEST['SECTION_CODE'],
    "SECTION_FIELDS" => array("ID","CODE",""),
    "SECTION_ID" => $_REQUEST["SECTION_ID"],
    "SECTION_URL" => "#SITE_DIR#/catalog/#SECTION_CODE#/",
    "SECTION_USER_FIELDS" => array("",""),
    "TOP_DEPTH" => 2,
    
    
  )
);

?>



    </div>
    <div class="large-3 float-right columns">
       <? require '.aside.php' ?>
    </div>
  </div>
</div>
 <br><? require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/footer.php"); ?>


Can you please tell me how to hide a product whose detailed picture is called "000.jpg"?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Ex1st, 2021-03-24
@Ex1st

You need to open the component code, you can, for example, the result_modifier.php file, and do the following:
1) Print the incoming $arParams and $arResult array
2) View the exact array key with the element activity parameter and the detailed picture.
3) Write something like the following code (the exact interpretation will depend on the keys in $arParams and $arResult )

foreach ($arResult as $arItem)
if ($arItem['DETAIL_IMAGE']['NAME'] == '000.jpg') {
    $arParams['ACTIVE'] == 'N';
}

S
Sergey, 2021-03-24
@Firsov36

How to hide a product whose image is called "000.jpg"

You ask about the "product", and the code shows the component that displays the sections of the Infoblock
$APPLICATION->IncludeComponent("bitrix:catalog.section.list")

But I can answer your question.
First way: In the settings of the component of the catalog, section or elements, etc. (select the one you need) there is a field: "Array name with filter values"... enter the name of the array. Next, before the component, define this array, which will help filter the output.
The second way: Copy the component template to yourself, add the result_modifier.php file and sorting through the $arResult array, delete unnecessary entries. Link to documentation .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question