File tree Expand file tree Collapse file tree 4 files changed +8
-9
lines changed Expand file tree Collapse file tree 4 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 12
12
13
13
/**
14
14
* Strategy interface for preparing product collection.
15
+ * @deprecated See elastic search strategy
15
16
*/
16
17
class ProductCollectionPrepareStrategy implements ProductCollectionPrepareStrategyInterface
17
18
{
Original file line number Diff line number Diff line change @@ -38,11 +38,16 @@ public function __construct(
38
38
* Get strategy provider for product collection prepare process.
39
39
*
40
40
* @return ProductCollectionPrepareStrategyInterface
41
+ * @throws \Exception
41
42
*/
42
43
public function getStrategy (): ProductCollectionPrepareStrategyInterface
43
44
{
44
45
if (!isset ($ this ->strategies [$ this ->engineResolver ->getCurrentSearchEngine ()])) {
45
- return $ this ->strategies ['default ' ];
46
+ if ($ this ->strategies ['default ' ]) {
47
+ return $ this ->strategies ['default ' ];
48
+ } else {
49
+ throw new \Exception ('Default product collection strategy not found ' );
50
+ }
46
51
}
47
52
return $ this ->strategies [$ this ->engineResolver ->getCurrentSearchEngine ()];
48
53
}
Original file line number Diff line number Diff line change 208
208
</argument >
209
209
</arguments >
210
210
</type >
211
- <type name =" Magento\CatalogSearch\Model\Advanced\ProductCollectionPrepareStrategyProvider" >
212
- <arguments >
213
- <argument name =" strategies" xsi : type =" array" >
214
- <item name =" default" xsi : type =" object" >Magento\CatalogSearch\Model\Advanced\ProductCollectionPrepareStrategy</item >
215
- <item name =" mysql" xsi : type =" object" >Magento\CatalogSearch\Model\Advanced\ProductCollectionPrepareStrategy</item >
216
- </argument >
217
- </arguments >
218
- </type >
219
211
<virtualType name =" Magento\CatalogSearch\Model\Layer\Category\Context" type =" Magento\Catalog\Model\Layer\Category\Context" >
220
212
<arguments >
221
213
<argument name =" collectionProvider" xsi : type =" object" >Magento\CatalogSearch\Model\Layer\Category\ItemCollectionProvider</argument >
Original file line number Diff line number Diff line change 110
110
<type name =" Magento\CatalogSearch\Model\Advanced\ProductCollectionPrepareStrategyProvider" >
111
111
<arguments >
112
112
<argument name =" strategies" xsi : type =" array" >
113
+ <item name =" default" xsi : type =" object" >Magento\Elasticsearch\Model\Advanced\ProductCollectionPrepareStrategy</item >
113
114
<item name =" elasticsearch5" xsi : type =" object" >Magento\Elasticsearch\Model\Advanced\ProductCollectionPrepareStrategy</item >
114
115
</argument >
115
116
</arguments >
You can’t perform that action at this time.
0 commit comments