File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -265,13 +265,21 @@ public function prepareSortableFieldsByCategory($category)
265
265
public function getIdentities ()
266
266
{
267
267
$ identities = [];
268
- foreach ($ this ->_getProductCollection () as $ item ) {
269
- $ identities = array_merge ($ identities , $ item ->getIdentities ());
270
- }
268
+
271
269
$ category = $ this ->getLayer ()->getCurrentCategory ();
272
270
if ($ category ) {
273
271
$ identities [] = Product::CACHE_PRODUCT_CATEGORY_TAG . '_ ' . $ category ->getId ();
274
272
}
273
+
274
+ //Check if category page shows only static block (No products)
275
+ if ($ category ->getData ('display_mode ' ) == Category::DM_PAGE ) {
276
+ return $ identities ;
277
+ }
278
+
279
+ foreach ($ this ->_getProductCollection () as $ item ) {
280
+ $ identities = array_merge ($ identities , $ item ->getIdentities ());
281
+ }
282
+
275
283
return $ identities ;
276
284
}
277
285
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ public function testGetIdentities()
192
192
->will ($ this ->returnValue ($ this ->toolbarMock ));
193
193
194
194
$ this ->assertEquals (
195
- [$ productTag , $ categoryTag ],
195
+ [$ categoryTag , $ productTag ],
196
196
$ this ->block ->getIdentities ()
197
197
);
198
198
$ this ->assertEquals (
You can’t perform that action at this time.
0 commit comments