File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
app/code/Magento/Catalog/Model/Layer/Filter/DataProvider Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -112,13 +112,17 @@ public function getCategory()
112
112
/** @var CategoryModel|null $category */
113
113
$ category = null ;
114
114
if ($ this ->categoryId !== null ) {
115
- $ category = $ this ->categoryFactory ->create ()
116
- ->setStoreId (
117
- $ this ->getLayer ()
118
- ->getCurrentStore ()
119
- ->getId ()
120
- )
121
- ->load ($ this ->categoryId );
115
+ if ($ this ->coreRegistry ->registry ('current_category ' )->getId () == $ this ->categoryId ) {
116
+ $ category = $ this ->coreRegistry ->registry ('current_category ' );
117
+ } else {
118
+ $ category = $ this ->categoryFactory ->create ()
119
+ ->setStoreId (
120
+ $ this ->getLayer ()
121
+ ->getCurrentStore ()
122
+ ->getId ()
123
+ )
124
+ ->load ($ this ->categoryId );
125
+ }
122
126
}
123
127
124
128
if ($ category === null || !$ category ->getId ()) {
You can’t perform that action at this time.
0 commit comments