I asked this question because I would like to explain myself better.
In my CMS page I have recalled my custom collection in this way:
$blockProductColl = $block->getLayout()->createBlock('CatalogProductBlock ProductCollection');
$collectionSearch = $blockProductColl->getProductCollectionSearch();
$joinConditions = 'e.entity_id = tier.entity_id';
$collectionSearch->getSelect()->join(
'catalog_product_entity_tier_price as tier',
$joinConditions
)
->where('tier.all_groups = 0')
->where('tier.customer_group_id = '.$groupId.'')
->where('tier.qty <= '.$qtyCollSearch.'')
->where('tier.value <= '.$priceItem.'')
->where('tier.website_id = 0');
I was also able to add layered navigation via the xml file, but I can’t see filters like color, size, price etc …
For the moment this is my code:
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
<update handle="2columns-left"/>
<referenceContainer name="columns" htmlTag="div" htmlClass="page-layout-2columns-left">
<container name="div.sidebar.main" htmlTag="div" htmlClass="sidebar sidebar-main menu-left" after="main">
<container name="sidebar.main" as="sidebar_main" label="Sidebar Main">
<block class="MagentoLayeredNavigationBlockNavigationCategory" type="catalog/layer_view" name="catalog.leftnav" before="-" template="layer/view.phtml">
<action method="setCategoryId"><category_id>2</category_id></action>
</block>
</container>
</container>
</referenceContainer>
</layout>
How can I do to view the filters related to my custom collection?