@@ -32,21 +32,29 @@ class Menu extends \Magento\Framework\App\Helper\AbstractHelper
32
32
*/
33
33
protected $ categoryCollectionFactory ;
34
34
35
+ /**
36
+ * @var \Magento\Store\Model\StoreManagerInterface
37
+ */
38
+ protected $ storeManager ;
39
+
35
40
/**
36
41
* @param \Magento\Framework\App\Helper\Context $context
37
42
* @param \Magefan\Blog\Model\Url $url
38
43
* @param \Magento\Framework\Registry $registry
39
44
* @param \Magefan\Blog\Model\ResourceModel\Category\CollectionFactory $categoryCollectionFactory
45
+ * @param \Magento\Store\Model\StoreManagerInterface $storeManager
40
46
*/
41
47
public function __construct (
42
48
\Magento \Framework \App \Helper \Context $ context ,
43
49
\Magefan \Blog \Model \Url $ url ,
44
50
\Magento \Framework \Registry $ registry ,
45
- \Magefan \Blog \Model \ResourceModel \Category \CollectionFactory $ categoryCollectionFactory
51
+ \Magefan \Blog \Model \ResourceModel \Category \CollectionFactory $ categoryCollectionFactory ,
52
+ \Magento \Store \Model \StoreManagerInterface $ storeManager
46
53
) {
47
54
$ this ->url = $ url ;
48
55
$ this ->registry = $ registry ;
49
56
$ this ->categoryCollectionFactory = $ categoryCollectionFactory ;
57
+ $ this ->storeManager = $ storeManager ;
50
58
parent ::__construct ($ context );
51
59
}
52
60
@@ -134,6 +142,7 @@ protected function getGroupedChilds()
134
142
{
135
143
return $ this ->categoryCollectionFactory ->create ()
136
144
->addActiveFilter ()
145
+ ->addStoreFilter ($ this ->storeManager ->getStore ()->getId ())
137
146
->addFieldToFilter ('include_in_menu ' , 1 )
138
147
->setOrder ('position ' )
139
148
->getTreeOrderedArray ();
0 commit comments