PHP code example of alex19pov31 / bitrix_facet_helper

1. Go to this page and download the library: Download alex19pov31/bitrix_facet_helper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alex19pov31 / bitrix_facet_helper example snippets




use Alex19pov31\BitrixFacetHelper\FacetFilter;

$facetResult = (new FacetFilter('catalog'))
    ->getList([
        'ACTIVE' => 'Y',
        'PROPERTY_COLOR' => 'brown',
    ]);

$facetResult->getValues();
// Количество элементов после фильтрации
$facetResult->getElementCount();
// Список значений свойства
$facetResult->getProperty('COLOR')->getValues();
// Список значений элементов справочника
$facetResult->getProperty('COLOR')->getDictValues();
//$facetResult['COLOR']->getDictValues();

$facetResult->getProperty('PRICE_BASE')->getMinValue();
$facetResult->getProperty('PRICE_BASE')->getMaxValue();
$facetResult->getProperty('PRICE_BASE')->getOriginMinValue();
$facetResult->getProperty('PRICE_BASE')->getOriginMaxValue();
$facetResult->getProperty('PRICE_BASE')->isValidValues();