$filter_data = array('filter_category_id' => $category_3['category_id']);
$num_pages = $this->CountNumberOfPages($filter_data);
$this->db->query("INSERT INTO " . DB_PREFIX . "lscache_category_urls_list SET lscache_category_url = '" . 'path=' . $category_1['category_id'] . '_' . $category_2['category_id'] . '_' . $category_3['category_id'] . "' ");
$UrlsCount1++;
if($this->lscache->includeSorts) {
foreach($this->lscache->includeSorts as $uri) {
$uri = str_replace('&', '&', $uri);
$this->db->query("INSERT INTO " . DB_PREFIX . "lscache_category_urls_list SET lscache_category_url = '" . 'path=' . $category_1['category_id'] . '_' . $category_2['category_id'] . '_' . $category_3['category_id'] . '&' . $uri . "' ");
$UrlsCount1++;
}
}
for ($num_page = 2 ; $num_page <= $num_pages ; $num_page++ ) {
$this->db->query("INSERT INTO " . DB_PREFIX . "lscache_category_urls_list SET lscache_category_url = '" . 'path=' . $category_1['category_id'] . '_' . $category_2['category_id'] . '_' . $category_3['category_id'] . '&page=' . $num_page . "' ");
$UrlsCount1++;
if($this->lscache->includeSorts) {
foreach($this->lscache->includeSorts as $uri) {
$uri = str_replace('&', '&', $uri);
$this->db->query("INSERT INTO " . DB_PREFIX . "lscache_category_urls_list SET lscache_category_url = '" . 'path=' . $category_1['category_id'] . '_' . $category_2['category_id'] . '_' . $category_3['category_id'] . '&' . $uri . '&page=' . $num_page . "' ");
$UrlsCount1++;
}
}
}
}
$filter_data = array('filter_category_id' => $category_2['category_id']);
$num_pages = $this->CountNumberOfPages($filter_data);
$this->db->query("INSERT INTO " . DB_PREFIX . "lscache_category_urls_list SET lscache_category_url = '" . 'path=' . $category_1['category_id'] . '_' . $category_2['category_id'] . "' ");
$UrlsCount1++;
if($this->lscache->includeSorts) {
foreach($this->lscache->includeSorts as $uri) {
$uri = str_replace('&', '&', $uri);
$this->db->query("INSERT INTO " . DB_PREFIX . "lscache_category_urls_list SET lscache_category_url = '" . 'path=' . $category_1['category_id'] . '_' . $category_2['category_id'] . '&' . $uri . "' ");
$UrlsCount1++;
}
}
for ($num_page = 2 ; $num_page <= $num_pages ; $num_page++ ) {
$this->db->query("INSERT INTO " . DB_PREFIX . "lscache_category_urls_list SET lscache_category_url = '" . 'path=' . $category_1['category_id'] . '_' . $category_2['category_id'] . '&page=' . $num_page . "' ");
$UrlsCount1++;
if($this->lscache->includeSorts) {
foreach($this->lscache->includeSorts as $uri) {
$uri = str_replace('&', '&', $uri);
$this->db->query("INSERT INTO " . DB_PREFIX . "lscache_category_urls_list SET lscache_category_url = '" . 'path=' . $category_1['category_id'] . '_' . $category_2['category_id'] . '&' . $uri . '&page=' . $num_page . "' ");
$UrlsCount1++;
}
}
}
}
$urls[] = $this->url->link('product/category', 'path=' . $category_1['category_id']);
$this->db->query("INSERT INTO " . DB_PREFIX . "lscache_category_urls_list SET lscache_category_url = '" . 'path=' . $category_1['category_id'] . "' ");
$UrlsCount1++;
if($this->lscache->includeSorts) {
foreach($this->lscache->includeSorts as $uri) {
$urls[] = $this->url->link('product/category', 'path=' . $category_1['category_id'] . '&' . $uri );
$uri = str_replace('&', '&', $uri);
$this->db->query("INSERT INTO " . DB_PREFIX . "lscache_category_urls_list SET lscache_category_url = '" . 'path=' . $category_1['category_id'] . '&' . $uri . "' ");
$UrlsCount1++;
}
}
}
$this->db->query("DELETE FROM " . DB_PREFIX . "setting WHERE store_id = '0' AND `code` = 'module_lscache' AND `key` = 'module_lscache_category_recache_status' ");
$this->db->query("INSERT INTO " . DB_PREFIX . "setting SET store_id = '0', `code` = 'module_lscache', `key` = 'module_lscache_category_recache_status', `value` = 'full'");
$this->db->query("DELETE FROM " . DB_PREFIX . "setting WHERE store_id = '0' AND `code` = 'module_lscache' AND `key` = 'module_lscache_category_recache_total' ");
$this->db->query("INSERT INTO " . DB_PREFIX . "setting SET store_id = '0', `code` = 'module_lscache', `key` = 'module_lscache_category_recache_total', `value` = '" . $UrlsCount1 . "' ");
return $UrlsCount1;
}