my etc/frontend/routes.xml is :
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="catalogsearch" frontName="catalogsearch"> <!--front name for the controller-->
<module name="Tagalys_Tglssearch"/>
</route>
</router>
</config>
My controller paths are:
\Tagalys\Tglssearch\Controller\Catalog\Category.php
\Tagalys\Tglssearch\Controller\Catalog\CategoryController.php
\Tagalys\Tglssearch\Controller\CatalogSearch\Result.php
\Tagalys\Tglssearch\Controller\CatalogSearch\ResultController.php
is my layout file name correct ?
catalogsearch_result_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<body>
<referenceBlock name="catalogsearch.leftnav">
<arguments>
<argument name="setTemplate" xsi:type="string">Tagalys_Tglssearch::tagalys_search/filter.phtml</argument>
</arguments>
</referenceBlock>
<referenceBlock name="product_searchlist_toolbar">
<arguments>
<argument name="template" xsi:type="string">Tagalys_Tglssearch::tagalys_toolbar/toolbar.phtml</argument>
</arguments>
</referenceBlock>
</body>
</page>
Because my custom block is not at all getting called
class ListProduct extends \Magento\Catalog\Block\Product\ListProduct
public function __construct(
/*passing all Constructors parameters to the parent class */
\Magento\Catalog\Block\Product\Context $context,
\Magento\Framework\Data\Helper\PostHelper $postDataHelper,
\Magento\Catalog\Model\Layer\Resolver $layerResolver,
CategoryRepositoryInterface $categoryRepository,
\Magento\Framework\Url\Helper\Data $urlHelper,
/*passing all Constructors parameters to the parent class */
\Tagalys\Tglssearch\Helper\Data $tglssearchHelper,
\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $catalogResourceModelProductCollectionFactory,
\Magento\Catalog\Model\Config $catalogConfig,
\Magento\Store\Model\StoreManagerInterface $storeManager,
array $data = []
) {
$this->tglssearchHelper = $tglssearchHelper;
$this->catalogResourceModelProductCollectionFactory = $catalogResourceModelProductCollectionFactory;
$this->catalogConfig = $catalogConfig;
$this->storeManager = $storeManager;
parent::__construct(
$context,
$postDataHelper,
$layerResolver,
$categoryRepository,
$urlHelper,
$data
);
//$this->tglssearchHelper = $tglssearchHelper;
}
protected function _getProductCollection()
{
echo 'My block';
}