[*] FO : New hooks for home tabs
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,5 +274,11 @@
|
||||
<hook id="actionModuleInstallAfter" live_edit="0">
|
||||
<name>actionModuleInstallAfter</name><title>actionModuleInstallAfter</title><description></description>
|
||||
</hook>
|
||||
<hook id="displayHomeTab" live_edit="1">
|
||||
<name>displayHomeTab</name><title>Home Page Tabs</title><description>This hook displays new elements on the homepage tabs</description>
|
||||
</hook>
|
||||
<hook id="displayHomeTabContent" live_edit="1">
|
||||
<name>displayHomeTabContent</name><title>Home Page Tabs Content</title><description>This hook displays new elements on the homepage tabs content</description>
|
||||
</hook>
|
||||
</entities>
|
||||
</entity_hook>
|
||||
|
||||
@@ -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`
|
||||
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');
|
||||
@@ -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)
|
||||
|
||||
+1
-2
@@ -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}
|
||||
<li><a class="blockbestsellers">{l s='Best Sellers' mod='blockbestsellers'}</a></li>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
function upgrade_module_1_3($object)
|
||||
{
|
||||
return ($object->unregisterHook('rightColumn') && $object->registerHook('displayHomeTab') && $object->registerHook('displayHomeTabContent'));
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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 <contact@prestashop.com>
|
||||
* @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
|
||||
*}
|
||||
<li class="active"><a class="blocknewproducts">{l s='New arrivals' mod='blocknewproducts'}</a></li>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
function upgrade_module_1_5($object)
|
||||
{
|
||||
return ($object->unregisterHook('rightColumn') && $object->registerHook('displayHomeTab') && $object->registerHook('displayHomeTabContent'));
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -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 <contact@prestashop.com>
|
||||
* @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
|
||||
*}
|
||||
<li><a class="homefeatured">{l s='Popular' mod='homefeatured'}</a></li>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
function upgrade_module_1_2($object)
|
||||
{
|
||||
return ($object->unregisterHook('displayHome') && $object->registerHook('displayHomeTab') && $object->registerHook('displayHomeTabContent'));
|
||||
}
|
||||
@@ -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;}
|
||||
@@ -24,3 +24,11 @@
|
||||
*}
|
||||
|
||||
{$HOOK_HOME}
|
||||
{if isset($HOOK_HOME_TAB_CONTENT)}
|
||||
{if isset($HOOK_HOME_TAB)}
|
||||
<ul class="home_tab">{/if}{$HOOK_HOME_TAB}{if isset($HOOK_HOME_TAB)}</ul>
|
||||
{/if}
|
||||
<div class="home_tab_content">
|
||||
{$HOOK_HOME_TAB_CONTENT}
|
||||
</div>
|
||||
{/if}
|
||||
@@ -18,35 +18,9 @@
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @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
|
||||
*}
|
||||
|
||||
<!-- MODULE Block best sellers -->
|
||||
<div id="best-sellers_block_right" class="block products_block">
|
||||
<p class="title_block"><a href="{$link->getPageLink('best-sales')|escape:'html'}">{l s='Top sellers' mod='blockbestsellers'}</a></p>
|
||||
<div class="block_content">
|
||||
{if $best_sellers|@count > 0}
|
||||
<ul class="product_images">
|
||||
{foreach from=$best_sellers item=product name=myLoop}
|
||||
<li class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if} clearfix">
|
||||
<a href="{$product.link|escape:'html'}" title="{$product.legend|escape:'htmlall':'UTF-8'}" class="content_img clearfix">
|
||||
<span class="number">{$smarty.foreach.myLoop.iteration}</span>
|
||||
<img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'small_default')|escape:'html'}" height="{$smallSize.height}" width="{$smallSize.width}" alt="{$product.legend|escape:'htmlall':'UTF-8'}" />
|
||||
|
||||
</a>
|
||||
<p><a href="{$product.link|escape:'html'}" title="{$product.legend|escape:'htmlall':'UTF-8'}">
|
||||
{$product.name|strip_tags:'UTF-8'|escape:'htmlall':'UTF-8'}<br />
|
||||
<span class="price">{$product.price}</span>
|
||||
</a></p>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
<p class="lnk"><a href="{$link->getPageLink('best-sales')|escape:'html'}" title="{l s='All best sellers' mod='blockbestsellers'}" class="button_large">» {l s='All best sellers' mod='blockbestsellers'}</a></p>
|
||||
{else}
|
||||
<p>{l s='No best sellers at this time' mod='blockbestsellers'}</p>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!-- /MODULE Block best sellers -->
|
||||
{include file="$tpl_dir./product-list.tpl" products=$best_sellers class='blockbestsellers hidden'}
|
||||
@@ -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}
|
||||
{include file="$tpl_dir./product-list.tpl" products=$new_products class='blocknewproducts active'}
|
||||
@@ -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}
|
||||
{include file="$tpl_dir./product-list.tpl" class='homefeatured hidden'}
|
||||
@@ -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 <contact@prestashop.com>
|
||||
* @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
|
||||
*}
|
||||
<div{if isset($id)} id="{$id}"{/if} class="block products_block{if isset($id) && $id eq 'blocknewproducts_block'} active{/if}">
|
||||
<h4 class="title_block">{if isset($title)}{$title}{/if}</h4>
|
||||
{if isset($products) AND $products}
|
||||
<div class="block_content">
|
||||
{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}
|
||||
<ul style="height:{$ulHeight}px;">
|
||||
{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}
|
||||
<li class="ajax_block_product {if $smarty.foreach.homeProducts.first}first_item{elseif $smarty.foreach.homeProducts.last}last_item{else}item{/if} {if $smarty.foreach.homeProducts.iteration%$nbItemsPerLine == 0}last_item_of_line{elseif $smarty.foreach.homeProducts.iteration%$nbItemsPerLine == 1} {/if} {if $smarty.foreach.homeProducts.iteration > ($smarty.foreach.homeProducts.total - $totModulo)}last_line{/if}">
|
||||
<a href="{$product.link|escape:'html'}" title="{$product.name|escape:html:'UTF-8'}" class="product_image"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html'}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product.name|escape:html:'UTF-8'}" />{if isset($product.new) && $product.new == 1}<span class="new">{l s='New'}</span>{/if}</a>
|
||||
<h5 class="s_title_block"><a href="{$product.link|escape:'html'}" title="{$product.name|truncate:50:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}</a></h5>
|
||||
<div class="product_desc"><a href="{$product.link|escape:'html'}" title="{l s='More'}">{$product.description_short|strip_tags|truncate:65:'...'}</a></div>
|
||||
<div>
|
||||
<a class="lnk_more" href="{$product.link|escape:'html'}" title="{l s='View'}">{l s='View'}</a>
|
||||
{if isset($product.show_price) && $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}<p class="price_container"><span class="price">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span></p>{else}<div style="height:21px;"></div>{/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)}
|
||||
<a class="exclusive ajax_add_to_cart_button" rel="ajax_id_product_{$product.id_product}" href="{$link->getPageLink('cart')|escape:'html'}?qty=1&id_product={$product.id_product}&token={$static_token}&add" title="{l s='Add to cart'}">{l s='Add to cart'}</a>
|
||||
{else}
|
||||
<span class="exclusive">{l s='Add to cart'}</span>
|
||||
{/if}
|
||||
{else}
|
||||
<div style="height:23px;"></div>
|
||||
{/if}
|
||||
</div>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
{else}
|
||||
<p>{l s='No products'}</p>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
{if isset($products)}
|
||||
<!-- Products list -->
|
||||
<ul id="product_list" class="clear">
|
||||
<ul class="product_list clear{if isset($class) && $class} {$class}{/if}">
|
||||
{foreach from=$products item=product name=products}
|
||||
<li class="ajax_block_product {if $smarty.foreach.products.first}first_item{elseif $smarty.foreach.products.last}last_item{/if} {if $smarty.foreach.products.index % 2}alternate_item{else}item{/if} clearfix">
|
||||
<div class="left_block">
|
||||
|
||||
Reference in New Issue
Block a user