From d906322915288df1e9c2bcbc145df42226646252 Mon Sep 17 00:00:00 2001 From: mDeflotte Date: Mon, 2 Apr 2012 07:53:56 +0000 Subject: [PATCH] // Blocklayered: Add missing smarty vars + Improving module installation git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14393 b9a71923-0436-4b27-9f14-aed3839534dd --- modules/blocklayered/blocklayered.php | 39 +++++++++++++++++---------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/modules/blocklayered/blocklayered.php b/modules/blocklayered/blocklayered.php index 532f579bd..d63fd3884 100644 --- a/modules/blocklayered/blocklayered.php +++ b/modules/blocklayered/blocklayered.php @@ -83,11 +83,12 @@ class BlockLayered extends Module $this->installIndexableAttributeTable(); $this->installProductAttributeTable(); - $this->indexUrl(); - $this->indexAttribute(); - - if ($products_count < 10000) // Lock price indexation if too many products + if ($products_count < 10000) // Lock indexation if too many products + { + $this->indexUrl(); + $this->indexAttribute(); self::fullPricesIndexProcess(); + } return true; } @@ -3746,16 +3747,26 @@ class BlockLayered extends Module $selected_filters = $this->getSelectedFilters(); $this->getProducts($selected_filters, $products, $nb_products, $p, $n, $pages_nb, $start, $stop, $range); - - $smarty->assign('nb_products', $nb_products); - $smarty->assign('category', (object)array('id' => Tools::getValue('id_category_layered', 1))); - $pagination_infos = array('pages_nb' => (int)($pages_nb), 'p' => (int)$p, 'n' => (int)$n, '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)); - $smarty->assign($pagination_infos); - $smarty->assign('comparator_max_item', (int)(Configuration::get('PS_COMPARATOR_MAX_ITEM'))); - $smarty->assign('products', $products); - $smarty->assign('products_per_page', (int)Configuration::get('PS_PRODUCTS_PER_PAGE')); - $smarty->assign('static_token', Tools::getToken(false)); + + $smarty->assign( + array( + 'homeSize' => Image::getSize('home'), + 'nb_products' => $nb_products, + 'category' => (object)array('id' => Tools::getValue('id_category_layered', 1)), + 'pages_nb' => (int)($pages_nb), + 'p' => (int)$p, + 'n' => (int)$n, + '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 if (file_exists(_PS_THEME_DIR_.'category-count.tpl'))