";
this.prices_ajax_in_progress = false;
},
paymentMethod : function(){
if (arguments.length > 1)
return this.setPaymentMethod(arguments);
else
return this.getPaymentMethod();
},
setPaymentMethod : function(){
var select = this.getPaymentMethod(),
href = window.location.href,
get_name = 'payment_method',
get_vars = href.substring(href.indexOf("?") + 1),
pos = get_vars.indexOf(get_name + "="),
val = get_vars.substring(pos + get_name.length + 1);
pos = val.indexOf("&");
if (pos 1)
this.updatePaymentMethod(arguments);
},
/**
* Fires when payment method changed. Dont need ajax.
*/
updatePaymentMethod : function(select, cancel_callback){
var options = select.getElementsByTagName('option');
var i = 0;
while (!options[i].selected && i 0) {
var newstr = ' (+' + this.prices_ajax_response.drivers[name].fee_amount + ')';
var oldstr = options[j].getAttribute('data-ami-driver-fee');
if (oldstr){
options[j].innerHTML = options[j].innerHTML.replace(oldstr, newstr);
} else {
options[j].innerHTML += newstr;
}
options[j].setAttribute('data-ami-driver-fee', newstr);
}
}
};
},
/**
* Set person type: natuaral or juridical
*/
setPersonType : function(type){
this.person_type = type;
document.forms['entryform'].person_type_name.value = type;
cform = document.forms['entryform'];
var aFields = new Array ('company_custom', 'address_custom', 'inn_custom', 'kpp_custom', 'bank_custom', 'bik_custom', 'account_custom', 'corr_account_custom');
var aFields = new Array ('company_custom', 'address_custom', 'inn_custom', 'kpp_custom', 'bank_custom', 'bik_custom', 'account_custom', 'corr_account_custom');
if(type=='natural') {
AMI.$('#natural').removeClass('eshop-ordering__field-sublist_state_hidden');
AMI.$('#juridical').addClass('eshop-ordering__field-sublist_state_hidden');
AMI.$('#juridicalPaymentMethods').attr('disabled', 'disabled');
AMI.$('#naturalPaymentMethods').removeAttr('disabled');
/*cform.person_type[0].checked = true;*/
} else {
AMI.$('#juridical').removeClass('eshop-ordering__field-sublist_state_hidden');
AMI.$('#natural').addClass('eshop-ordering__field-sublist_state_hidden');
AMI.$('#juridicalPaymentMethods').removeAttr('disabled');
AMI.$('#naturalPaymentMethods').attr('disabled', 'disabled');
/*cform.person_type[1].checked = true;*/
}
setDisabledState(aFields, type == 'natural');
setDisabledState(aFields, type == 'natural');
this.getPricesAjaxResponse();
},
togglePersonType : function(checkbox){
if (!checkbox) {
this.setPersonType('natural'); /* default person type */
} else {
if (checkbox.checked) {
this.setPersonType(checkbox.getAttribute('data-ami-person-checked'));
} else {
this.setPersonType(checkbox.getAttribute('data-ami-person-unchecked'));
}
}
},
/**
* Fires when user select another shipping method
*/
changeShippingMethod : function(radio){
var method_id = parseInt(radio.getAttribute('data-ami-method-id'));
var group_id = parseInt(radio.getAttribute('data-ami-group-id'));
if (this.shipping_groups_ids.length > 1) /* many groups of shipping methods at once */ {
this.setComplexShippingModuleMethod( group_id, method_id );
} else if (this.shipping_groups_ids.length === 1){
this.setShippingModuleMethod( group_id, method_id, radio.getAttribute('data-ami-custom-shipping') );
}
this.getPricesAjaxResponse();
},
/**
*
*/
setShippingModuleMethod : function(group_id, method_id, customShipping){
/* Defining current group and existing method ids */
if (method_id && group_id){
this.current_method_of_group[group_id] = method_id;
if (this.avail_shipping_methods[group_id])
this.avail_shipping_methods[group_id].selected_method = method_id;
else
this.avail_shipping_methods[this.avail_shipping_methods.length - 1].selected_method = method_id;
}
var form = document.forms['entryform'];
form.custom_shipping.value = customShipping;
form.get_type_name_custom.value = form.elements['shipping_method_name_' + method_id].value;
var form = document.getElementById('eshop-ordering__purchase-form');
/*var fieldsets_qty = form.getAttribute('data-ami-fieldsets-qty');
for (var i = 0 ; i 0) {
formCustomShipping.value += (formCustomShipping.value.length == 0 ? otherCustomShipping : '|' + otherCustomShipping);
otherCustomShipping = otherCustomShipping.split('|');
for (j = 0 ; j ',{width:784, id:'popup_close_credit', height:750, animation:{ open: 'fadein', close: 'fadeout' }});
}
Товар дня
Ультразвуковой стационарный...
Универсальные отпугиватели
Ультразвуковой стационарный...
Универсальные отпугиватели
Ультразвуковой стационарный...
Универсальные отпугиватели
Ультразвуковой стационарный...
Универсальные отпугиватели
Ультразвуковой стационарный...
Универсальные отпугиватели
Универсальный стационарный...
Универсальные отпугиватели
Все права защищены © 2010-2013