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 a6b966d63..eea8649a9 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 @@ -23,6 +23,10 @@ * International Registered Trademark & Property of PrestaShop SA *} {extends file="helpers/form/form.tpl"} +{block name="script"} + var string_price = '{l s="Will be applied when the price will be:" js=1}'; + var string_weight = '{l s="Will be applied when the weight will be:" js=1}'; +{/block} {block name="field"} {if $input.name == 'zones'} diff --git a/admin-dev/themes/default/template/controllers/carrier_wizard/helpers/form/form_ranges.tpl b/admin-dev/themes/default/template/controllers/carrier_wizard/helpers/form/form_ranges.tpl index 79f1478ab..4cbfdca8e 100644 --- a/admin-dev/themes/default/template/controllers/carrier_wizard/helpers/form/form_ranges.tpl +++ b/admin-dev/themes/default/template/controllers/carrier_wizard/helpers/form/form_ranges.tpl @@ -1,7 +1,7 @@
- + {foreach from=$ranges key=r item=range} @@ -10,7 +10,7 @@ {/foreach} - + {foreach from=$ranges key=r item=range} diff --git a/controllers/admin/AdminCarrierWizardController.php b/controllers/admin/AdminCarrierWizardController.php index c3eb197ee..1070661e4 100644 --- a/controllers/admin/AdminCarrierWizardController.php +++ b/controllers/admin/AdminCarrierWizardController.php @@ -355,6 +355,10 @@ class AdminCarrierWizardControllerCore extends AdminController $tpl_vars['ranges'][$range['id_'.$range_table]] = $range; $tpl_vars['ranges'][$range['id_'.$range_table]]['id_range'] = $range['id_'.$range_table]; } + + // init blank range + if (!count($tpl_vars['ranges'])) + $tpl_vars['ranges'][] = array('id_range' => -1, 'delimiter1' => 0, 'delimiter2' => 5); } public function renderStepFour($carrier) diff --git a/js/admin_carrier_wizard.js b/js/admin_carrier_wizard.js index fffa101af..f7f893ef0 100644 --- a/js/admin_carrier_wizard.js +++ b/js/admin_carrier_wizard.js @@ -42,6 +42,17 @@ function initCarrierWizard() 'transitionEffect' : 'slideleft', 'enableAllSteps' : enableAllSteps }); + displayRangeType(); +} + +function displayRangeType() +{ + if ($('input[name="shipping_method"]:checked').val() == 1) + string = string_weight; + else + string = string_price; + + $('.range_type').html(string); } function onShowStepCallback() @@ -294,6 +305,7 @@ function bind_inputs() data : 'id_carrier='+parseInt($('#id_carrier').val())+'&shipping_method='+parseInt($(this).val())+'&action=changeRanges&ajax=1', success : function(data) { $('#zone_ranges').replaceWith(data); + displayRangeType(); } }); });
Limites par tranche : >=
de poids <