diff --git a/src/module-elasticsuite-analytics/Block/Adminhtml/Report/CustomerCompanySelector.php b/src/module-elasticsuite-analytics/Block/Adminhtml/Report/CustomerCompanySelector.php new file mode 100644 index 000000000..abdd81d2a --- /dev/null +++ b/src/module-elasticsuite-analytics/Block/Adminhtml/Report/CustomerCompanySelector.php @@ -0,0 +1,120 @@ + + * @copyright 2024 Smile + * @license Open Software License ("OSL") v. 3.0 + */ +namespace Smile\ElasticsuiteAnalytics\Block\Adminhtml\Report; + +use Magento\Framework\Api\SearchCriteriaBuilder; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Module\Manager as ModuleManager; +use Magento\Framework\View\Element\Template; +use Magento\Framework\View\Element\Template\Context; + +/** + * Block used to display customer company selector in reports. + * + * @category Smile + * @package Smile\ElasticsuiteAnalytics + * @author Vadym Honcharuk + */ +class CustomerCompanySelector extends Template +{ + /** + * Company status configuration path. + * + * @var string + */ + const CONFIG_IS_B2B_COMPANY_ACTIVE_XPATH = 'btob/website_configuration/company_active'; + + /** + * @var ScopeConfigInterface + */ + protected $scopeConfig; + + /** + * @var SearchCriteriaBuilder + */ + protected $searchCriteriaBuilder; + + /** + * @var \Magento\Company\Api\CompanyRepositoryInterface|null + */ + private $companyRepository = null; + + /** + * CustomerCompanySelector constructor. + * + * @SuppressWarnings(PHPMD.ElseExpression) + * + * @param Context $context The template context. + * @param ModuleManager $moduleManager Module manager. + * @param ScopeConfigInterface $scopeConfig Scope configuration. + * @param SearchCriteriaBuilder $searchCriteriaBuilder The search criteria builder. + * @param array $data Additional block data. + * @throws LocalizedException + */ + public function __construct( + Context $context, + ModuleManager $moduleManager, + ScopeConfigInterface $scopeConfig, + SearchCriteriaBuilder $searchCriteriaBuilder, + array $data = [] + ) { + $this->scopeConfig = $scopeConfig; + $this->searchCriteriaBuilder = $searchCriteriaBuilder; + + // Check if Magento_Company module is enabled before attempting to load the repository. + if ($moduleManager->isEnabled('Magento_Company')) { + if (interface_exists('\Magento\Company\Api\CompanyRepositoryInterface')) { + $this->companyRepository = ObjectManager::getInstance()->get( + \Magento\Company\Api\CompanyRepositoryInterface::class + ); + } else { + throw new LocalizedException(__('CompanyRepositoryInterface is not available.')); + } + } + + parent::__construct($context, $data); + } + + /** + * Check if the Company feature is enabled. + * + * @return bool + */ + public function isCompanyEnabled() + { + return $this->scopeConfig->isSetFlag( + self::CONFIG_IS_B2B_COMPANY_ACTIVE_XPATH, + \Magento\Store\Model\ScopeInterface::SCOPE_STORE + ); + } + + /** + * Get the list of companies if the Company feature is enabled. + * + * @return CompanyInterface[]|array + * @throws LocalizedException + */ + public function getCompaniesList() + { + if ($this->isCompanyEnabled()) { + $searchCriteria = $this->searchCriteriaBuilder->create(); + + return $this->companyRepository->getList($searchCriteria)->getItems(); // Fetch company list. + } + + return []; + } +} diff --git a/src/module-elasticsuite-analytics/Block/Adminhtml/Report/CustomerGroupSelector.php b/src/module-elasticsuite-analytics/Block/Adminhtml/Report/CustomerGroupSelector.php new file mode 100644 index 000000000..99170e56d --- /dev/null +++ b/src/module-elasticsuite-analytics/Block/Adminhtml/Report/CustomerGroupSelector.php @@ -0,0 +1,60 @@ + + * @copyright 2024 Smile + * @license Open Software License ("OSL") v. 3.0 + */ +namespace Smile\ElasticsuiteAnalytics\Block\Adminhtml\Report; + +use Magento\Framework\View\Element\Template; +use Magento\Customer\Model\ResourceModel\Group\CollectionFactory; + +/** + * Block used to display customer group selector in reports. + * + * @SuppressWarnings(PHPMD.CamelCasePropertyName) + * + * @category Smile + * @package Smile\ElasticsuiteAnalytics + * @author Vadym Honcharuk + */ +class CustomerGroupSelector extends Template +{ + /** + * @var CollectionFactory + */ + protected $customerGroupCollectionFactory; + + /** + * CustomerGroupSelector constructor. + * + * @param Template\Context $context The context of the template. + * @param CollectionFactory $customerGroupCollectionFactory Factory for creating customer group collection. + * @param array $data Additional block data. + */ + public function __construct( + Template\Context $context, + CollectionFactory $customerGroupCollectionFactory, + array $data = [] + ) { + $this->customerGroupCollectionFactory = $customerGroupCollectionFactory; + parent::__construct($context, $data); + } + + /** + * Get customer groups in an option array format. + * + * @return array + */ + public function getCustomerGroups() + { + return $this->customerGroupCollectionFactory->create()->toOptionArray(); + } +} diff --git a/src/module-elasticsuite-analytics/Model/Report/Context.php b/src/module-elasticsuite-analytics/Model/Report/Context.php index b326d5585..74ffd9d49 100644 --- a/src/module-elasticsuite-analytics/Model/Report/Context.php +++ b/src/module-elasticsuite-analytics/Model/Report/Context.php @@ -66,6 +66,26 @@ public function getStoreId() return $this->request->getParam('store'); } + /** + * Get customer group ID. + * + * @return mixed + */ + public function getCustomerGroupId() + { + return $this->request->getParam('customer_group'); + } + + /** + * Get customer company ID. + * + * @return mixed + */ + public function getCustomerCompanyId() + { + return $this->request->getParam('company_id'); + } + /** * Get date range. * diff --git a/src/module-elasticsuite-analytics/Model/Report/Event/CustomerCompanyIdFilterQueryProvider.php b/src/module-elasticsuite-analytics/Model/Report/Event/CustomerCompanyIdFilterQueryProvider.php new file mode 100644 index 000000000..ad3cbe19d --- /dev/null +++ b/src/module-elasticsuite-analytics/Model/Report/Event/CustomerCompanyIdFilterQueryProvider.php @@ -0,0 +1,74 @@ + + * @copyright 2024 Smile + * @license Open Software License ("OSL") v. 3.0 + */ +namespace Smile\ElasticsuiteAnalytics\Model\Report\Event; + +use Smile\ElasticsuiteAnalytics\Model\Report\QueryProviderInterface; +use Smile\ElasticsuiteCore\Search\Request\QueryInterface; +use Smile\ElasticsuiteCore\Search\Request\Query\QueryFactory; +use Smile\ElasticsuiteAnalytics\Model\Report\Context; + +/** + * Customer company id filter query provider. + * + * @category Smile + * @package Smile\ElasticsuiteAnalytics + */ +class CustomerCompanyIdFilterQueryProvider implements QueryProviderInterface +{ + /** + * @var QueryFactory + */ + private $queryFactory; + + /** + * @var Context + */ + private $context; + + /** + * CustomerCompanyIdFilterQueryProvider constructor. + * + * @param QueryFactory $queryFactory Query factory. + * @param Context $context Report context. + */ + public function __construct(QueryFactory $queryFactory, Context $context) + { + $this->queryFactory = $queryFactory; + $this->context = $context; + } + + /** + * {@inheritDoc} + */ + public function getQuery() + { + // Get customer company ID from the context. + $customerCompanyId = $this->context->getCustomerCompanyId(); + + // Check if customer company ID is set and not 'all'. + if ($customerCompanyId !== 'all' && $customerCompanyId !== null) { + // Return a TERM query for the customer company ID. + return $this->queryFactory->create( + QueryInterface::TYPE_TERM, + [ + 'field' => 'customer.company_id', + 'value' => (int) $customerCompanyId, + ] + ); + } + + // If 'all' is selected or no customer company ID is set, return null (no filtering). + return null; + } +} diff --git a/src/module-elasticsuite-analytics/Model/Report/Event/CustomerGroupIdFilterQueryProvider.php b/src/module-elasticsuite-analytics/Model/Report/Event/CustomerGroupIdFilterQueryProvider.php new file mode 100644 index 000000000..74fe09112 --- /dev/null +++ b/src/module-elasticsuite-analytics/Model/Report/Event/CustomerGroupIdFilterQueryProvider.php @@ -0,0 +1,74 @@ + + * @copyright 2024 Smile + * @license Open Software License ("OSL") v. 3.0 + */ +namespace Smile\ElasticsuiteAnalytics\Model\Report\Event; + +use Smile\ElasticsuiteAnalytics\Model\Report\QueryProviderInterface; +use Smile\ElasticsuiteCore\Search\Request\QueryInterface; +use Smile\ElasticsuiteCore\Search\Request\Query\QueryFactory; +use Smile\ElasticsuiteAnalytics\Model\Report\Context; + +/** + * Customer group id filter query provider. + * + * @category Smile + * @package Smile\ElasticsuiteAnalytics + */ +class CustomerGroupIdFilterQueryProvider implements QueryProviderInterface +{ + /** + * @var QueryFactory + */ + private $queryFactory; + + /** + * @var Context + */ + private $context; + + /** + * CustomerGroupIdFilterQueryProvider constructor. + * + * @param QueryFactory $queryFactory Query factory. + * @param Context $context Report context. + */ + public function __construct(QueryFactory $queryFactory, Context $context) + { + $this->queryFactory = $queryFactory; + $this->context = $context; + } + + /** + * {@inheritDoc} + */ + public function getQuery() + { + // Get customer group ID from the context. + $customerGroupId = $this->context->getCustomerGroupId(); + + // Check if customer group ID is set and not 'all'. + if ($customerGroupId !== 'all' && $customerGroupId !== null) { + // Return a TERM query for the customer group ID. + return $this->queryFactory->create( + QueryInterface::TYPE_TERM, + [ + 'field' => 'customer.group_id', + 'value' => (int) $customerGroupId, + ] + ); + } + + // If 'all' is selected or no customer group ID is set, return null (no filtering). + return null; + } +} diff --git a/src/module-elasticsuite-analytics/Model/Report/Session/CustomerCompanyIdFilterQueryProvider.php b/src/module-elasticsuite-analytics/Model/Report/Session/CustomerCompanyIdFilterQueryProvider.php new file mode 100644 index 000000000..6b933c70f --- /dev/null +++ b/src/module-elasticsuite-analytics/Model/Report/Session/CustomerCompanyIdFilterQueryProvider.php @@ -0,0 +1,81 @@ + + * @copyright 2024 Smile + * @license Open Software License ("OSL") v. 3.0 + */ +namespace Smile\ElasticsuiteAnalytics\Model\Report\Session; + +use Smile\ElasticsuiteAnalytics\Model\Report\QueryProviderInterface; +use Smile\ElasticsuiteCore\Search\Request\QueryInterface; +use Smile\ElasticsuiteCore\Search\Request\Query\QueryFactory; +use Smile\ElasticsuiteAnalytics\Model\Report\Context; + +/** + * Customer company id filter query provider. + * + * @category Smile + * @package Smile\ElasticsuiteAnalytics + */ +class CustomerCompanyIdFilterQueryProvider implements QueryProviderInterface +{ + /** + * @var QueryFactory + */ + private $queryFactory; + + /** + * @var Context + */ + private $context; + + /** + * CustomerCompanyIdFilterQueryProvider constructor. + * + * @param QueryFactory $queryFactory Query factory. + * @param Context $context Report context. + */ + public function __construct(QueryFactory $queryFactory, Context $context) + { + $this->queryFactory = $queryFactory; + $this->context = $context; + } + + /** + * {@inheritDoc} + */ + public function getQuery() + { + // Get customer company ID from the context. + $customerCompanyId = $this->context->getCustomerCompanyId(); + + // Check if customer company ID is set and not 'all'. + if ($customerCompanyId !== 'all' && $customerCompanyId !== null) { + // Return a TERM query for the customer company ID. + return $this->queryFactory->create( + QueryInterface::TYPE_BOOL, + [ + 'must' => [ + $this->queryFactory->create( + QueryInterface::TYPE_TERM, + [ + 'field' => 'customer_company_id', + 'value' => (int) $customerCompanyId, + ] + ), + ], + ] + ); + } + + // If 'all' is selected or no customer company ID is set, return null (no filtering). + return null; + } +} diff --git a/src/module-elasticsuite-analytics/Model/Report/Session/CustomerGroupIdFilterQueryProvider.php b/src/module-elasticsuite-analytics/Model/Report/Session/CustomerGroupIdFilterQueryProvider.php new file mode 100644 index 000000000..2a5f5b48a --- /dev/null +++ b/src/module-elasticsuite-analytics/Model/Report/Session/CustomerGroupIdFilterQueryProvider.php @@ -0,0 +1,81 @@ + + * @copyright 2024 Smile + * @license Open Software License ("OSL") v. 3.0 + */ +namespace Smile\ElasticsuiteAnalytics\Model\Report\Session; + +use Smile\ElasticsuiteAnalytics\Model\Report\QueryProviderInterface; +use Smile\ElasticsuiteCore\Search\Request\QueryInterface; +use Smile\ElasticsuiteCore\Search\Request\Query\QueryFactory; +use Smile\ElasticsuiteAnalytics\Model\Report\Context; + +/** + * Customer group id filter query provider. + * + * @category Smile + * @package Smile\ElasticsuiteAnalytics + */ +class CustomerGroupIdFilterQueryProvider implements QueryProviderInterface +{ + /** + * @var QueryFactory + */ + private $queryFactory; + + /** + * @var Context + */ + private $context; + + /** + * CustomerGroupIdFilterQueryProvider constructor. + * + * @param QueryFactory $queryFactory Query factory. + * @param Context $context Report context. + */ + public function __construct(QueryFactory $queryFactory, Context $context) + { + $this->queryFactory = $queryFactory; + $this->context = $context; + } + + /** + * {@inheritDoc} + */ + public function getQuery() + { + // Get customer group ID from the context. + $customerGroupId = $this->context->getCustomerGroupId(); + + // Check if customer group ID is set and not 'all'. + if ($customerGroupId !== 'all' && $customerGroupId !== null) { + // Return a TERM query for the customer group ID. + return $this->queryFactory->create( + QueryInterface::TYPE_BOOL, + [ + 'must' => [ + $this->queryFactory->create( + QueryInterface::TYPE_TERM, + [ + 'field' => 'customer_group_id', + 'value' => (int) $customerGroupId, + ] + ), + ], + ] + ); + } + + // If 'all' is selected or no customer group ID is set, return null (no filtering). + return null; + } +} diff --git a/src/module-elasticsuite-analytics/etc/di.xml b/src/module-elasticsuite-analytics/etc/di.xml index ef4acea8b..63c07dbe0 100755 --- a/src/module-elasticsuite-analytics/etc/di.xml +++ b/src/module-elasticsuite-analytics/etc/di.xml @@ -23,6 +23,8 @@ Smile\ElasticsuiteAnalytics\Model\Report\Event\DateFilterQueryProvider + Smile\ElasticsuiteAnalytics\Model\Report\Event\CustomerGroupIdFilterQueryProvider + Smile\ElasticsuiteAnalytics\Model\Report\Event\CustomerCompanyIdFilterQueryProvider @@ -41,6 +43,8 @@ Smile\ElasticsuiteAnalytics\Model\Report\Session\DateFilterQueryProvider + Smile\ElasticsuiteAnalytics\Model\Report\Session\CustomerGroupIdFilterQueryProvider + Smile\ElasticsuiteAnalytics\Model\Report\Session\CustomerCompanyIdFilterQueryProvider tracking_log_session @@ -51,7 +55,7 @@ Smile\ElasticsuiteAnalytics\Model\Search\Usage\Kpi\ConversionRates\SearchRequestBuilder - + @@ -60,10 +64,12 @@ Smile\ElasticsuiteAnalytics\Model\Report\Event\DateFilterQueryProvider + Smile\ElasticsuiteAnalytics\Model\Report\Event\CustomerGroupIdFilterQueryProvider + Smile\ElasticsuiteAnalytics\Model\Report\Event\CustomerCompanyIdFilterQueryProvider - + Smile\ElasticsuiteAnalytics\Model\Search\Usage\Terms\PopularTerms\SearchRequestBuilder @@ -72,7 +78,7 @@ - + @@ -82,10 +88,12 @@ Smile\ElasticsuiteAnalytics\Model\Search\Usage\Terms\SpellcheckedTerms\QueryProvider Smile\ElasticsuiteAnalytics\Model\Report\Event\DateFilterQueryProvider + Smile\ElasticsuiteAnalytics\Model\Report\Event\CustomerGroupIdFilterQueryProvider + Smile\ElasticsuiteAnalytics\Model\Report\Event\CustomerCompanyIdFilterQueryProvider - + Smile\ElasticsuiteAnalytics\Model\Search\Usage\Terms\SpellcheckedTerms\SearchRequestBuilder @@ -94,7 +102,7 @@ - + @@ -104,10 +112,12 @@ Smile\ElasticsuiteAnalytics\Model\Report\Session\DateFilterQueryProvider + Smile\ElasticsuiteAnalytics\Model\Report\Session\CustomerGroupIdFilterQueryProvider + Smile\ElasticsuiteAnalytics\Model\Report\Session\CustomerCompanyIdFilterQueryProvider - + Smile\ElasticsuiteAnalytics\Model\Search\Usage\Terms\NoResultTerms\SearchRequestBuilder @@ -122,6 +132,8 @@ Smile\ElasticsuiteAnalytics\Model\Report\Session\DateFilterQueryProvider + Smile\ElasticsuiteAnalytics\Model\Report\Session\CustomerGroupIdFilterQueryProvider + Smile\ElasticsuiteAnalytics\Model\Report\Session\CustomerCompanyIdFilterQueryProvider diff --git a/src/module-elasticsuite-analytics/view/adminhtml/layout/smile_elasticsuite_analytics_search_usage.xml b/src/module-elasticsuite-analytics/view/adminhtml/layout/smile_elasticsuite_analytics_search_usage.xml index 087d04dba..0c3b80a1e 100644 --- a/src/module-elasticsuite-analytics/view/adminhtml/layout/smile_elasticsuite_analytics_search_usage.xml +++ b/src/module-elasticsuite-analytics/view/adminhtml/layout/smile_elasticsuite_analytics_search_usage.xml @@ -26,6 +26,13 @@ false + + + + + + + diff --git a/src/module-elasticsuite-analytics/view/adminhtml/requirejs-config.js b/src/module-elasticsuite-analytics/view/adminhtml/requirejs-config.js new file mode 100644 index 000000000..e713a74b5 --- /dev/null +++ b/src/module-elasticsuite-analytics/view/adminhtml/requirejs-config.js @@ -0,0 +1,20 @@ +/** + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Smile ElasticSuite to newer + * versions in the future. + * + * @category Smile + * @package Smile\ElasticsuiteAnalytics + * @author Vadym Honcharuk + * @copyright 2024 Smile + * @license Open Software License ("OSL") v. 3.0 + */ +var config = { + map: { + '*': { + 'customerGroupSelector': 'Smile_ElasticsuiteAnalytics/js/report/customer-group-selector', + 'customerCompanySelector': 'Smile_ElasticsuiteAnalytics/js/report/customer-company-selector' + } + } +}; diff --git a/src/module-elasticsuite-analytics/view/adminhtml/templates/report/customer_company_selector.phtml b/src/module-elasticsuite-analytics/view/adminhtml/templates/report/customer_company_selector.phtml new file mode 100644 index 000000000..b871b4230 --- /dev/null +++ b/src/module-elasticsuite-analytics/view/adminhtml/templates/report/customer_company_selector.phtml @@ -0,0 +1,40 @@ + + * @copyright 2024 Smile + * @license Open Software License ("OSL") v. 3.0 + */ +?> + + +isCompanyEnabled()): ?> + getCompaniesList(); ?> +
+ + +
+ + + diff --git a/src/module-elasticsuite-analytics/view/adminhtml/templates/report/customer_group_selector.phtml b/src/module-elasticsuite-analytics/view/adminhtml/templates/report/customer_group_selector.phtml new file mode 100644 index 000000000..b004c3bc5 --- /dev/null +++ b/src/module-elasticsuite-analytics/view/adminhtml/templates/report/customer_group_selector.phtml @@ -0,0 +1,38 @@ + + * @copyright 2024 Smile + * @license Open Software License ("OSL") v. 3.0 + */ +?> + +getCustomerGroups(); +?> +
+ + +
+ + diff --git a/src/module-elasticsuite-analytics/view/adminhtml/web/css/source/_module.less b/src/module-elasticsuite-analytics/view/adminhtml/web/css/source/_module.less index fc3f9eafb..2fef48e3e 100644 --- a/src/module-elasticsuite-analytics/view/adminhtml/web/css/source/_module.less +++ b/src/module-elasticsuite-analytics/view/adminhtml/web/css/source/_module.less @@ -69,4 +69,38 @@ } } } + + .page-main-actions { + display: block; + } + + .customer-group-selector { + color: #41362f; + float: left; + font-size: 1.3rem; + margin-top: .59rem; + margin-left: 4rem; + } + + .customer-group-selector label { + margin-right: 1rem; + font-weight: 700; + } + + .customer-company-selector { + color: #41362f; + float: left; + font-size: 1.3rem; + margin-top: .59rem; + margin-left: 2rem; + } + + .customer-company-selector label { + margin-right: 1rem; + font-weight: 700; + } + + .page-actions-inner { + margin-top: .59rem; + } } diff --git a/src/module-elasticsuite-analytics/view/adminhtml/web/js/report/customer-company-selector.js b/src/module-elasticsuite-analytics/view/adminhtml/web/js/report/customer-company-selector.js new file mode 100644 index 000000000..40c5bb880 --- /dev/null +++ b/src/module-elasticsuite-analytics/view/adminhtml/web/js/report/customer-company-selector.js @@ -0,0 +1,42 @@ +/** + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Smile ElasticSuite to newer + * versions in the future. + * + * @category Smile + * @package Smile\ElasticsuiteAnalytics + * @author Vadym Honcharuk + * @copyright 2024 Smile + * @license Open Software License ("OSL") v. 3.0 + */ + +define('Smile_ElasticsuiteAnalytics/js/report/customer-company-selector', [ + 'jquery', + 'mage/url' +], function($, urlBuilder) { + 'use strict'; + + return function() { + // On document ready, set the selected value in the company dropdown. + $(document).ready(function() { + var urlParams = new URLSearchParams(window.location.search); + var selectedCompany = urlParams.get('company_id'); + + if (selectedCompany) { + $('#company_id').val(selectedCompany); + } + }); + + // Handle the company dropdown value change. + $('#company_id').on('change', function() { + var selectedCompany = $(this).val(); + var newUrl = new URL(window.location.href); + + newUrl.searchParams.set('company_id', selectedCompany); + + // Redirect to the new URL with the company filter. + window.location.href = newUrl.href; + }); + }; +}); diff --git a/src/module-elasticsuite-analytics/view/adminhtml/web/js/report/customer-group-selector.js b/src/module-elasticsuite-analytics/view/adminhtml/web/js/report/customer-group-selector.js new file mode 100644 index 000000000..54089bc0e --- /dev/null +++ b/src/module-elasticsuite-analytics/view/adminhtml/web/js/report/customer-group-selector.js @@ -0,0 +1,43 @@ +/** + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Smile ElasticSuite to newer + * versions in the future. + * + * @category Smile + * @package Smile\ElasticsuiteAnalytics + * @author Vadym Honcharuk + * @copyright 2024 Smile + * @license Open Software License ("OSL") v. 3.0 + */ + +define('Smile_ElasticsuiteAnalytics/js/report/customer-group-selector', [ + 'jquery', + 'mage/url' +], function($, urlBuilder) { + 'use strict'; + + return function() { + // !On document ready, set the selected value in the customer group dropdown. + $(document).ready(function() { + var urlParams = new URLSearchParams(window.location.search); + var selectedGroup = urlParams.get('customer_group'); + + if (selectedGroup) { + $('#customer_group').val(selectedGroup); + } + }); + + // Handle the customer group dropdown value change. + $('#customer_group').on('change', function() { + var selectedGroup = $(this).val(); + var newUrl = new URL(window.location.href); + + newUrl.searchParams.set('customer_group', selectedGroup); + + // Redirect to the new URL with the customer group filter. + window.location.href = newUrl.href; + }); + }; +}); + diff --git a/src/module-elasticsuite-catalog/view/frontend/templates/layer/filter/default.phtml b/src/module-elasticsuite-catalog/view/frontend/templates/layer/filter/default.phtml index 19ef63858..e777f02bc 100644 --- a/src/module-elasticsuite-catalog/view/frontend/templates/layer/filter/default.phtml +++ b/src/module-elasticsuite-catalog/view/frontend/templates/layer/filter/default.phtml @@ -25,7 +25,7 @@ getCount() > 0): ?> isMultipleSelectEnabled()) : ?> - getIsSelected()) : ?>checked /> + getIsSelected()) : ?>checked /> getLabel() ?> helper('\Magento\Catalog\Helper\Data')->shouldDisplayProductCountOnLayer()): ?> diff --git a/src/module-elasticsuite-catalog/view/frontend/web/template/attribute-filter.html b/src/module-elasticsuite-catalog/view/frontend/web/template/attribute-filter.html index 2793c85ef..5a93e548b 100644 --- a/src/module-elasticsuite-catalog/view/frontend/web/template/attribute-filter.html +++ b/src/module-elasticsuite-catalog/view/frontend/web/template/attribute-filter.html @@ -11,8 +11,7 @@
  • + data-bind="checked: is_selected, attr: {id: id}, click: function(data, event) { event.target.parentNode.click(); return true; }" />