File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
app/code/Magento/Catalog/Ui/DataProvider/Product Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 7
7
8
8
use Magento \Catalog \Model \ResourceModel \Product \CollectionFactory ;
9
9
use Magento \Framework \App \ObjectManager ;
10
+ use Magento \Store \Model \Store ;
10
11
use Magento \Ui \DataProvider \Modifier \ModifierInterface ;
11
12
use Magento \Ui \DataProvider \Modifier \PoolInterface ;
12
13
@@ -67,6 +68,7 @@ public function __construct(
67
68
$ this ->addFieldStrategies = $ addFieldStrategies ;
68
69
$ this ->addFilterStrategies = $ addFilterStrategies ;
69
70
$ this ->modifiersPool = $ modifiersPool ?: ObjectManager::getInstance ()->get (PoolInterface::class);
71
+ $ this ->setDefaultStoreToCollection ();
70
72
}
71
73
72
74
/**
@@ -140,4 +142,12 @@ public function getMeta()
140
142
141
143
return $ meta ;
142
144
}
145
+
146
+ /**
147
+ * Filter the product collection by Default Store if no filter is applied
148
+ */
149
+ private function setDefaultStoreToCollection ()
150
+ {
151
+ $ this ->getCollection ()->setStoreId (Store::DEFAULT_STORE_ID );
152
+ }
143
153
}
You can’t perform that action at this time.
0 commit comments