public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Catalog\Model\Session $catalogSession, \Magento\Catalog\Model\Config $catalogConfig, ToolbarModel $toolbarModel, \Magento\Framework\Url\EncoderInterface $urlEncoder, \Magento\Catalog\Helper\Product\ProductList $productListHelper, \Magento\Framework\Data\Helper\PostHelper $postDataHelper, \Magento\Framework\Registry $registry, \Celebros\ConversionPro\Helper\Data $helper, \Celebros\ConversionPro\Helper\Search $searchHelper, array $data = []) { $this->registry = $registry; $this->helper = $helper; $this->searchHelper = $searchHelper; parent::__construct($context, $catalogSession, $catalogConfig, $toolbarModel, $urlEncoder, $productListHelper, $postDataHelper, $data); if ($this->helper->isActiveEngine() && $this->helper->isPermittedHandle()) { // set block module name required to use same template as original $this->setModuleName('Magento_Catalog'); // set current page, limit, order to search helper instead of collection $this->searchHelper->setCurrentPage($this->getCurrentPage()); $this->searchHelper->setPageSize($this->getLimit()); $this->setDefaultDirection('asc'); if (!$this->_getData('_current_grid_order') && !$this->_toolbarModel->getOrder() || in_array($this->getCurrentOrder(), ['relevance', 'position'])) { $this->setDefaultDirection('desc'); } $this->searchHelper->setOrder($this->getCurrentOrder(), $this->getCurrentDirection()); $blockData = $this->searchHelper->getToolbarData(); foreach ($blockData->getData() as $key => $param) { $this->setData($key, $param); } } }