// Blocklayered: Add missing smarty vars + Improving module installation

This commit is contained in:
mDeflotte
2012-04-02 07:53:56 +00:00
parent 0d76a54bac
commit e7bde101e3
+25 -14
View File
@@ -83,11 +83,12 @@ class BlockLayered extends Module
$this->installIndexableAttributeTable(); $this->installIndexableAttributeTable();
$this->installProductAttributeTable(); $this->installProductAttributeTable();
$this->indexUrl(); if ($products_count < 10000) // Lock indexation if too many products
$this->indexAttribute(); {
$this->indexUrl();
if ($products_count < 10000) // Lock price indexation if too many products $this->indexAttribute();
self::fullPricesIndexProcess(); self::fullPricesIndexProcess();
}
return true; return true;
} }
@@ -3746,16 +3747,26 @@ class BlockLayered extends Module
$selected_filters = $this->getSelectedFilters(); $selected_filters = $this->getSelectedFilters();
$this->getProducts($selected_filters, $products, $nb_products, $p, $n, $pages_nb, $start, $stop, $range); $this->getProducts($selected_filters, $products, $nb_products, $p, $n, $pages_nb, $start, $stop, $range);
$smarty->assign('nb_products', $nb_products); $smarty->assign(
$smarty->assign('category', (object)array('id' => Tools::getValue('id_category_layered', 1))); array(
$pagination_infos = array('pages_nb' => (int)($pages_nb), 'p' => (int)$p, 'n' => (int)$n, 'range' => (int)$range, 'start' => (int)$start, 'stop' => (int)$stop, 'homeSize' => Image::getSize('home'),
'n_array' => ((int)Configuration::get('PS_PRODUCTS_PER_PAGE') != 10) ? array((int)Configuration::get('PS_PRODUCTS_PER_PAGE'), 10, 20, 50) : array(10, 20, 50)); 'nb_products' => $nb_products,
$smarty->assign($pagination_infos); 'category' => (object)array('id' => Tools::getValue('id_category_layered', 1)),
$smarty->assign('comparator_max_item', (int)(Configuration::get('PS_COMPARATOR_MAX_ITEM'))); 'pages_nb' => (int)($pages_nb),
$smarty->assign('products', $products); 'p' => (int)$p,
$smarty->assign('products_per_page', (int)Configuration::get('PS_PRODUCTS_PER_PAGE')); 'n' => (int)$n,
$smarty->assign('static_token', Tools::getToken(false)); 'range' => (int)$range,
'start' => (int)$start,
'stop' => (int)$stop,
'n_array' => ((int)Configuration::get('PS_PRODUCTS_PER_PAGE') != 10) ? array((int)Configuration::get('PS_PRODUCTS_PER_PAGE'), 10, 20, 50) : array(10, 20, 50),
'comparator_max_item' => (int)(Configuration::get('PS_COMPARATOR_MAX_ITEM')),
'products' => $products,
'products_per_page' => (int)Configuration::get('PS_PRODUCTS_PER_PAGE'),
'static_token' => Tools::getToken(false),
'page_name' => 'category',
)
);
// Prevent bug with old template where category.tpl contain the title of the category and category-count.tpl do not exists // Prevent bug with old template where category.tpl contain the title of the category and category-count.tpl do not exists
if (file_exists(_PS_THEME_DIR_.'category-count.tpl')) if (file_exists(_PS_THEME_DIR_.'category-count.tpl'))