@@ -38,19 +38,6 @@ public function __construct(
38
38
parent ::__construct ($ context );
39
39
}
40
40
41
- /**
42
- * Resolve store id
43
- *
44
- * Tries to take store id from store HTTP parameter
45
- * @see Store
46
- *
47
- * @return int
48
- */
49
- private function resolveStoreId () : int
50
- {
51
- return (int ) $ this ->getRequest ()->getParam ('store ' , Store::DEFAULT_STORE_ID );
52
- }
53
-
54
41
/**
55
42
* Initialize requested category and put it into registry.
56
43
* Root category can be returned, if inappropriate store/category is specified
@@ -87,7 +74,7 @@ protected function _initCategory($getRootInstead = false)
87
74
$ this ->_objectManager ->get (\Magento \Framework \Registry::class)->register ('category ' , $ category );
88
75
$ this ->_objectManager ->get (\Magento \Framework \Registry::class)->register ('current_category ' , $ category );
89
76
$ this ->_objectManager ->get (\Magento \Cms \Model \Wysiwyg \Config::class)
90
- ->setStoreId ($ this -> getRequest ()-> getParam ( ' store ' ) );
77
+ ->setStoreId ($ storeId );
91
78
return $ category ;
92
79
}
93
80
@@ -96,13 +83,28 @@ protected function _initCategory($getRootInstead = false)
96
83
*
97
84
* @return int
98
85
*/
99
- private function resolveCategoryId ()
86
+ private function resolveCategoryId () : int
100
87
{
101
88
$ categoryId = (int )$ this ->getRequest ()->getParam ('id ' , false );
102
89
103
90
return $ categoryId ?: (int )$ this ->getRequest ()->getParam ('entity_id ' , false );
104
91
}
105
92
93
+ /**
94
+ * Resolve store id
95
+ *
96
+ * Tries to take store id from store HTTP parameter
97
+ * @see Store
98
+ *
99
+ * @return int
100
+ */
101
+ private function resolveStoreId () : int
102
+ {
103
+ $ storeId = (int )$ this ->getRequest ()->getParam ('store ' , false );
104
+
105
+ return $ storeId ?: (int )$ this ->getRequest ()->getParam ('store_id ' , Store::DEFAULT_STORE_ID );
106
+ }
107
+
106
108
/**
107
109
* Build response for ajax request
108
110
*
0 commit comments