Added changes from commit 88aa49e TMMeilleur

This commit is contained in:
Alexey Svistunov
2013-11-11 11:30:24 +02:00
parent d7dd85d7d0
commit 97d14e5b08
3 changed files with 56 additions and 34 deletions
@@ -219,7 +219,7 @@ function initLayered()
}
}
function paginationButton() {
function paginationButton(nbProductsIn) {
$('div.pagination a').not(':hidden').each(function () {
if ($(this).prop('href').search('&p=') == -1) {
var page = 1;
@@ -248,10 +248,29 @@ function paginationButton() {
return false;
});
});
}
function showAllButton() {
//product count refresh
// add variables
var productCountRow = $('.product-count').html();
var nbPage = parseInt($('div.pagination li.current').children().children().html());
var nbPerPage = parseInt($('#nb_item option:selected').val());
var nb_products = nbProductsIn;
isNaN(nbPage) ? nbPage = 1 : nbPage = nbPage;
nbPerPage*nbPage < nb_products ? productShowing = nbPerPage*nbPage :productShowing = (nbPerPage*nbPage-nb_products-nbPerPage*nbPage)*-1;
nbPage==1 ? productShowingStart=1 : productShowingStart=nbPerPage*nbPage-nbPerPage+1;
//insert values into a .product-count
productCountRow = $.trim(productCountRow);
productCountRow = productCountRow.split(' ');
productCountRow[1] = productShowingStart;
productCountRow[3] = productShowing;
productCountRow[5] = nb_products;
productCountRow = productCountRow.join(' ');
$('.product-count').html(productCountRow);
}
function cancelFilter()
@@ -400,7 +419,7 @@ function reloadContent(params_plus)
{
$('#layered_block_left').replaceWith(utf8_decode(result.filtersBlock));
$('.category-product-count').html(result.categoryCount);
$('.category-product-count, .heading-counter').html(result.categoryCount);
if (result.productList)
$('.product_list').replaceWith(utf8_decode(result.productList));
@@ -438,7 +457,7 @@ function reloadContent(params_plus)
$('div.pagination').hide();
}
paginationButton();
paginationButton(parseInt(result.categoryCount.replace(/[^0-9]/g,'')));
ajaxLoaderOn = 0;
// On submiting nb items form, relaod with the good nb of items
@@ -535,7 +554,7 @@ function updateProductUrl()
// Adding the filters to URL product
if (typeof(param_product_url) != 'undefined' && param_product_url != '' && param_product_url !='#') {
$.each($('ul.product_list li.ajax_block_product .product_img_link,'+
'ul.product_list li.ajax_block_product h3 a,'+
'ul.product_list li.ajax_block_product h5 a,'+
'ul.product_list li.ajax_block_product .product_desc a,'+
'ul.product_list li.ajax_block_product .lnk_view'), function() {
$(this).prop('href', $(this).prop('href') + param_product_url);
@@ -23,7 +23,7 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{if $page_name =='index'}
<!-- Module HomeSlider -->
{if isset($homeslider)}
<script type="text/javascript">
@@ -56,3 +56,4 @@ var homeslider_pause = {$homeslider.pause};
</div>
{/if}
<!-- /Module HomeSlider -->
{/if}
@@ -1,27 +1,29 @@
{if isset($htmlitems.items) && $htmlitems.items}
<div id="htmlcontent_top">
<ul class="htmlcontent-home clearfix">
{foreach name=items from=$htmlitems.items item=hItem}
<li class="htmlcontent-item">
{if $hItem.url}
<a href="{$hItem.url}" class="item-link"{if $hItem.target == 1} target="_blank"{/if}>
{/if}
{if $hItem.image}
<img src="{$module_dir}images/{$hItem.image}" class="item-img" alt="" />
{/if}
{if $hItem.title && $hItem.title_use == 1}
<h3 class="item-title">{$hItem.title}</h3>
{/if}
{if $hItem.html}
<div class="item-html">
{$hItem.html} <i class="icon-double-angle-right"></i>
</div>
{/if}
{if $hItem.url}
</a>
{/if}
</li>
{/foreach}
</ul>
</div>
{if $page_name =='index'}
{if isset($htmlitems.items) && $htmlitems.items}
<div id="htmlcontent_top">
<ul class="htmlcontent-home clearfix">
{foreach name=items from=$htmlitems.items item=hItem}
<li class="htmlcontent-item">
{if $hItem.url}
<a href="{$hItem.url}" class="item-link"{if $hItem.target == 1} target="_blank"{/if}>
{/if}
{if $hItem.image}
<img src="{$module_dir}images/{$hItem.image}" class="item-img" alt="" />
{/if}
{if $hItem.title && $hItem.title_use == 1}
<h3 class="item-title">{$hItem.title}</h3>
{/if}
{if $hItem.html}
<div class="item-html">
{$hItem.html} <i class="icon-double-angle-right"></i>
</div>
{/if}
{if $hItem.url}
</a>
{/if}
</li>
{/foreach}
</ul>
</div>
{/if}
{/if}