getConfigGeneral('enable', $storeId) && $this->isModuleOutputEnabled(); } /** * @param $filters * @return mixed */ public function getLayerConfiguration($filters) { $filterParams = $this->_getRequest()->getParams(); foreach ($filterParams as $key => $param) { $filterParams[$key] = htmlspecialchars($param); } $config = new \Magento\Framework\DataObject([ 'active' => array_keys($filterParams), 'params' => $filterParams, 'isCustomerLoggedIn' => $this->objectManager->create('Magento\Customer\Model\Session')->isLoggedIn(), 'isAjax' => $this->ajaxEnabled() ]); $this->getFilterModel()->getLayerConfiguration($filters, $config); return self::jsonEncode($config->getData()); } /** * @return \Mageplaza\LayeredNavigation\Model\Layer\Filter */ public function getFilterModel() { if (!$this->filterModel) { $this->filterModel = $this->objectManager->create('Mageplaza\LayeredNavigation\Model\Layer\Filter'); } return $this->filterModel; } /** * @return \Magento\Framework\ObjectManagerInterface */ public function getObjectManager() { return $this->objectManager; } }