diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 06dcfe350..bb91f96b5 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,80 +1,140 @@ - - (d)oekia - - Alexander Otchenashev - - Benjamin PONGY - - Burhan - - Caleydon Media - - Damien Metzger - - DamienMetzger - - Damon Skelhorn - - Daniel - - David Gasperoni - - DrySs - - DrÿSs' - - François Gaillard - - Gabriel Schwardy - - Gregory Roussac - - Ha!*!*y - - Jonathan Danse - - Krystian Podemski - - Marco Cervellin - - Michel Courtade - - Milow - - Patanock - - Pierre - - PrestaEdit - - Raphaël Malié - - Rémi Gaillard - - Samy Rabih - - Sarah Lorenzini - - Shagshag - - Vincent Augagneur - - Xavier POITAU - - aFolletete - - aKorczak - - aNiassy - - adonis karavokyros - - anat - - bLeveque - - bMancone - - bumbu - - cmouleyre - - dMetzger - - dSevere - - djfm - - fBrignoli - - fSerny - - fram - - gBrunier - - gCharmes - - gPoulain - - gRoussac - - hAitmansour - - ivancasasempere - - jBreux - - jObregon - - jessylenne - - jmCollin - - kpodemski - - lBrieu - - lCherifi - - lLefevre - - mBertholino - - mDeflotte - - mMarinetti - - marcinsz101 - - montes - - nPellicari - - nezenmoins - - oleacorner - - rGaillard - - rMalie - - rMontagne - - root - - sLorenzini - - sThiebaut - - tDidierjean - - vAugagneur - - vChabot - - vKham - - vSchoener - +- adonis karavokyros +- aFolletete +- Agence CINS +- aKorczak +- Alexander Otchenashev +- anat +- Andrew +- aNiassy +- antoniofr +- AntonLejon +- Arnaud Lemercier +- Axome +- Benjamin PONGY +- BigZ +- bLeveque +- bMancone +- bumbu +- Burhan +- Cédric Mouleyre +- Caleydon Media +- cam.lafit +- Captain FLAM +- Captain-FLAM +- ccauw +- ChristopheBoucaut +- cippest +- cmouleyre +- Corentin Delcourt +- Cosmin Hutanu +- Damien Metzger +- DamienMetzger +- Damon Skelhorn +- Daniel +- David Gasperoni +- Davy Rolink +- djfm +- dMetzger +- (d)oekia +- Dragan Skrbic +- DrÿSs' +- dreammeup +- DrySs +- dSevere +- Edouard Gaulué +- emily-d +- Fabio Chelly +- fBrignoli +- fram +- François Gaillard +- fSerny +- Gabriel Schwardy +- gBrunier +- gCharmes +- gPoulain +- Grégoire Bélorgey +- Gregory Roussac +- gRoussac +- Guillaume DELOINCE +- hAitmansour +- Ha!*!*y +- indesign47 +- inem0o +- ivancasasempere +- Jérôme Nadaud +- jBreux +- jeromenadaud +- Jerome Nadaud +- jessylenne +- jmCollin +- jObregon +- Jonathan Danse +- joseantgv +- Kevin Granger +- kpodemski +- Krystian Podemski +- lBrieu +- lCherifi +- ldecoker +- lLefevre +- marcinsz101 +- Marco Cervellin +- Mats Rynge +- MatthieuB +- Maxence +- mBertholino +- mDeflotte +- Michel Courtade +- Milow +- minic studio +- misthero +- mMarinetti +- montes +- nezenmoins +- Nicolas Sorosac +- Nils-Helge Garli Hegvik +- nPellicari +- nturato +- oleacorner +- Otto Nascarella +- Patanock +- PhpMadman +- Pierre +- Piotr Kaczor +- Piotr Moćko +- PrestaEdit +- prestarocket +- pxls +- Rémi Gaillard +- Raphaël Malié +- raulgundin +- rGaillard +- Rimas Kudelis +- rMalie +- rMontagne +- root +- runningz +- Sébastien +- Sébastien Bocahu +- Samy Rabih +- Sarah Lorenzini +- Seb +- Seynaeve +- Shagshag +- sLorenzini +- soware +- Staging +- sThiebaut +- Sylvain WITMEYER +- tDidierjean +- vAugagneur +- vChabot +- Vincent Augagneur +- Vincent Schoener +- Vincent Terenti +- vinvin27 +- vKham +- vSchoener +- Xavier +- Xavier POITAU +- Yoozio diff --git a/admin-dev/themes/default/template/controllers/carrier_wizard/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/carrier_wizard/helpers/form/form.tpl index f487e9120..e9bca4def 100644 --- a/admin-dev/themes/default/template/controllers/carrier_wizard/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/carrier_wizard/helpers/form/form.tpl @@ -32,7 +32,7 @@ {if $input.name == 'zones'} {include file='controllers/carrier_wizard/helpers/form/form_ranges.tpl'}
  • + {l s='My wishlists' mod='blockwishlist'} {l s='My wishlists' mod='blockwishlist'}
  • diff --git a/modules/crossselling/config.xml b/modules/crossselling/config.xml index 8aed65a6b..59e2ea5ab 100755 --- a/modules/crossselling/config.xml +++ b/modules/crossselling/config.xml @@ -1,12 +1,12 @@ - - crossselling - - - - - - 1 - 0 + + crossselling + + + + + + 1 + 0 - \ No newline at end of file + \ No newline at end of file diff --git a/modules/dateofdelivery/config.xml b/modules/dateofdelivery/config.xml index 4cb2d611a..3529e0e83 100755 --- a/modules/dateofdelivery/config.xml +++ b/modules/dateofdelivery/config.xml @@ -1,9 +1,9 @@ dateofdelivery - + - + 1 diff --git a/modules/followup/config.xml b/modules/followup/config.xml index b2c550b12..54ea7dfa1 100755 --- a/modules/followup/config.xml +++ b/modules/followup/config.xml @@ -1,12 +1,12 @@ followup - + - + - Etes-vous sûr de vouloir supprimer vos paramètres ainsi que vos statistiques liées aux relances ? + Are you sure you want to delete all settings and your logs? 1 0 diff --git a/modules/homefeatured/config.xml b/modules/homefeatured/config.xml index 02482bc91..2c0f069ba 100755 --- a/modules/homefeatured/config.xml +++ b/modules/homefeatured/config.xml @@ -1,9 +1,9 @@ homefeatured - + - + 1 diff --git a/modules/homeslider/upgrade/install-1.2.1.php b/modules/homeslider/upgrade/install-1.2.1.php index 7817ecaf7..2d3d12abd 100644 --- a/modules/homeslider/upgrade/install-1.2.1.php +++ b/modules/homeslider/upgrade/install-1.2.1.php @@ -16,9 +16,9 @@ function upgrade_module_1_2_1($object) function homeslider_stripslashes_field($field) { - $quotes = array('\'\\\\\'\'', '\'\\\'\''); - $dquotes = array('\'\\"\'', '\'"\''); - $backslashes = array('\'\\\\\'', '\'\\\''); + $quotes = array('"\\\'"', '"\'"'); + $dquotes = array('\'\\\\"\'', '\'"\''); + $backslashes = array('"\\\\\\\\"', '"\\\\"'); return '`'.bqSQL($field).'` = replace(replace(replace(`'.bqSQL($field).'`, '.$quotes[0].', '.$quotes[1].'), '.$dquotes[0].', '.$dquotes[1].'), '.$backslashes[0].', '.$backslashes[1].')'; } \ No newline at end of file diff --git a/modules/mailalerts/config.xml b/modules/mailalerts/config.xml index 54479d6fa..8af979fc4 100755 --- a/modules/mailalerts/config.xml +++ b/modules/mailalerts/config.xml @@ -1,12 +1,12 @@ mailalerts - + - + - Etes-vous sûr de vouloir supprimer toutes les notifications clients ? + Are you sure you want to delete all customer notifications? 1 0 diff --git a/modules/newsletter/config.xml b/modules/newsletter/config.xml index ae5c0b717..15eceb2dc 100755 --- a/modules/newsletter/config.xml +++ b/modules/newsletter/config.xml @@ -1,9 +1,9 @@ newsletter - + - + 1 diff --git a/modules/productscategory/config.xml b/modules/productscategory/config.xml index 4b8faeec9..8464b4ebc 100755 --- a/modules/productscategory/config.xml +++ b/modules/productscategory/config.xml @@ -1,12 +1,12 @@ - - productscategory - - - - - - 1 - 0 + + productscategory + + + + + + 1 + 0 - \ No newline at end of file + \ No newline at end of file diff --git a/modules/pscleaner/config.xml b/modules/pscleaner/config.xml index 4687b60f8..d1f03fa8f 100644 --- a/modules/pscleaner/config.xml +++ b/modules/pscleaner/config.xml @@ -1,9 +1,9 @@ pscleaner - + - + 1 diff --git a/modules/pscleaner/pscleaner.php b/modules/pscleaner/pscleaner.php index aecde311b..7f92c7be9 100644 --- a/modules/pscleaner/pscleaner.php +++ b/modules/pscleaner/pscleaner.php @@ -560,7 +560,7 @@ class PSCleaner extends Module protected static function clearAllCaches() { - $index = file_get_contents(_PS_TMP_IMG_DIR_.'index.php'); + $index = file_exists(_PS_TMP_IMG_DIR_.'index.php') ? file_get_contents(_PS_TMP_IMG_DIR_.'index.php') : ''; Tools::deleteDirectory(_PS_TMP_IMG_DIR_, false); file_put_contents(_PS_TMP_IMG_DIR_.'index.php', $index); Context::getContext()->smarty->clearAllCache(); diff --git a/modules/referralprogram/config.xml b/modules/referralprogram/config.xml index 0bb300cb4..d32cbdc64 100755 --- a/modules/referralprogram/config.xml +++ b/modules/referralprogram/config.xml @@ -1,12 +1,12 @@ referralprogram - + - + - Tous les informations relatives aux parrains et filleuls + All sponsors and friends will be deleted. Are you sure you want to uninstall this module? 1 1 diff --git a/modules/sekeywords/config.xml b/modules/sekeywords/config.xml index bb438a6e0..7856891ea 100755 --- a/modules/sekeywords/config.xml +++ b/modules/sekeywords/config.xml @@ -1,9 +1,9 @@ sekeywords - + - + 0 diff --git a/modules/statsbestcustomers/statsbestcustomers.php b/modules/statsbestcustomers/statsbestcustomers.php index 294a885a3..29f88301d 100644 --- a/modules/statsbestcustomers/statsbestcustomers.php +++ b/modules/statsbestcustomers/statsbestcustomers.php @@ -125,15 +125,13 @@ class StatsBestCustomers extends ModuleGrid

    '.$this->l('Keeping a client is more profitable than gaining a new one. That is one of the many reasons it is necessary to cultivate customer loyalty.').'
    '.$this->l('Word of mouth is also a means for getting new, satisfied clients. A dissatisfied customer can hurt your e-reputation and obstruct future sales goals.').'
    - '.$this->l('In order to achieve this goal, you can organize: ').' + '.$this->l('In order to achieve this goal, you can organize:').'

      -
    • '.$this->l('Punctual operations: commercial rewards (personalized special offers, product or service offered), - non commercial rewards (priority handling of an order or a product), pecuniary rewards (bonds, discount coupons, payback).').'
    • -
    • '.$this->l('Sustainable operations: loyalty points or cards, which not only justify communication between merchant and client, - but also offer advantages to clients (private offers, discounts).').'
    • +
    • '.$this->l('Punctual operations: commercial rewards (personalized special offers, product or service offered), non commercial rewards (priority handling of an order or a product), pecuniary rewards (bonds, discount coupons, payback).').'
    • +
    • '.$this->l('Sustainable operations: loyalty points or cards, which not only justify communication between merchant and client, but also offer advantages to clients (private offers, discounts).').'
    - '.$this->l('These operations encourage clients to buy products and visit your e-store regularly.').'
    -


    + '.$this->l('These operations encourage clients to buy products and visit your e-store regularly.').' +

    '; return $this->_html; } diff --git a/modules/statsforecast/config.xml b/modules/statsforecast/config.xml index b59200e4a..622e353e4 100755 --- a/modules/statsforecast/config.xml +++ b/modules/statsforecast/config.xml @@ -1,7 +1,7 @@ statsforecast - + diff --git a/modules/statslive/config.xml b/modules/statslive/config.xml index ec80f8210..39c7403c4 100755 --- a/modules/statslive/config.xml +++ b/modules/statslive/config.xml @@ -1,9 +1,9 @@ statslive - + - + 0 diff --git a/modules/trackingfront/config.xml b/modules/trackingfront/config.xml index ade364036..e56c2711a 100755 --- a/modules/trackingfront/config.xml +++ b/modules/trackingfront/config.xml @@ -1,9 +1,9 @@ trackingfront - + - + 0 diff --git a/themes/default/address.tpl b/themes/default/address.tpl index 6025dc94b..95159c25b 100644 --- a/themes/default/address.tpl +++ b/themes/default/address.tpl @@ -98,8 +98,7 @@ $(function(){ldelim} {assign var="postCodeExist" value="false"} {foreach from=$ordered_adr_fields item=field_name} {if $field_name eq 'company'} -

    - +

    @@ -236,6 +235,7 @@ $(function(){ldelim} {if isset($back)}{/if} {if isset($mod)}{/if} {if isset($select_address)}{/if} +

    diff --git a/themes/default/best-sales.tpl b/themes/default/best-sales.tpl index e0edbc203..af4e9b04b 100644 --- a/themes/default/best-sales.tpl +++ b/themes/default/best-sales.tpl @@ -43,10 +43,11 @@
    - {include file="./product-sort.tpl"} {include file="./product-compare.tpl"} {include file="./nbr-product-page.tpl"} - + {include file="./product-sort.tpl" paginationId='bottom'} + {include file="./product-compare.tpl" paginationId='bottom'} + {include file="./nbr-product-page.tpl" paginationId='bottom'}
    - {include file="./pagination.tpl"} + {include file="./pagination.tpl" paginationId='bottom'}
    {else}

    {l s='No top sellers for the moment.'}

    diff --git a/themes/default/category.tpl b/themes/default/category.tpl index 15a7187c6..7252b93da 100644 --- a/themes/default/category.tpl +++ b/themes/default/category.tpl @@ -107,11 +107,11 @@
    - {include file="./product-sort.tpl"} - {include file="./product-compare.tpl"} - {include file="./nbr-product-page.tpl"} + {include file="./product-sort.tpl" paginationId='bottom'} + {include file="./product-compare.tpl" paginationId='bottom'} + {include file="./nbr-product-page.tpl" paginationId='bottom'}
    - {include file="./pagination.tpl"} + {include file="./pagination.tpl" paginationId='bottom'}
    {/if} {elseif $category->id} diff --git a/themes/default/css/global.css b/themes/default/css/global.css index a5a6c453a..e92967740 100644 --- a/themes/default/css/global.css +++ b/themes/default/css/global.css @@ -355,7 +355,7 @@ ul.footer_links li .icon { border:1px solid #ccc } -.sortPagiBar #bt_compare { +.sortPagiBar .bt_compare { padding:3px 7px; border:none; color:#fff; @@ -407,19 +407,19 @@ ul.pagination .current span { } ul.pagination li.disabled span {color:#ccc} -#pagination_previous {float:left} -#pagination_next {float:right} +#pagination_previous, .pagination_previous {float:left} +#pagination_next, .pagination_next {float:right} -.ie7 #pagination_previous, -.ie7 #pagination_next {float:none} +.ie7 #pagination_previous, .ie7 .pagination_previous, +.ie7 #pagination_next, .ie7 .pagination_next {float:none} -#pagination_previous a, #pagination_previous span, -#pagination_next a, #pagination_next span { +ul.pagination .pagination_previous a,ul.pagination .pagination_previous span, +ul.pagination .pagination_next a, ul.pagination .pagination_next span { padding:0 8px; width:auto; } -#pagination_previous span, -#pagination_next span { +#pagination_previous, .pagination_previous span, +#pagination_next, .pagination_next span { color:#ccc; border:1px solid #eee } diff --git a/themes/default/js/modules/blocklayered/blocklayered.js b/themes/default/js/modules/blocklayered/blocklayered.js new file mode 100644 index 000000000..9f556a5a8 --- /dev/null +++ b/themes/default/js/modules/blocklayered/blocklayered.js @@ -0,0 +1,618 @@ +/* +* 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 Registred Trademark & Property of PrestaShop SA +*/ + +var ajaxQueries = new Array(); +var ajaxLoaderOn = 0; +var sliderList = new Array(); +var slidersInit = false; + +$(document).ready(function() +{ + cancelFilter(); + openCloseFilter(); + + // Click on color + $('#layered_form input[type=button], #layered_form label.layered_color').live('click', function() + { + if (!$('input[name='+$(this).attr('name')+'][type=hidden]').length) + $('').attr('type', 'hidden').attr('name', $(this).attr('name')).val($(this).attr('rel')).appendTo('#layered_form'); + else + $('input[name='+$(this).attr('name')+'][type=hidden]').remove(); + reloadContent(); + }); + + // Click on checkbox + $('#layered_form input[type=checkbox], #layered_form input[type=radio], #layered_form select').live('change', function() + { + reloadContent(); + }); + + // Changing content of an input text + $('#layered_form input.layered_input_range').live('keyup', function() + { + if ($(this).attr('timeout_id')) + window.clearTimeout($(this).attr('timeout_id')); + + // IE Hack, setTimeout do not acept the third parameter + var reference = this; + + $(this).attr('timeout_id', window.setTimeout(function(it) { + if (!$(it).attr('id')) + it = reference; + + var filter = $(it).attr('id').replace(/^layered_(.+)_range_.*$/, '$1'); + + var value_min = parseInt($('#layered_'+filter+'_range_min').val()); + if (isNaN(value_min)) + value_min = 0; + $('#layered_'+filter+'_range_min').val(value_min); + + var value_max = parseInt($('#layered_'+filter+'_range_max').val()); + if (isNaN(value_max)) + value_max = 0; + $('#layered_'+filter+'_range_max').val(value_max); + + if (value_max < value_min) { + $('#layered_'+filter+'_range_max').val($(it).val()); + $('#layered_'+filter+'_range_min').val($(it).val()); + } + reloadContent(); + }, 500, this)); + }); + + $('#layered_block_left .radio').live('click', function() { + var name = $(this).attr('name'); + $.each($(this).parent().parent().find('input[type=button]'), function (it, item) { + if ($(item).hasClass('on') && $(item).attr('name') != name) { + $(item).click(); + } + }); + return true; + }); + + // Click on label + $('#layered_block_left label a').live({ + click: function() { + var disable = $(this).parent().parent().find('input').attr('disabled'); + if (disable == '' + || typeof(disable) == 'undefined' + || disable == false) + { + $(this).parent().parent().find('input').click(); + reloadContent(); + } + return false; + } + }); + + layered_hidden_list = {}; + $('.hide-action').live('click', function() { + if (typeof(layered_hidden_list[$(this).parent().find('ul').attr('id')]) == 'undefined' || layered_hidden_list[$(this).parent().find('ul').attr('id')] == false) + { + layered_hidden_list[$(this).parent().find('ul').attr('id')] = true; + } + else + { + layered_hidden_list[$(this).parent().find('ul').attr('id')] = false; + } + hideFilterValueAction(this); + }); + $('.hide-action').each(function() { + hideFilterValueAction(this); + }); + + // To be sure there is no other events attached to the selectPrductSort, change the ID + var id = 1; + while ($('#selectPrductSort').length) { // Because ids are duplicated + // Unbind event change on #selectPrductSort + $('#selectPrductSort').unbind('change'); + $('#selectPrductSort').attr('onchange', ''); + $('#selectPrductSort').addClass('selectProductSort'); + $('#selectPrductSort').attr('id', 'selectPrductSort'+id); + $('label[for=selectPrductSort]').attr('for', 'selectPrductSort'+id); + id++; + } + + // Since 1.5, event is add to .selectProductSort and not to #selectPrductSort + setTimeout(function() { + $('.selectProductSort').unbind('change'); + }, 100); + + $('.selectProductSort').live('change', function(event) { + $('.selectProductSort').val($(this).val()); + reloadContent(); + }); + + $('.js-nb_item').unbind('change').attr('onchange', ''); + + $('.js-nb_item').live('change', function(event) { + $('.js-nb_item').val($(this).val()); + reloadContent(); + }); + + paginationButton(); + initLayered(); +}); + +function hideFilterValueAction(it) +{ + if (typeof(layered_hidden_list[$(it).parent().find('ul').attr('id')]) == 'undefined' || layered_hidden_list[$(it).parent().find('ul').attr('id')] == false) + { + $(it).parent().find('.hiddable').hide(); + $(it).parent().find('.hide-action.less').hide(); + $(it).parent().find('.hide-action.more').show(); + } + else + { + $(it).parent().find('.hiddable').show(); + $(it).parent().find('.hide-action.less').show(); + $(it).parent().find('.hide-action.more').hide(); + } +} + +function addSlider(type, data, unit, format) +{ + sliderList.push({ + type: type, + data: data, + unit: unit, + format: format + }); +} + +function initSliders() +{ + $(sliderList).each(function(i, slider){ + $('#layered_'+slider['type']+'_slider').slider(slider['data']); + + var from = ''; + var to = ''; + switch (slider['format']) + { + case 1: + case 2: + case 3: + case 4: + from = blocklayeredFormatCurrency($('#layered_'+slider['type']+'_slider').slider('values', 0), slider['format'], slider['unit']); + to = blocklayeredFormatCurrency($('#layered_'+slider['type']+'_slider').slider('values', 1), slider['format'], slider['unit']); + break; + case 5: + from = $('#layered_'+slider['type']+'_slider').slider('values', 0)+slider['unit'] + to = $('#layered_'+slider['type']+'_slider').slider('values', 1)+slider['unit']; + break; + } + $('#layered_'+slider['type']+'_range').html(from+' - '+to); + }); +} + +function initLayered() +{ + initSliders(); + initLocationChange(); + updateProductUrl(); + if (window.location.href.split('#').length == 2 && window.location.href.split('#')[1] != '') + { + var params = window.location.href.split('#')[1]; + reloadContent('&selected_filters='+params); + } +} + +function paginationButton() { + $('div.pagination a').not(':hidden').each(function () { + if ($(this).attr('href').search('&p=') == -1) { + var page = 1; + } + else { + var page = $(this).attr('href').replace(/^.*&p=(\d+).*$/, '$1'); + } + var location = window.location.href.replace(/#.*$/, ''); + $(this).attr('href', location+current_friendly_url.replace(/\/page-(\d+)/, '')+'/page-'+page); + }); + $('div.pagination li').not('.current, .disabled').each(function () { + var nbPage = 0; + if ($(this).hasClass('pagination_next')) + nbPage = parseInt($('div.pagination li.current').children().html())+ 1; + else if ($(this).hasClass('pagination_previous')) + nbPage = parseInt($('div.pagination li.current').children().html())- 1; + + $(this).children().click(function () { + if (nbPage == 0) + p = parseInt($(this).html()) + parseInt(nbPage); + else + p = nbPage; + p = '&p='+ p; + reloadContent(p); + nbPage = 0; + return false; + }); + }); +} + +function cancelFilter() +{ + $('#enabled_filters a').live('click', function(e) + { + if ($(this).attr('rel').search(/_slider$/) > 0) + { + if ($('#'+$(this).attr('rel')).length) + { + $('#'+$(this).attr('rel')).slider('values' , 0, $('#'+$(this).attr('rel')).slider('option' , 'min' )); + $('#'+$(this).attr('rel')).slider('values' , 1, $('#'+$(this).attr('rel')).slider('option' , 'max' )); + $('#'+$(this).attr('rel')).slider('option', 'slide')(0,{values:[$('#'+$(this).attr('rel')).slider( 'option' , 'min' ), $('#'+$(this).attr('rel')).slider( 'option' , 'max' )]}); + } + else if($('#'+$(this).attr('rel').replace(/_slider$/, '_range_min')).length) + { + $('#'+$(this).attr('rel').replace(/_slider$/, '_range_min')).val($('#'+$(this).attr('rel').replace(/_slider$/, '_range_min')).attr('limitValue')); + $('#'+$(this).attr('rel').replace(/_slider$/, '_range_max')).val($('#'+$(this).attr('rel').replace(/_slider$/, '_range_max')).attr('limitValue')); + } + } + else + { + if ($('option#'+$(this).attr('rel')).length) + { + $('#'+$(this).attr('rel')).parent().val(''); + } + else + { + $('#'+$(this).attr('rel')).attr('checked', false); + $('.'+$(this).attr('rel')).attr('checked', false); + $('#layered_form input[type=hidden][name='+$(this).attr('rel')+']').remove(); + } + } + reloadContent(); + e.preventDefault(); + }); +} + +function openCloseFilter() +{ + $('#layered_form span.layered_close a').live('click', function(e) + { + if ($(this).html() == '<') + { + $('#'+$(this).attr('rel')).show(); + $(this).html('v'); + $(this).parent().removeClass('closed'); + } + else + { + $('#'+$(this).attr('rel')).hide(); + $(this).html('<'); + $(this).parent().addClass('closed'); + } + + e.preventDefault(); + }); +} + +function stopAjaxQuery() { + if (typeof(ajaxQueries) == 'undefined') + ajaxQueries = new Array(); + for(i = 0; i < ajaxQueries.length; i++) + ajaxQueries[i].abort(); + ajaxQueries = new Array(); +} + +function reloadContent(params_plus) +{ + stopAjaxQuery(); + + if (!ajaxLoaderOn) + { + $('#product_list').prepend($('#layered_ajax_loader').html()); + $('#product_list').css('opacity', '0.7'); + ajaxLoaderOn = 1; + } + + data = $('#layered_form').serialize(); + $('.layered_slider').each( function () { + var sliderStart = $(this).slider('values', 0); + var sliderStop = $(this).slider('values', 1); + if (typeof(sliderStart) == 'number' && typeof(sliderStop) == 'number') + data += '&'+$(this).attr('id')+'='+sliderStart+'_'+sliderStop; + }); + + $(['price', 'weight']).each(function(it, sliderType) + { + if ($('#layered_'+sliderType+'_range_min').length) + { + data += '&layered_'+sliderType+'_slider='+$('#layered_'+sliderType+'_range_min').val()+'_'+$('#layered_'+sliderType+'_range_max').val(); + } + }); + + $('#layered_form .select option').each( function () { + if($(this).attr('id') && $(this).parent().val() == $(this).val()) + { + data += '&'+$(this).attr('id') + '=' + $(this).val(); + } + }); + + if ($('.selectProductSort').length && $('.selectProductSort').val()) + { + if ($('.selectProductSort').val().search(/orderby=/) > 0) + { + // Old ordering working + var splitData = [ + $('.selectProductSort').val().match(/orderby=(\w*)/)[1], + $('.selectProductSort').val().match(/orderway=(\w*)/)[1] + ]; + } + else + { + // New working for default theme 1.4 and theme 1.5 + var splitData = $('.selectProductSort').val().split(':'); + } + data += '&orderby='+splitData[0]+'&orderway='+splitData[1]; + } + if ($('.js-nb_item').length) + { + data += '&n='+$('.js-nb_item').val(); + } + + var slideUp = true; + if (params_plus == undefined) + { + params_plus = ''; + slideUp = false; + } + + // Get nb items per page + var n = ''; + $('div.pagination .js-nb_item').children().each(function(it, option) { + if (option.selected) + n = '&n='+option.value; + }); + + ajaxQuery = $.ajax( + { + type: 'GET', + url: baseDir + 'modules/blocklayered/blocklayered-ajax.php', + data: data+params_plus+n, + dataType: 'json', + cache: false, // @todo see a way to use cache and to add a timestamps parameter to refresh cache each 10 minutes for example + success: function(result) + { + $('#layered_block_left').replaceWith(utf8_decode(result.filtersBlock)); + + $('.category-product-count').html(result.categoryCount); + + if (result.productList) + $('#product_list').replaceWith(utf8_decode(result.productList)); + else + $('#product_list').html(''); + + $('#product_list').css('opacity', '1'); + if ($.browser.msie) // Fix bug with IE8 and aliasing + $('#product_list').css('filter', ''); + + if (result.pagination.search(/[^\s]/) >= 0) { + if ($(result.pagination).find('ul.pagination').length) + { + $('div.pagination').show(); + $('ul.pagination').each(function () { + $(this).replaceWith($(result.pagination).find('ul.pagination')); + }); + } + else if (!$('ul.pagination').length) + { + $('div.pagination').show(); + $('div.pagination').each(function () { + $(this).html($(result.pagination)); + }); + } + else + { + $('ul.pagination').html(''); + $('div.pagination').hide(); + } + } + else + { + $('ul.pagination').html(''); + $('div.pagination').hide(); + } + + paginationButton(); + ajaxLoaderOn = 0; + + // On submiting nb items form, relaod with the good nb of items + $('div.pagination form').submit(function() { + val = $('div.pagination .js-nb_item').val(); + $('div.pagination .js-nb_item').children().each(function(it, option) { + if (option.value == val) + $(option).attr('selected', true); + else + $(option).removeAttr('selected'); + }); + // Reload products and pagination + reloadContent(); + return false; + }); + if (typeof(ajaxCart) != "undefined") + ajaxCart.overrideButtonsInThePage(); + + if (typeof(reloadProductComparison) == 'function') + reloadProductComparison(); + initSliders(); + + // Currente page url + if (typeof(current_friendly_url) == 'undefined') + current_friendly_url = '#'; + + // Get all sliders value + $(['price', 'weight']).each(function(it, sliderType) + { + if ($('#layered_'+sliderType+'_slider').length) + { + // Check if slider is enable & if slider is used + if(typeof($('#layered_'+sliderType+'_slider').slider('values', 0)) != 'object') + { + if ($('#layered_'+sliderType+'_slider').slider('values', 0) != $('#layered_'+sliderType+'_slider').slider('option' , 'min') + || $('#layered_'+sliderType+'_slider').slider('values', 1) != $('#layered_'+sliderType+'_slider').slider('option' , 'max')) + current_friendly_url += '/'+sliderType+'-'+$('#layered_'+sliderType+'_slider').slider('values', 0)+'-'+$('#layered_'+sliderType+'_slider').slider('values', 1) + } + } + else if ($('#layered_'+sliderType+'_range_min').length) + { + current_friendly_url += '/'+sliderType+'-'+$('#layered_'+sliderType+'_range_min').val()+'-'+$('#layered_'+sliderType+'_range_max').val(); + } + }); + if (current_friendly_url == '#') + current_friendly_url = '#/'; + window.location = current_friendly_url; + lockLocationChecking = true; + + if(slideUp) + $.scrollTo('#product_list', 400); + updateProductUrl(); + + $('.hide-action').each(function() { + hideFilterValueAction(this); + }); + } + }); + ajaxQueries.push(ajaxQuery); +} + +function initLocationChange(func, time) +{ + if(!time) time = 500; + var current_friendly_url = getUrlParams(); + setInterval(function() + { + if(getUrlParams() != current_friendly_url && !lockLocationChecking) + { + // Don't reload page if current_friendly_url and real url match + if (current_friendly_url.replace(/^#(\/)?/, '') == getUrlParams().replace(/^#(\/)?/, '')) + return; + + lockLocationChecking = true; + reloadContent('&selected_filters='+getUrlParams().replace(/^#/, '')); + } + else { + lockLocationChecking = false; + current_friendly_url = getUrlParams(); + } + }, time); +} + +function getUrlParams() +{ + var params = current_friendly_url; + if(window.location.href.split('#').length == 2 && window.location.href.split('#')[1] != '') + params = '#'+window.location.href.split('#')[1]; + return params; +} + +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 .product_desc a,'+ + 'ul#product_list li.ajax_block_product .lnk_view'), function() { + $(this).attr('href', $(this).attr('href') + param_product_url); + }); + } +} + + +/** + * Copy of the php function utf8_decode() + */ +function utf8_decode (utfstr) { + var res = ''; + for (var i = 0; i < utfstr.length;) { + var c = utfstr.charCodeAt(i); + + if (c < 128) + { + res += String.fromCharCode(c); + i++; + } + else if((c > 191) && (c < 224)) + { + var c1 = utfstr.charCodeAt(i+1); + res += String.fromCharCode(((c & 31) << 6) | (c1 & 63)); + i += 2; + } + else + { + var c1 = utfstr.charCodeAt(i+1); + var c2 = utfstr.charCodeAt(i+2); + res += String.fromCharCode(((c & 15) << 12) | ((c1 & 63) << 6) | (c2 & 63)); + i += 3; + } + } + return res; +} + + +/** + * Return a formatted price + * Copy from tools.js + */ +function blocklayeredFormatCurrency(price, currencyFormat, currencySign, currencyBlank) +{ + // if you modified this function, don't forget to modify the PHP function displayPrice (in the Tools.php class) + blank = ''; + price = parseFloat(price.toFixed(6)); + price = ps_round(price, priceDisplayPrecision); + if (currencyBlank > 0) + blank = ' '; + if (currencyFormat == 1) + return currencySign + blank + blocklayeredFormatNumber(price, priceDisplayPrecision, ',', '.'); + if (currencyFormat == 2) + return (blocklayeredFormatNumber(price, priceDisplayPrecision, ' ', ',') + blank + currencySign); + if (currencyFormat == 3) + return (currencySign + blank + blocklayeredFormatNumber(price, priceDisplayPrecision, '.', ',')); + if (currencyFormat == 4) + return (blocklayeredFormatNumber(price, priceDisplayPrecision, ',', '.') + blank + currencySign); + return price; +} + + +/** + * Return a formatted number + * Copy from tools.js + */ +function blocklayeredFormatNumber(value, numberOfDecimal, thousenSeparator, virgule) +{ + value = value.toFixed(numberOfDecimal); + var val_string = value+''; + var tmp = val_string.split('.'); + var abs_val_string = (tmp.length == 2) ? tmp[0] : val_string; + var deci_string = ('0.' + (tmp.length == 2 ? tmp[1] : 0)).substr(2); + var nb = abs_val_string.length; + + for (var i = 1 ; i < 4; i++) + if (value >= Math.pow(10, (3 * i))) + abs_val_string = abs_val_string.substring(0, nb - (3 * i)) + thousenSeparator + abs_val_string.substring(nb - (3 * i)); + + if (parseInt(numberOfDecimal) == 0) + return abs_val_string; + return abs_val_string + virgule + (deci_string > 0 ? deci_string : '00'); +} diff --git a/themes/default/js/product.js b/themes/default/js/product.js index 7f3959df2..8e959b9ae 100644 --- a/themes/default/js/product.js +++ b/themes/default/js/product.js @@ -442,9 +442,9 @@ function displayDiscounts(combination) $(this).fadeOut('slow'); }); - if ($('#quantityDiscount_' + combination).length != 0) + if ($('#quantityDiscount_' + combination+',.quantityDiscount_' + combination).length != 0) { - $('#quantityDiscount_' + combination).show(); + $('#quantityDiscount_' + combination+',.quantityDiscount_' + combination).show(); $('#noQuantityDiscount').hide(); } else diff --git a/themes/default/manufacturer.tpl b/themes/default/manufacturer.tpl index aa278a3d9..e4ae56cc1 100644 --- a/themes/default/manufacturer.tpl +++ b/themes/default/manufacturer.tpl @@ -56,10 +56,11 @@
    - {include file="./product-sort.tpl"} {include file="./product-compare.tpl"} {include file="./nbr-product-page.tpl"} - + {include file="./product-sort.tpl" paginationId='bottom'} + {include file="./product-compare.tpl" paginationId='bottom'} + {include file="./nbr-product-page.tpl" paginationId='bottom'}
    - {include file="./pagination.tpl"} + {include file="./pagination.tpl" paginationId='bottom'}
    {else}

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

    diff --git a/themes/default/modules/blockcategories/category-tree-branch.tpl b/themes/default/modules/blockcategories/category-tree-branch.tpl index 71ab1125e..63bbcb73e 100644 --- a/themes/default/modules/blockcategories/category-tree-branch.tpl +++ b/themes/default/modules/blockcategories/category-tree-branch.tpl @@ -24,7 +24,8 @@ *}
  • - {$node.name|escape:'htmlall':'UTF-8'} + {$node.name|escape:'htmlall':'UTF-8'} {if $node.children|@count > 0}
      {foreach from=$node.children item=child name=categoryTreeBranch} diff --git a/themes/default/nbr-product-page.tpl b/themes/default/nbr-product-page.tpl index 441fa169e..b5c72e981 100644 --- a/themes/default/nbr-product-page.tpl +++ b/themes/default/nbr-product-page.tpl @@ -44,7 +44,7 @@

      {if isset($search_query) AND $search_query}{/if} {if isset($tag) AND $tag AND !is_array($tag)}{/if} - + {if is_array($requestNb)} {foreach from=$requestNb item=requestValue key=requestKey} {if $requestKey != 'requestUrl'} @@ -52,7 +52,7 @@ {/if} {/foreach} {/if} - {assign var="lastnValue" value="0"} {foreach from=$nArray item=nValue} {if $lastnValue <= $nb_products} diff --git a/themes/default/new-products.tpl b/themes/default/new-products.tpl index 899f8ba72..211225734 100644 --- a/themes/default/new-products.tpl +++ b/themes/default/new-products.tpl @@ -46,7 +46,7 @@ {include file="./product-sort.tpl"} {include file="./product-compare.tpl"} {include file="./nbr-product-page.tpl"} - {include file="./pagination.tpl"} + {include file="./pagination.tpl" paginationId='bottom'} {else}

      {l s='No new products.'}

      diff --git a/themes/default/order-address.tpl b/themes/default/order-address.tpl index 1b2128fac..a831a0360 100644 --- a/themes/default/order-address.tpl +++ b/themes/default/order-address.tpl @@ -106,6 +106,9 @@ function buildAddressBlock(id_address, address_type, dest_comp) { + if (isNaN(id_address)) + return; + var adr_titles_vals = getAddressesTitles(); var li_content = formatedAddressFieldsValuesList[id_address]['formated_fields_values']; var ordered_fields_name = ['title']; diff --git a/themes/default/order-detail.tpl b/themes/default/order-detail.tpl index b1a0144c7..d7fb91517 100644 --- a/themes/default/order-detail.tpl +++ b/themes/default/order-detail.tpl @@ -310,6 +310,21 @@ + {if $return_allowed} +
      +

      {l s='Merchandise return'}

      +

      {l s='If you wish to return one or more products, please mark the corresponding boxes and provide an explanation for the return. When complete, click the button below.'}

      +

      + +

      +

      + + +

      +
      +
      + {/if} +
      {if $order->getShipping()|count > 0} @@ -340,22 +355,6 @@
      {if !$is_guest} - {if $return_allowed} -
      -

      {l s='Merchandise return'}

      -

      {l s='If you wish to return one or more products, please mark the corresponding boxes and provide an explanation for the return. When complete, click the button below.'}

      -

      - -

      -

      - - -

      -
      -
      - {/if} - - {if count($messages)}

      {l s='Messages'}

      diff --git a/themes/default/order-opc-new-account.tpl b/themes/default/order-opc-new-account.tpl index faab28386..676ee7b11 100644 --- a/themes/default/order-opc-new-account.tpl +++ b/themes/default/order-opc-new-account.tpl @@ -220,7 +220,6 @@

      +

      diff --git a/themes/default/product-sort.tpl b/themes/default/product-sort.tpl index 89e6ec382..24fb8d0ad 100644 --- a/themes/default/product-sort.tpl +++ b/themes/default/product-sort.tpl @@ -38,25 +38,26 @@ {assign var='request' value=$link->getPaginationLink(false, false, false, true)} {/if} {/if} - +{if !isset($paginationId) || $paginationId == ''} - -
      +{/if} +

      - - {if !$PS_CATALOG_MODE} diff --git a/themes/default/product.tpl b/themes/default/product.tpl index a9a3ed9e4..97f5bbb08 100644 --- a/themes/default/product.tpl +++ b/themes/default/product.tpl @@ -470,7 +470,7 @@ var fieldRequired = '{l s='Please fill in all the required fields before saving

      {foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'} - +
      {if (isset($quantity_discount.attributes) && ($quantity_discount.attributes))} {$product->getProductName($quantity_discount.id_product, $quantity_discount.id_product_attribute)} diff --git a/themes/default/supplier.tpl b/themes/default/supplier.tpl index 9c40ab2d4..b9f650505 100644 --- a/themes/default/supplier.tpl +++ b/themes/default/supplier.tpl @@ -50,10 +50,11 @@
      - {include file="./product-sort.tpl"} {include file="./product-compare.tpl"} {include file="./nbr-product-page.tpl"} - + {include file="./product-sort.tpl" paginationId='bottom'} + {include file="./product-compare.tpl" paginationId='bottom'} + {include file="./nbr-product-page.tpl" paginationId='bottom'}
      - {include file="./pagination.tpl"} + {include file="./pagination.tpl" paginationId='bottom'}
      {else}

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

      diff --git a/themes/live_edit.tpl b/themes/live_edit.tpl index 52f28163b..db7585645 100644 --- a/themes/live_edit.tpl +++ b/themes/live_edit.tpl @@ -24,11 +24,11 @@ *}