diff --git a/admin-dev/themes/default/template/controllers/orders/form.tpl b/admin-dev/themes/default/template/controllers/orders/form.tpl
index 89b1d1d48..602f9c737 100755
--- a/admin-dev/themes/default/template/controllers/orders/form.tpl
+++ b/admin-dev/themes/default/template/controllers/orders/form.tpl
@@ -431,10 +431,20 @@
function updateCarrierList(carriers)
{
var html = '';
- $.each(carriers, function() {
- html += '';
- });
- $('#id_carrier').html(html);
+ if (carriers.length > 0)
+ {
+ $.each(carriers, function() {
+ html += '';
+ });
+ $('#carrier_form').show();
+ $('#id_carrier').html(html);
+ $('#carriers_err').hide();
+ }
+ else
+ {
+ $('#carrier_form').hide();
+ $('#carriers_err').show().html('{l s='No carrier can be applied to this order'}');
+ }
}
function searchProducts()
@@ -551,11 +561,11 @@
updateCartVouchers(jsonSummary.summary.discounts);
updateAddressesList(jsonSummary.addresses, jsonSummary.cart.id_address_delivery, jsonSummary.cart.id_address_invoice);
- if (!jsonSummary.summary.products.length || !jsonSummary.addresses.length)
+ if (!jsonSummary.summary.products.length || !jsonSummary.addresses.length || !jsonSummary.cart.id_carrier)
$('#carriers_part,#summary_part').hide();
else
$('#carriers_part,#summary_part').show();
-
+
updateCarrierList(jsonSummary.carriers);
if (jsonSummary.cart.gift == 1)
@@ -746,7 +756,6 @@
var addresses_invoice_options = '';
var address_invoice_detail = '';
var address_delivery_detail = '';
-
$.each(addresses, function() {
if (this.id_address == id_address_invoice)
address_invoice_detail = this.company+' '+this.firstname+' '+this.lastname+'
'+this.address1+'
'+this.address2+'
'+this.postcode+' '+this.city+' '+this.country;
@@ -782,27 +791,10 @@
success : function(res)
{
displaySummary(res);
- var x;
- for(x in res.addresses)
- {
- if (res.addresses[x].id_address == $('#id_address_delivery option:selected').val())
- displayAddressDetail('address_delivery_detail', res.addresses[x]);
- else if (res.addresses[x].id_address == $('#id_address_invoice option:selected').val())
- displayAddressDetail('address_invoice_detail', res.addresses[x]);
- }
}
});
}
- function displayAddressDetail(id, address)
- {
- var address_detail = address.company+' '+address.firstname+' '+address.lastname+'
';
- address_detail += address.address1+'
';
- address_detail += address.address2+'
';
- address_detail += address.postcode+' '+address.city+' '+address.country;
- $('#'+id).html(address_detail);
- }
-
{if $show_toolbar}