From a0bb25fcd9754beb71c3683cd45a3c8af20b205c Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Wed, 26 Sep 2012 09:20:39 +0000 Subject: [PATCH] [-] FO : fixed bug #PSCFV-4092 --- controllers/front/BestSalesController.php | 6 +++++- controllers/front/ManufacturerController.php | 7 ++++++- controllers/front/NewProductsController.php | 6 +++++- controllers/front/PricesDropController.php | 6 +++++- controllers/front/SupplierController.php | 4 ++++ themes/default/best-sales.tpl | 2 ++ themes/default/manufacturer.tpl | 2 ++ themes/default/new-products.tpl | 2 ++ themes/default/prices-drop.tpl | 2 ++ themes/default/supplier.tpl | 4 +++- 10 files changed, 36 insertions(+), 5 deletions(-) diff --git a/controllers/front/BestSalesController.php b/controllers/front/BestSalesController.php index a894bf249..c68d33d18 100644 --- a/controllers/front/BestSalesController.php +++ b/controllers/front/BestSalesController.php @@ -41,7 +41,8 @@ class BestSalesControllerCore extends FrontController 'products' => ProductSale::getBestSales($this->context->language->id, $this->p - 1, $this->n, $this->orderBy, $this->orderWay), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => $nbProducts, - 'homeSize' => Image::getSize('home_default') + 'homeSize' => Image::getSize('home_default'), + 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM') )); $this->setTemplate(_PS_THEME_DIR_.'best-sales.tpl'); @@ -51,6 +52,9 @@ class BestSalesControllerCore extends FrontController { parent::setMedia(); $this->addCSS(_THEME_CSS_DIR_.'product_list.css'); + + if (Configuration::get('PS_COMPARATOR_MAX_ITEM')) + $this->addJS(_THEME_JS_DIR_.'products-comparison.js'); } } diff --git a/controllers/front/ManufacturerController.php b/controllers/front/ManufacturerController.php index 477cc11e7..830acb35d 100644 --- a/controllers/front/ManufacturerController.php +++ b/controllers/front/ManufacturerController.php @@ -34,6 +34,9 @@ class ManufacturerControllerCore extends FrontController { parent::setMedia(); $this->addCSS(_THEME_CSS_DIR_.'product_list.css'); + + if (Configuration::get('PS_COMPARATOR_MAX_ITEM')) + $this->addJS(_THEME_JS_DIR_.'products-comparison.js'); } public function canonicalRedirection($canonicalURL = '') @@ -96,7 +99,9 @@ class ManufacturerControllerCore extends FrontController 'nb_products' => $nbProducts, 'products' => $this->manufacturer->getProducts($this->manufacturer->id, $this->context->language->id, (int)$this->p, (int)$this->n, $this->orderBy, $this->orderWay), 'path' => ($this->manufacturer->active ? Tools::safeOutput($this->manufacturer->name) : ''), - 'manufacturer' => $this->manufacturer)); + 'manufacturer' => $this->manufacturer, + 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')) + ); } /** diff --git a/controllers/front/NewProductsController.php b/controllers/front/NewProductsController.php index 507ed0bef..924933dda 100644 --- a/controllers/front/NewProductsController.php +++ b/controllers/front/NewProductsController.php @@ -33,6 +33,9 @@ class NewProductsControllerCore extends FrontController { parent::setMedia(); $this->addCSS(_THEME_CSS_DIR_.'product_list.css'); + + if (Configuration::get('PS_COMPARATOR_MAX_ITEM')) + $this->addJS(_THEME_JS_DIR_.'products-comparison.js'); } /** @@ -58,7 +61,8 @@ class NewProductsControllerCore extends FrontController 'products' => Product::getNewProducts($this->context->language->id, (int)($this->p) - 1, (int)($this->n), false, $this->orderBy, $this->orderWay), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => (int)($nbProducts), - 'homeSize' => Image::getSize('home_default') + 'homeSize' => Image::getSize('home_default'), + 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM') )); $this->setTemplate(_PS_THEME_DIR_.'new-products.tpl'); diff --git a/controllers/front/PricesDropController.php b/controllers/front/PricesDropController.php index 40cedf41e..ca8d7ccad 100644 --- a/controllers/front/PricesDropController.php +++ b/controllers/front/PricesDropController.php @@ -33,6 +33,9 @@ class PricesDropControllerCore extends FrontController { parent::setMedia(); $this->addCSS(_THEME_CSS_DIR_.'product_list.css'); + + if (Configuration::get('PS_COMPARATOR_MAX_ITEM')) + $this->addJS(_THEME_JS_DIR_.'products-comparison.js'); } /** @@ -51,7 +54,8 @@ class PricesDropControllerCore extends FrontController 'products' => Product::getPricesDrop($this->context->language->id, (int)$this->p - 1, (int)$this->n, false, $this->orderBy, $this->orderWay), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => $nbProducts, - 'homeSize' => Image::getSize('home_default') + 'homeSize' => Image::getSize('home_default'), + 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM') )); $this->setTemplate(_PS_THEME_DIR_.'prices-drop.tpl'); diff --git a/controllers/front/SupplierController.php b/controllers/front/SupplierController.php index 7de05be11..d6bbcc58d 100644 --- a/controllers/front/SupplierController.php +++ b/controllers/front/SupplierController.php @@ -35,6 +35,9 @@ class SupplierControllerCore extends FrontController { parent::setMedia(); $this->addCSS(_THEME_CSS_DIR_.'product_list.css'); + + if (Configuration::get('PS_COMPARATOR_MAX_ITEM')) + $this->addJS(_THEME_JS_DIR_.'products-comparison.js'); } public function canonicalRedirection($canonicalURL = '') @@ -99,6 +102,7 @@ class SupplierControllerCore extends FrontController 'products' => $this->supplier->getProducts($this->supplier->id, $this->context->cookie->id_lang, (int)$this->p, (int)$this->n, $this->orderBy, $this->orderWay), 'path' => ($this->supplier->active ? Tools::safeOutput($this->supplier->name) : ''), 'supplier' => $this->supplier, + 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM') )); } diff --git a/themes/default/best-sales.tpl b/themes/default/best-sales.tpl index 1980d7f33..3d55c5985 100644 --- a/themes/default/best-sales.tpl +++ b/themes/default/best-sales.tpl @@ -33,8 +33,10 @@
{include file="$tpl_dir./product-sort.tpl"}
+ {include file="./product-compare.tpl"} {include file="$tpl_dir./product-list.tpl" products=$products} {include file="$tpl_dir./pagination.tpl"} + {include file="./product-compare.tpl"} {else}

