Filter Cache Not Activating

AndreyPopov

Well-Known Member
#2
Hi,
How to build cache for multiple filter like age filter, sub-category filter.
add manually URLs on "URL Settings" tab in "Include URLs" form

or add by hand code to lscache.php crawler file.

for example, I add code to cache all pages of categories and sub-categoriies - &page=xxx
 

AndreyPopov

Well-Known Member
#5
urls must be added in following format:

product/manufacturer/info&manufacturer_id=13&sort=p.date_added&order=DESC&page=6

NOT SEO format!!!!!! NOT "?" in url!!!!!!!! without site name!

in opencart format!!!!

for example:
for https://site.name/index.php?route=product/category&path=18_45

you must add
product/category&path=18_45
and with filter:
product/category&path=18_45&fo14=145



how to add all urls (Attached)
best way is add code to crawler algorithm.

in
catalog/controller/extension/module/lscache.php

at
PHP:
echo 'recache category urls...' . ($cli ? '' : '<br>') . PHP_EOL;
        foreach ($categories_1 as $category_1) {
before:
PHP:
$urls[] = $this->url->link('product/category', 'path=' . $category_1['category_id']);
add
PHP:
    foreach ($filters_1 as $filter_1) {
and edit url like this:
PHP:
$urls[] = $this->url->link('product/category', 'path=' . $category_1['category_id'] . '&' . $filter_1['filter_id'] );
 
Last edited:

AndreyPopov

Well-Known Member
#9
first, that you must understand, by default crawler algorithm use only main category for cache, not sub-categories.
if you have some sub-categories in main category and sub-categories in sub-categories - you need add code to cache all sub-categories

second, before use filter list you must load this list from database, like this
PHP:
$filter_data = array('filter_category_id' => $category_4['category_id']);

I modified lscache.php for my own tasks:
1. add four level sub-categories
2. add recache for pages
3. add recache for catalog (with all pages)
 

Attachments

Top