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 @@ -318,13 +318,21 @@ public function prepareSortableFieldsByCategory($category)
318
318
public function getIdentities ()
319
319
{
320
320
$ identities = [];
321
- foreach ($ this ->_getProductCollection () as $ item ) {
322
- $ identities = array_merge ($ identities , $ item ->getIdentities ());
323
- }
321
+
324
322
$ category = $ this ->getLayer ()->getCurrentCategory ();
325
323
if ($ category ) {
326
324
$ identities [] = Product::CACHE_PRODUCT_CATEGORY_TAG . '_ ' . $ category ->getId ();
327
325
}
326
+
327
+ //Check if category page shows only static block (No products)
328
+ if ($ category ->getData ('display_mode ' ) == Category::DM_PAGE ) {
329
+ return $ identities ;
330
+ }
331
+
332
+ foreach ($ this ->_getProductCollection () as $ item ) {
333
+ $ identities = array_merge ($ identities , $ item ->getIdentities ());
334
+ }
335
+
328
336
return $ identities ;
329
337
}
330
338
Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ public function testGetIdentities()
179
179
->will ($ this ->returnValue ($ currentCategory ));
180
180
181
181
$ this ->assertEquals (
182
- [$ productTag , $ categoryTag ],
182
+ [$ categoryTag , $ productTag ],
183
183
$ this ->block ->getIdentities ()
184
184
);
185
185
}
You can’t perform that action at this time.
0 commit comments