//fixed somes bug on carriers wizard

This commit is contained in:
Vincent Augagneur
2013-08-02 10:54:07 +02:00
parent 46d0663b2f
commit f2146ac2ae
3 changed files with 29 additions and 25 deletions
@@ -38,6 +38,7 @@
var need_to_validate = '{l s='Please validate the last range before create a new one.' js=1}';
var delete_range_confirm = '{l s='Are you sure to delete this range ?' js=1}';
var currency_sign = '{$currency_sign}';
var PS_WEIGHT_UNIT = '{$PS_WEIGHT_UNIT}';
</script>
<div id="carrier_wizard" class="swMain">
<ul class="nbr_steps_{$wizard_steps.steps|count}">
@@ -104,6 +104,7 @@ class AdminCarrierWizardControllerCore extends AdminController
$currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
$this->tpl_view_vars = array(
'currency_sign' => $currency->sign,
'PS_WEIGHT_UNIT' => Configuration::get('PS_WEIGHT_UNIT'),
'enableAllSteps' => Validate::isLoadedObject($carrier),
'wizard_steps' => $this->wizard_steps,
'validate_url' => $this->context->link->getAdminLink('AdminCarrierWizard'),
@@ -306,27 +307,7 @@ class AdminCarrierWizardControllerCore extends AdminController
array(
'type' => 'zone',
'name' => 'zones'
)
)
));
$tpl_vars = array();
$tpl_vars['PS_WEIGHT_UNIT'] = Configuration::get('PS_WEIGHT_UNIT');
$currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
$tpl_vars['currency_sign'] = $currency->sign;
$fields_value = $this->getStepThreeFieldsValues($carrier);
$this->getTplRangesVarsAndValues($carrier, $tpl_vars, $fields_value);
return $this->renderGenericForm(array('form' => $this->fields_form), $fields_value, $tpl_vars);
}
public function renderStepFour($carrier)
{
$this->fields_form = array(
'form' => array(
'id_form' => 'step_carrier_conf',
'input' => array(
),
array(
'type' => 'select',
'label' => $this->l('Out-of-range behavior:'),
@@ -346,7 +327,28 @@ class AdminCarrierWizardControllerCore extends AdminController
'name' => 'name'
),
'desc' => $this->l('Out-of-range behavior occurs when no defined range matches the customer\'s cart (e.g. when the weight of the cart is greater than the highest weight limit defined by the weight ranges)')
)
),
));
$tpl_vars = array();
$tpl_vars['PS_WEIGHT_UNIT'] = Configuration::get('PS_WEIGHT_UNIT');
$currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
$tpl_vars['currency_sign'] = $currency->sign;
$fields_value = $this->getStepThreeFieldsValues($carrier);
$this->getTplRangesVarsAndValues($carrier, $tpl_vars, $fields_value);
return $this->renderGenericForm(array('form' => $this->fields_form), $fields_value, $tpl_vars);
}
public function renderStepFour($carrier)
{
$this->fields_form = array(
'form' => array(
'id_form' => 'step_carrier_conf',
'input' => array(
array(
'type' => 'text',
'label' => $this->l('Maximium package height ('.Configuration::get('PS_DIMENSION_UNIT').'):'),
@@ -388,6 +390,7 @@ class AdminCarrierWizardControllerCore extends AdminController
)
)
));
$fields_value = $this->getStepFourFieldsValues($carrier);
// Added values of object Group
+4 -4
View File
@@ -450,11 +450,11 @@ function add_new_range()
last_sup_val = $('tr.range_sup td:last input').val();
//add new rand sup input
$('tr.range_sup td:last').after('<td class="center"><input name="range_sup[]" type="text" /><sup>*</sup></td>');
$('tr.range_sup td:last').after('<td class="center"><input name="range_sup[]" type="text" /><sup>*</sup><span class="weight_unit" style="display: none;">&nbsp; '+PS_WEIGHT_UNIT+'</span><span class="price_unit" style="display: none;">&nbsp; '+currency_sign+'</span></td>');
//add new rand inf input
$('tr.range_inf td:last').after('<td class="border_bottom center"><input name="range_inf[]" type="text" value="'+last_sup_val+'" /><sup>*</sup></td>');
$('tr.range_inf td:last').after('<td class="border_bottom center"><input name="range_inf[]" type="text" value="'+last_sup_val+'" /><sup>*</sup><span class="weight_unit" style="display: none;">&nbsp; '+PS_WEIGHT_UNIT+'</span><span class="price_unit" style="display: none;">&nbsp; '+currency_sign+'</span></td>');
$('tr.fees_all td:last').after('<td class="center border_top border_bottom"><input style="display:none" type="text" /> <button class="button">'+labelValidate+'</button</td>');
$('tr.fees_all td:last').after('<td class="center border_top border_bottom"><input style="display:none" type="text" /><span class="currency_sign" style="display:none" >'+currency_sign+'</span> <button class="button">'+labelValidate+'</button</td>');
$('tr.fees').each( function () {
$(this).children('td:last').after('<td class="center"><input disabled="disabled" name="fees['+$(this).data('zoneid')+'][]" type="text" /> &nbsp; '+currency_sign+'</td>');
@@ -464,7 +464,7 @@ function add_new_range()
resizeWizard();
bind_inputs();
rebuildTabindex();
displayRangeType();
return false;
}