File tree Expand file tree Collapse file tree 3 files changed +11
-14
lines changed Expand file tree Collapse file tree 3 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -69,14 +69,12 @@ public function isCategoryFilterVisibleInLayerNavigation(
69
69
/**
70
70
* Get the current store ID
71
71
*
72
- * @return int|null
72
+ * @return int
73
+ *
74
+ * @throws NoSuchEntityException
73
75
*/
74
- private function getStoreId (): ? int
76
+ private function getStoreId (): int
75
77
{
76
- try {
77
- return (int ) $ this ->storeManager ->getStore ()->getId ();
78
- } catch (NoSuchEntityException $ e ) {
79
- return null ;
80
- }
78
+ return (int ) $ this ->storeManager ->getStore ()->getId ();
81
79
}
82
80
}
Original file line number Diff line number Diff line change @@ -48,26 +48,25 @@ class FilterList
48
48
protected $ filters = [];
49
49
50
50
/**
51
- * @var LayerCategoryConfig|null
51
+ * @var LayerCategoryConfig
52
52
*/
53
53
private $ layerCategoryConfig ;
54
54
55
55
/**
56
56
* @param \Magento\Framework\ObjectManagerInterface $objectManager
57
57
* @param FilterableAttributeListInterface $filterableAttributes
58
+ * @param LayerCategoryConfig $layerCategoryConfig
58
59
* @param array $filters
59
- * @param LayerCategoryConfig|null $layerCategoryConfig
60
60
*/
61
61
public function __construct (
62
62
\Magento \Framework \ObjectManagerInterface $ objectManager ,
63
63
FilterableAttributeListInterface $ filterableAttributes ,
64
- array $ filters = [] ,
65
- LayerCategoryConfig $ layerCategoryConfig = null
64
+ LayerCategoryConfig $ layerCategoryConfig ,
65
+ array $ filters = []
66
66
) {
67
67
$ this ->objectManager = $ objectManager ;
68
68
$ this ->filterableAttributes = $ filterableAttributes ;
69
- $ this ->layerCategoryConfig = $ layerCategoryConfig ?:
70
- ObjectManager::getInstance ()->get (LayerCategoryConfig::class);
69
+ $ this ->layerCategoryConfig = $ layerCategoryConfig ;
71
70
72
71
/** Override default filter type models */
73
72
$ this ->filterTypes = array_merge ($ this ->filterTypes , $ filters );
Original file line number Diff line number Diff line change 140
140
</group >
141
141
<group id =" layered_navigation" >
142
142
<field id =" display_category" translate =" label" type =" select" sortOrder =" 15" showInDefault =" 1" showInWebsite =" 1" showInStore =" 1" canRestore =" 1" >
143
- <label >Display Category</label >
143
+ <label >Display Category Filter </label >
144
144
<source_model >Magento\Config\Model\Config\Source\Yesno</source_model >
145
145
</field >
146
146
</group >
You can’t perform that action at this time.
0 commit comments