Skip to content

Commit

Permalink
[-] BO : carrier range validation when free shipping #PSCSX-3257
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Augagneur committed Sep 8, 2014
1 parent 184063a commit 1ccc7c5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
var invalid_range = '{l s='This range is not valid' js=1}';
var overlapping_range = '{l s='Ranges are overlapping' js=1}';
var range_is_overlapping = '{l s='Ranges are overlapping' js=1}';
var select_at_least_one_zone = '{l s='Please select at least one zone' js=1}';
var multistore_enable = '{$multistore_enable}';
</script>

Expand Down
17 changes: 16 additions & 1 deletion js/admin_carrier_wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,21 @@ function validateSteps(fromStep, toStep)
var is_ok = true;
if ((multistore_enable && fromStep == 3) || (!multistore_enable && fromStep == 2))
{
if (toStep > fromStep && !$('#is_free_on').attr('checked'))
{
is_ok = false;
$('.input_zone').each(function () {
if ($(this).prop('checked'))
is_ok = true;
});

if (!is_ok)
{
displayError([select_at_least_one_zone], fromStep);
return;
}
}

if (toStep > fromStep && !$('#is_free_on').attr('checked') && !validateRange(2))
is_ok = false;
}
Expand Down Expand Up @@ -268,7 +283,7 @@ function validateSteps(fromStep, toStep)
}

function displayError(errors, step_number)
{
{
$('#carrier_wizard .actionBar a.btn').removeClass('disabled');
$('.wizard_error').remove();
str_error = '<div class="error wizard_error" style="display:none"><ul>';
Expand Down

0 comments on commit 1ccc7c5

Please sign in to comment.