{l s='No top sellers.'}

{/if} diff --git a/themes/default/manufacturer.tpl b/themes/default/manufacturer.tpl index a6d9f085e..203d65bd0 100644 --- a/themes/default/manufacturer.tpl +++ b/themes/default/manufacturer.tpl @@ -46,8 +46,10 @@
{include file="./product-sort.tpl"}
+ {include file="./product-compare.tpl"} {include file="./product-list.tpl" products=$products} {include file="./pagination.tpl"} + {include file="./product-compare.tpl"} {else}

{l s='No products for this manufacturer.'}

{/if} diff --git a/themes/default/new-products.tpl b/themes/default/new-products.tpl index f58d192b6..dad7f7d63 100644 --- a/themes/default/new-products.tpl +++ b/themes/default/new-products.tpl @@ -33,8 +33,10 @@
{include file="./product-sort.tpl"}
+ {include file="./product-compare.tpl"} {include file="./product-list.tpl" products=$products} {include file="./pagination.tpl"} + {include file="./product-compare.tpl"} {else}

{l s='No new products.'}

{/if} diff --git a/themes/default/prices-drop.tpl b/themes/default/prices-drop.tpl index 5628340a8..3205657c8 100644 --- a/themes/default/prices-drop.tpl +++ b/themes/default/prices-drop.tpl @@ -33,8 +33,10 @@
{include file="./product-sort.tpl"}
+ {include file="./product-compare.tpl"} {include file="./product-list.tpl" products=$products} {include file="./pagination.tpl"} + {include file="./product-compare.tpl"} {else}

{l s='No price drop.'}

{/if} diff --git a/themes/default/supplier.tpl b/themes/default/supplier.tpl index 21f228982..a84ff132b 100644 --- a/themes/default/supplier.tpl +++ b/themes/default/supplier.tpl @@ -40,9 +40,11 @@
{include file="$tpl_dir./product-sort.tpl"}
+ {include file="./product-compare.tpl"} {include file="$tpl_dir./product-list.tpl" products=$products} {include file="$tpl_dir./pagination.tpl"} + {include file="./product-compare.tpl"} {else}

{l s='No products for this supplier.'}

{/if} -{/if} \ No newline at end of file +{/if}