protected function BuildListOfProductUrls($categoryPath1) {
$UrlsCount1 = 0;
$this->db->query("CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "lscache_product_urls_list` ( `url_list_id` int(11) NOT NULL AUTO_INCREMENT, `lscache_product_url` varchar(255) NOT NULL, `recache_status` tinyint(1) NOT NULL, PRIMARY KEY (`url_list_id`)) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;");
foreach ($this->model_catalog_product->getProducts() as $result) {
foreach ($this->model_catalog_product->getCategories($result['product_id']) as $category) {
if(isset( $categoryPath1[$category['category_id']] )){
$this->db->query("INSERT INTO " . DB_PREFIX . "lscache_product_urls_list SET lscache_product_url = '" . 'path=' . $categoryPath1[$category['category_id']] . '&product_id=' . $result['product_id'] . "' ");
$UrlsCount1++;
}
}
$this->db->query("INSERT INTO " . DB_PREFIX . "lscache_product_urls_list SET lscache_product_url = '" . 'manufacturer_id=' . $result['manufacturer_id'] . '&product_id=' . $result['product_id'] . "' ");
$UrlsCount1++;
$this->db->query("INSERT INTO " . DB_PREFIX . "lscache_product_urls_list SET lscache_product_url = '" . 'product_id=' . $result['product_id'] . "' ");
$UrlsCount1++;
//Journal3 QuickView url begin
if (defined('JOURNAL3_ACTIVE')) {
$this->db->query("INSERT INTO " . DB_PREFIX . "lscache_product_urls_list SET lscache_product_url = '" . 'product_id=' . $result['product_id'] . '&popup=quickview' . "' ");
$UrlsCount1++;
}
//Journal3 QuickView url end
}
$this->db->query("DELETE FROM " . DB_PREFIX . "setting WHERE store_id = '0' AND `code` = 'module_lscache' AND `key` = 'module_lscache_product_list_recache_status' ");
$this->db->query("INSERT INTO " . DB_PREFIX . "setting SET store_id = '0', `code` = 'module_lscache', `key` = 'module_lscache_product_list_recache_status', `value` = 'full'");
$this->db->query("DELETE FROM " . DB_PREFIX . "setting WHERE store_id = '0' AND `code` = 'module_lscache' AND `key` = 'module_lscache_product_list_recache_total' ");
$this->db->query("INSERT INTO " . DB_PREFIX . "setting SET store_id = '0', `code` = 'module_lscache', `key` = 'module_lscache_product_list_recache_total', `value` = '" . $UrlsCount1 . "' ");
return $UrlsCount1;
}
protected function BuildUrlsListForRecache($FirstItem,$LastItem) {
$UrlsList = array();
for ($num_item = $FirstItem ; $num_item <= $LastItem ; $num_item++ ) {
$PathToRecache = (array)$this->db->query("SELECT `lscache_product_url` FROM `" . DB_PREFIX . "lscache_product_urls_list` WHERE url_list_id = '" . $num_item ."' " );
//Journal3 QuickView url
if (strpos($PathToRecache['row']['lscache_product_url'], 'quickview') !== FALSE) {
$UrlsList[] = $this->url->link('journal3/product', $PathToRecache['row']['lscache_product_url'] );
} else {
$UrlsList[] = $this->url->link('product/product', $PathToRecache['row']['lscache_product_url'] );
}
}
return $UrlsList;
}