diff --git a/controllers/front/IndexController.php b/controllers/front/IndexController.php
index 4531064fa..8394c83fb 100644
--- a/controllers/front/IndexController.php
+++ b/controllers/front/IndexController.php
@@ -36,7 +36,10 @@ class IndexControllerCore extends FrontController
{
parent::initContent();
- $this->context->smarty->assign('HOOK_HOME', Hook::exec('displayHome'));
+ $this->context->smarty->assign(array('HOOK_HOME' => Hook::exec('displayHome'),
+ 'HOOK_HOME_TAB' => Hook::exec('displayHomeTab'),
+ 'HOOK_HOME_TAB_CONTENT' => Hook::exec('displayHomeTabContent')
+ ));
$this->setTemplate(_PS_THEME_DIR_.'index.tpl');
}
}
diff --git a/install-dev/data/xml/hook.xml b/install-dev/data/xml/hook.xml
index 068532dfd..36f90f85a 100644
--- a/install-dev/data/xml/hook.xml
+++ b/install-dev/data/xml/hook.xml
@@ -274,5 +274,11 @@
actionModuleInstallAfteractionModuleInstallAfter
+
+ displayHomeTabHome Page TabsThis hook displays new elements on the homepage tabs
+
+
+ displayHomeTabContentHome Page Tabs ContentThis hook displays new elements on the homepage tabs content
+
diff --git a/install-dev/upgrade/sql/1.6.0.1.sql b/install-dev/upgrade/sql/1.6.0.1.sql
index 952d590c3..2ccaf580f 100644
--- a/install-dev/upgrade/sql/1.6.0.1.sql
+++ b/install-dev/upgrade/sql/1.6.0.1.sql
@@ -65,4 +65,8 @@ INSERT INTO `PREFIX_hook_module` (`id_module`, `id_shop`, `id_hook`, `position`)
/* PHP:update_order_messages(); */;
-ALTER TABLE `PREFIX_employee` ADD `stats_compare_from` DATE NULL DEFAULT NULL AFTER `stats_date_to` , ADD `stats_compare_to` DATE NULL DEFAULT NULL AFTER `stats_compare_from`
\ No newline at end of file
+ALTER TABLE `PREFIX_employee` ADD `stats_compare_from` DATE NULL DEFAULT NULL AFTER `stats_date_to` , ADD `stats_compare_to` DATE NULL DEFAULT NULL AFTER `stats_compare_from`;
+
+INSERT INTO `PREFIX_hook` (`id_hook` , `name` , `title` , `description` , `position` , `live_edit`)
+VALUES (NULL , 'displayHomeTab', 'Home Page Tabs', 'This hook displays new elements on the homepage tabs', '1', '1'),
+(NULL , 'displayHomeTabContent', 'Home Page Tabs Content', 'This hook displays new elements on the homepage tabs content', '1', '1');
\ No newline at end of file
diff --git a/modules/blockbestsellers/blockbestsellers.php b/modules/blockbestsellers/blockbestsellers.php
index cfe87a90d..5ef8ad0ac 100644
--- a/modules/blockbestsellers/blockbestsellers.php
+++ b/modules/blockbestsellers/blockbestsellers.php
@@ -34,9 +34,10 @@ class BlockBestSellers extends Module
public function __construct()
{
+
$this->name = 'blockbestsellers';
$this->tab = 'front_office_features';
- $this->version = '1.2';
+ $this->version = '1.3';
$this->author = 'PrestaShop';
$this->need_instance = 0;
@@ -52,15 +53,16 @@ class BlockBestSellers extends Module
public function install()
{
$this->_clearCache('blockbestsellers.tpl');
- $this->_clearCache('blockbestsellers-home.tpl');
+ $this->_clearCache('tab.tpl');
if (!parent::install()
- || !$this->registerHook('rightColumn')
|| !$this->registerHook('header')
|| !$this->registerHook('actionOrderStatusPostUpdate')
|| !$this->registerHook('addproduct')
|| !$this->registerHook('updateproduct')
|| !$this->registerHook('deleteproduct')
+ || !$this->registerHook('displayHomeTab')
+ || !$this->registerHook('displayHomeTabContent')
|| !ProductSale::fillProductSales()
)
return false;
@@ -70,7 +72,7 @@ class BlockBestSellers extends Module
public function uninstall()
{
$this->_clearCache('blockbestsellers.tpl');
- $this->_clearCache('blockbestsellers-home.tpl');
+ $this->_clearCache('tab.tpl');
return parent::uninstall();
}
@@ -78,25 +80,21 @@ class BlockBestSellers extends Module
public function hookAddProduct($params)
{
$this->_clearCache('blockbestsellers.tpl');
- $this->_clearCache('blockbestsellers-home.tpl');
}
public function hookUpdateProduct($params)
{
$this->_clearCache('blockbestsellers.tpl');
- $this->_clearCache('blockbestsellers-home.tpl');
}
public function hookDeleteProduct($params)
{
$this->_clearCache('blockbestsellers.tpl');
- $this->_clearCache('blockbestsellers-home.tpl');
}
public function hookActionOrderStatusPostUpdate($params)
{
$this->_clearCache('blockbestsellers.tpl');
- $this->_clearCache('blockbestsellers-home.tpl');
}
/**
@@ -175,9 +173,14 @@ class BlockBestSellers extends Module
$this->context->controller->addCSS($this->_path.'blockbestsellers.css', 'all');
}
- public function hookHome($params)
+ public function hookDisplayHomeTab($params)
{
- if (!$this->isCached('blockbestsellers-home.tpl', $this->getCacheId('blockbestsellers-home')))
+ return $this->display(__FILE__, 'tab.tpl', $this->getCacheId('blockbestsellers-tab'));
+ }
+
+ public function hookdisplayHomeTabContent($params)
+ {
+ if (!$this->isCached('blockbestsellers.tpl', $this->getCacheId()))
{
$best_sellers = $this->getBestSellers($params);
if ($best_sellers === false)
@@ -187,12 +190,12 @@ class BlockBestSellers extends Module
'best_sellers' => $best_sellers,
'homeSize' => Image::getSize(ImageType::getFormatedName('home'))));
}
- return $this->display(__FILE__, 'blockbestsellers-home.tpl', $this->getCacheId('blockbestsellers-home'));
+ return $this->display(__FILE__, 'blockbestsellers.tpl', $this->getCacheId());
}
public function hookRightColumn($params)
{
- if (!$this->isCached('blockbestsellers.tpl', $this->getCacheId('blockbestsellers')))
+ if (!$this->isCached('blockbestsellers.tpl', $this->getCacheId()))
{
$best_sellers = $this->getBestSellers($params);
if ($best_sellers === false)
@@ -204,7 +207,7 @@ class BlockBestSellers extends Module
'smallSize' => Image::getSize(ImageType::getFormatedName('small'))
));
}
- return $this->display(__FILE__, 'blockbestsellers.tpl', $this->getCacheId('blockbestsellers'));
+ return $this->display(__FILE__, 'blockbestsellers.tpl', $this->getCacheId());
}
public function hookLeftColumn($params)
diff --git a/themes/default/modules/blockbestsellers/blockbestsellers-home.tpl b/modules/blockbestsellers/tab.tpl
similarity index 82%
rename from themes/default/modules/blockbestsellers/blockbestsellers-home.tpl
rename to modules/blockbestsellers/tab.tpl
index e52fd8017..eb808788e 100644
--- a/themes/default/modules/blockbestsellers/blockbestsellers-home.tpl
+++ b/modules/blockbestsellers/tab.tpl
@@ -22,5 +22,4 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
-{capture name=title}{l s='Best sellers' mod='blockbestsellers'}{/capture}
-{include file="$tpl_dir./product-list-home.tpl" id="blockbestsellers_block" title=$smarty.capture.title products=$best_sellers}
+
{l s='Best Sellers' mod='blockbestsellers'}
\ No newline at end of file
diff --git a/modules/blockbestsellers/upgrade/install-1.3.php b/modules/blockbestsellers/upgrade/install-1.3.php
new file mode 100644
index 000000000..7741198f7
--- /dev/null
+++ b/modules/blockbestsellers/upgrade/install-1.3.php
@@ -0,0 +1,9 @@
+unregisterHook('rightColumn') && $object->registerHook('displayHomeTab') && $object->registerHook('displayHomeTabContent'));
+}
diff --git a/modules/blocknewproducts/blocknewproducts.php b/modules/blocknewproducts/blocknewproducts.php
index 7da03eec2..ba283cdea 100644
--- a/modules/blocknewproducts/blocknewproducts.php
+++ b/modules/blocknewproducts/blocknewproducts.php
@@ -33,7 +33,7 @@ class BlockNewProducts extends Module
{
$this->name = 'blocknewproducts';
$this->tab = 'front_office_features';
- $this->version = '1.4';
+ $this->version = '1.5';
$this->author = 'PrestaShop';
$this->need_instance = 0;
@@ -46,12 +46,13 @@ class BlockNewProducts extends Module
public function install()
{
if (!parent::install()
- || !$this->registerHook('rightColumn')
|| !$this->registerHook('header')
|| !$this->registerHook('addproduct')
|| !$this->registerHook('updateproduct')
|| !$this->registerHook('deleteproduct')
|| !Configuration::updateValue('NEW_PRODUCTS_NBR', 5)
+ || !$this->registerHook('displayHomeTab')
+ || !$this->registerHook('displayHomeTabContent')
)
return false;
$this->_clearCache('blocknewproducts.tpl');
@@ -61,6 +62,7 @@ class BlockNewProducts extends Module
public function uninstall()
{
$this->_clearCache('blocknewproducts.tpl');
+ $this->_clearCache('tab.tpl');
return parent::uninstall();
}
@@ -110,8 +112,13 @@ class BlockNewProducts extends Module
{
return $this->hookRightColumn($params);
}
+
+ public function hookdisplayHomeTab($params)
+ {
+ return $this->display(__FILE__, 'tab.tpl', $this->getCacheId('blocknewproducts-tab'));
+ }
- public function hookHome($params)
+ public function hookdisplayHomeTabContent($params)
{
return $this->hookRightColumn($params);
}
diff --git a/modules/blocknewproducts/tab.tpl b/modules/blocknewproducts/tab.tpl
new file mode 100644
index 000000000..e5c378d24
--- /dev/null
+++ b/modules/blocknewproducts/tab.tpl
@@ -0,0 +1,25 @@
+{*
+* 2007-2013 PrestaShop
+*
+* NOTICE OF LICENSE
+*
+* This source file is subject to the Academic Free License (AFL 3.0)
+* that is bundled with this package in the file LICENSE.txt.
+* It is also available through the world-wide-web at this URL:
+* http://opensource.org/licenses/afl-3.0.php
+* If you did not receive a copy of the license and are unable to
+* obtain it through the world-wide-web, please send an email
+* to license@prestashop.com so we can send you a copy immediately.
+*
+* DISCLAIMER
+*
+* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
+* versions in the future. If you wish to customize PrestaShop for your
+* needs please refer to http://www.prestashop.com for more information.
+*
+* @author PrestaShop SA
+* @copyright 2007-2013 PrestaShop SA
+* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*}
+{l s='New arrivals' mod='blocknewproducts'}
\ No newline at end of file
diff --git a/modules/blocknewproducts/upgrade/install-1.5.php b/modules/blocknewproducts/upgrade/install-1.5.php
new file mode 100644
index 000000000..c21256a2f
--- /dev/null
+++ b/modules/blocknewproducts/upgrade/install-1.5.php
@@ -0,0 +1,9 @@
+unregisterHook('rightColumn') && $object->registerHook('displayHomeTab') && $object->registerHook('displayHomeTabContent'));
+}
diff --git a/modules/homefeatured/homefeatured.php b/modules/homefeatured/homefeatured.php
index 69c9ab79a..52042aed9 100644
--- a/modules/homefeatured/homefeatured.php
+++ b/modules/homefeatured/homefeatured.php
@@ -36,7 +36,7 @@ class HomeFeatured extends Module
{
$this->name = 'homefeatured';
$this->tab = 'front_office_features';
- $this->version = '1.1';
+ $this->version = '1.2';
$this->author = 'PrestaShop';
$this->need_instance = 0;
@@ -52,11 +52,12 @@ class HomeFeatured extends Module
Configuration::updateValue('HOME_FEATURED_NBR', 8);
if (!parent::install()
- || !$this->registerHook('displayHome')
|| !$this->registerHook('header')
|| !$this->registerHook('addproduct')
|| !$this->registerHook('updateproduct')
|| !$this->registerHook('deleteproduct')
+ || !$this->registerHook('displayHomeTab')
+ || !$this->registerHook('displayHomeTabContent')
)
return false;
return true;
@@ -65,6 +66,7 @@ class HomeFeatured extends Module
public function uninstall()
{
$this->_clearCache('homefeatured.tpl');
+ $this->_clearCache('tab.tpl');
return parent::uninstall();
}
@@ -97,9 +99,14 @@ class HomeFeatured extends Module
$this->context->controller->addJS(($this->_path).'js/homefeatured.js');
}
- public function hookDisplayHome($params)
+ public function hookDisplayHomeTab($params)
{
- if (!$this->isCached('homefeatured.tpl', $this->getCacheId('homefeatured')))
+ return $this->display(__FILE__, 'tab.tpl', $this->getCacheId('homefeatured-tab'));
+ }
+
+ public function hookDisplayHomeTabContent($params)
+ {
+ if (!$this->isCached('homefeatured.tpl', $this->getCacheId()))
{
$category = new Category(Context::getContext()->shop->getCategory(), (int)Context::getContext()->language->id);
$nb = (int)Configuration::get('HOME_FEATURED_NBR');
@@ -111,7 +118,13 @@ class HomeFeatured extends Module
'homeSize' => Image::getSize(ImageType::getFormatedName('home')),
));
}
- return $this->display(__FILE__, 'homefeatured.tpl', $this->getCacheId('homefeatured'));
+ return $this->display(__FILE__, 'homefeatured.tpl', $this->getCacheId());
+ }
+
+ /* Retro Compatibility < 1.6.0.1 */
+ public function hookDisplayHome($params)
+ {
+ return $this->hookDisplayHomeTabContent();
}
public function hookAddProduct($params)
diff --git a/modules/homefeatured/js/homefeatured.js b/modules/homefeatured/js/homefeatured.js
index 62606689b..e10f00e41 100644
--- a/modules/homefeatured/js/homefeatured.js
+++ b/modules/homefeatured/js/homefeatured.js
@@ -25,12 +25,12 @@
$(document).ready(function()
{
- $('.title_block').click(function(){
+ $('.home_tab li a').click(function(){
var button = $(this);
- $('#index #center_column .products_block').removeClass('active');
- button.parent('.products_block').addClass('active');
- $('#index #center_column .products_block .block_content').hide(0, function(){
- button.next('.block_content').show(0);
+ $('.home_tab li').removeClass('active');
+ button.parent('li').addClass('active');
+ $('.home_tab_content .product_list').hide(0, function(){
+ $('.home_tab_content .' + button.prop('class')).show(0).addClass('active').removeClass('hidden');
});
});
});
\ No newline at end of file
diff --git a/modules/homefeatured/tab.tpl b/modules/homefeatured/tab.tpl
new file mode 100644
index 000000000..c3e8b88c5
--- /dev/null
+++ b/modules/homefeatured/tab.tpl
@@ -0,0 +1,25 @@
+{*
+* 2007-2013 PrestaShop
+*
+* NOTICE OF LICENSE
+*
+* This source file is subject to the Academic Free License (AFL 3.0)
+* that is bundled with this package in the file LICENSE.txt.
+* It is also available through the world-wide-web at this URL:
+* http://opensource.org/licenses/afl-3.0.php
+* If you did not receive a copy of the license and are unable to
+* obtain it through the world-wide-web, please send an email
+* to license@prestashop.com so we can send you a copy immediately.
+*
+* DISCLAIMER
+*
+* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
+* versions in the future. If you wish to customize PrestaShop for your
+* needs please refer to http://www.prestashop.com for more information.
+*
+* @author PrestaShop SA
+* @copyright 2007-2013 PrestaShop SA
+* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*}
+{l s='Popular' mod='homefeatured'}
\ No newline at end of file
diff --git a/modules/homefeatured/upgrade/install-1.2.php b/modules/homefeatured/upgrade/install-1.2.php
new file mode 100644
index 000000000..1428f1fb9
--- /dev/null
+++ b/modules/homefeatured/upgrade/install-1.2.php
@@ -0,0 +1,9 @@
+unregisterHook('displayHome') && $object->registerHook('displayHomeTab') && $object->registerHook('displayHomeTabContent'));
+}
diff --git a/themes/default/css/modules/blockbestsellers/blockbestsellers.css b/themes/default/css/modules/blockbestsellers/blockbestsellers.css
deleted file mode 100644
index e69de29bb..000000000
diff --git a/themes/default/css/modules/blocknewproducts/blocknewproducts.css b/themes/default/css/modules/blocknewproducts/blocknewproducts.css
deleted file mode 100644
index e69de29bb..000000000
diff --git a/themes/default/css/modules/homefeatured/homefeatured.css b/themes/default/css/modules/homefeatured/homefeatured.css
deleted file mode 100644
index 2585ec229..000000000
--- a/themes/default/css/modules/homefeatured/homefeatured.css
+++ /dev/null
@@ -1,103 +0,0 @@
-#index #center_column {
- position: relative;
- min-height: 886px;
-}
-#index #center_column .products_block {
- position: absolute;
- top: 345px;
- left: 0px;
- height: 546px;
- width: 535px;
-}
-#index #center_column .block_content {
- position: relative;
- display: none;
- clear: both;
- top: -26px;
-}
-#index #center_column #blocknewproducts_block .block_content {
- display: block;
-}
-#index #center_column .products_block .title_block {
- position: relative;
- display: inline-block;
- background: none;
- cursor: pointer;
- color: #383838;
- top: -26px;
- text-shadow: none!important;
-}
-#index #center_column .active .title_block {
- background-color: #383838;
- color: #FFFFFF;
- cursor: pointer;
-}
-#index #homefeatured_block .title_block {
- left: 111px;
-}
-#index #blockbestsellers_block .title_block {
- left: 191px;
-}
-#index #center_column .products_block li {
- margin-right:10px;
- padding:10px 0;
- width:126px;
- height:240px
-}
-#index #center_column .products_block li.last_item_of_line {margin-right:0;}
-#index #center_column .products_block .s_title_block, #index .products_block h5 {
- padding-top:5px;
- height:30px;
- font-size:12px;
- color:#222;
- padding-bottom: 0;
- font-weight:bold;
-}
-#index #center_column .products_block .product_image {
- display:block;
- position:relative;
- overflow:hidden
-}
-#index #center_column .products_block .product_image span.new {
- display: block;
- position: absolute;
- top: 15px;
- right:-30px;
- padding: 1px 4px;
- width: 101px;
- font-size:10px;
- color: #fff;
- text-align: center;
- text-transform: uppercase;
- -moz-transform: rotate(45deg);
- -webkit-transform: rotate(45deg);
- -o-transform:rotate(45deg);
- -ms-transform: rotate(45deg);
- background-color: #990000;
- transform: rotate(45deg); /* Newer browsers */
-}
-
-#index #center_column .products_block .product_desc {height:45px;}
-#index #center_column .products_block .product_desc,
-#index #center_column .products_block .product_desc a {
- color:#666
-}
-#index #center_column .products_block .lnk_more {
- display:inline;
- padding-right:10px;
- font-weight:bold;
- font-size:10px;
- color:#0088cc;
- background:url('../../../img/arrow_right_1.png') no-repeat 100% 3px;
-}
-#index #center_column .products_block .price_container {
- margin-top:10px;
- padding:0;
-}
-#index #center_column .products_block .price {
- font-weight:bold;
- font-size:14px;
- color:#990000
-}
-#index #center_column .products_block li .ajax_add_to_cart_button {display:none;}
-#index #center_column .products_block li span.exclusive {display:none;}
\ No newline at end of file
diff --git a/themes/default/index.tpl b/themes/default/index.tpl
index 2e6b90af2..ddb4d1ea6 100644
--- a/themes/default/index.tpl
+++ b/themes/default/index.tpl
@@ -24,3 +24,11 @@
*}
{$HOOK_HOME}
+{if isset($HOOK_HOME_TAB_CONTENT)}
+{if isset($HOOK_HOME_TAB)}
+ {/if}{$HOOK_HOME_TAB}{if isset($HOOK_HOME_TAB)}
+{/if}
+
+ {$HOOK_HOME_TAB_CONTENT}
+
+{/if}
\ No newline at end of file
diff --git a/themes/default/modules/blockbestsellers/blockbestsellers.tpl b/themes/default/modules/blockbestsellers/blockbestsellers.tpl
index dbc88905c..613fe7a6b 100644
--- a/themes/default/modules/blockbestsellers/blockbestsellers.tpl
+++ b/themes/default/modules/blockbestsellers/blockbestsellers.tpl
@@ -18,35 +18,9 @@
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA
-* @copyright 2007-2013 PrestaShop SA
+* @copyright 2007-2013 PrestaShop SA
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
-
-
-
-
+{include file="$tpl_dir./product-list.tpl" products=$best_sellers class='blockbestsellers hidden'}
\ No newline at end of file
diff --git a/themes/default/modules/blocknewproducts/blocknewproducts.tpl b/themes/default/modules/blocknewproducts/blocknewproducts.tpl
index f57e2ffd0..b2c7365ec 100644
--- a/themes/default/modules/blocknewproducts/blocknewproducts.tpl
+++ b/themes/default/modules/blocknewproducts/blocknewproducts.tpl
@@ -22,5 +22,4 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
-{capture name=title}{l s='New arrivals' mod='blocknewproducts'}{/capture}
-{include file="$tpl_dir./product-list-home.tpl" id="blocknewproducts_block" title=$smarty.capture.title products=$new_products}
\ No newline at end of file
+{include file="$tpl_dir./product-list.tpl" products=$new_products class='blocknewproducts active'}
\ No newline at end of file
diff --git a/themes/default/modules/homefeatured/homefeatured.tpl b/themes/default/modules/homefeatured/homefeatured.tpl
index 4a346ac11..442c551b6 100644
--- a/themes/default/modules/homefeatured/homefeatured.tpl
+++ b/themes/default/modules/homefeatured/homefeatured.tpl
@@ -22,5 +22,4 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
-{capture name=title}{l s='Popular' mod='homefeatured'}{/capture}
-{include file="$tpl_dir./product-list-home.tpl" id="homefeatured_block" title=$smarty.capture.title}
\ No newline at end of file
+{include file="$tpl_dir./product-list.tpl" class='homefeatured hidden'}
\ No newline at end of file
diff --git a/themes/default/product-list-home.tpl b/themes/default/product-list-home.tpl
deleted file mode 100644
index 45e19689c..000000000
--- a/themes/default/product-list-home.tpl
+++ /dev/null
@@ -1,62 +0,0 @@
-{*
-* 2007-2013 PrestaShop
-*
-* NOTICE OF LICENSE
-*
-* This source file is subject to the Academic Free License (AFL 3.0)
-* that is bundled with this package in the file LICENSE.txt.
-* It is also available through the world-wide-web at this URL:
-* http://opensource.org/licenses/afl-3.0.php
-* If you did not receive a copy of the license and are unable to
-* obtain it through the world-wide-web, please send an email
-* to license@prestashop.com so we can send you a copy immediately.
-*
-* DISCLAIMER
-*
-* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
-* versions in the future. If you wish to customize PrestaShop for your
-* needs please refer to http://www.prestashop.com for more information.
-*
-* @author PrestaShop SA
-* @copyright 2007-2013 PrestaShop SA
-* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
-* International Registered Trademark & Property of PrestaShop SA
-*}
-
-
{if isset($title)}{$title}{/if}
- {if isset($products) AND $products}
-
- {assign var='liHeight' value=250}
- {assign var='nbItemsPerLine' value=4}
- {assign var='nbLi' value=$products|@count}
- {math equation="nbLi/nbItemsPerLine" nbLi=$nbLi nbItemsPerLine=$nbItemsPerLine assign=nbLines}
- {math equation="nbLines*liHeight" nbLines=$nbLines|ceil liHeight=$liHeight assign=ulHeight}
-
- {foreach from=$products item=product name=homeProducts}
- {math equation="(total%perLine)" total=$smarty.foreach.homeProducts.total perLine=$nbItemsPerLine assign=totModulo}
- {if $totModulo == 0}{assign var='totModulo' value=$nbItemsPerLine}{/if}
- -
-
{if isset($product.new) && $product.new == 1}{l s='New'}{/if}
-
-
-
-
{l s='View'}
- {if isset($product.show_price) && $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}
{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}
{else}
{/if}
- {if ((isset($product.id_product_attribute) && $product.id_product_attribute == 0) OR (isset($add_prod_display) AND ($add_prod_display == 1))) AND (isset($product.available_for_order) && $product.available_for_order) AND !isset($restricted_country_mode) AND $product.minimal_quantity == 1 AND $product.customizable != 2 AND !$PS_CATALOG_MODE}
- {if ($product.quantity > 0 OR $product.allow_oosp)}
-
{l s='Add to cart'}
- {else}
-
{l s='Add to cart'}
- {/if}
- {else}
-
- {/if}
-
-
- {/foreach}
-
-
- {else}
-
{l s='No products'}
- {/if}
-
\ No newline at end of file
diff --git a/themes/default/product-list.tpl b/themes/default/product-list.tpl
index dd9ac3a7b..0db3e34b8 100644
--- a/themes/default/product-list.tpl
+++ b/themes/default/product-list.tpl
@@ -25,7 +25,7 @@
{if isset($products)}
-
+
{foreach from=$products item=product name=products}
-