@@ -32,21 +32,29 @@ class Menu extends \Magento\Framework\App\Helper\AbstractHelper
3232 */
3333 protected $ categoryCollectionFactory ;
3434
35+ /**
36+ * @var \Magento\Store\Model\StoreManagerInterface
37+ */
38+ protected $ storeManager ;
39+
3540 /**
3641 * @param \Magento\Framework\App\Helper\Context $context
3742 * @param \Magefan\Blog\Model\Url $url
3843 * @param \Magento\Framework\Registry $registry
3944 * @param \Magefan\Blog\Model\ResourceModel\Category\CollectionFactory $categoryCollectionFactory
45+ * @param \Magento\Store\Model\StoreManagerInterface $storeManager
4046 */
4147 public function __construct (
4248 \Magento \Framework \App \Helper \Context $ context ,
4349 \Magefan \Blog \Model \Url $ url ,
4450 \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
4653 ) {
4754 $ this ->url = $ url ;
4855 $ this ->registry = $ registry ;
4956 $ this ->categoryCollectionFactory = $ categoryCollectionFactory ;
57+ $ this ->storeManager = $ storeManager ;
5058 parent ::__construct ($ context );
5159 }
5260
@@ -134,6 +142,7 @@ protected function getGroupedChilds()
134142 {
135143 return $ this ->categoryCollectionFactory ->create ()
136144 ->addActiveFilter ()
145+ ->addStoreFilter ($ this ->storeManager ->getStore ()->getId ())
137146 ->addFieldToFilter ('include_in_menu ' , 1 )
138147 ->setOrder ('position ' )
139148 ->getTreeOrderedArray ();
0 commit comments