// Fix PSTEST-396
This commit is contained in:
@@ -431,10 +431,20 @@
|
|||||||
function updateCarrierList(carriers)
|
function updateCarrierList(carriers)
|
||||||
{
|
{
|
||||||
var html = '';
|
var html = '';
|
||||||
$.each(carriers, function() {
|
if (carriers.length > 0)
|
||||||
html += '<option value="'+this.id_carrier+'">'+this.name+' - '+this.delay+'</option>';
|
{
|
||||||
});
|
$.each(carriers, function() {
|
||||||
$('#id_carrier').html(html);
|
html += '<option value="'+this.id_carrier+'">'+this.name+' - '+this.delay+'</option>';
|
||||||
|
});
|
||||||
|
$('#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()
|
function searchProducts()
|
||||||
@@ -551,11 +561,11 @@
|
|||||||
updateCartVouchers(jsonSummary.summary.discounts);
|
updateCartVouchers(jsonSummary.summary.discounts);
|
||||||
updateAddressesList(jsonSummary.addresses, jsonSummary.cart.id_address_delivery, jsonSummary.cart.id_address_invoice);
|
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();
|
$('#carriers_part,#summary_part').hide();
|
||||||
else
|
else
|
||||||
$('#carriers_part,#summary_part').show();
|
$('#carriers_part,#summary_part').show();
|
||||||
|
|
||||||
updateCarrierList(jsonSummary.carriers);
|
updateCarrierList(jsonSummary.carriers);
|
||||||
|
|
||||||
if (jsonSummary.cart.gift == 1)
|
if (jsonSummary.cart.gift == 1)
|
||||||
@@ -746,7 +756,6 @@
|
|||||||
var addresses_invoice_options = '';
|
var addresses_invoice_options = '';
|
||||||
var address_invoice_detail = '';
|
var address_invoice_detail = '';
|
||||||
var address_delivery_detail = '';
|
var address_delivery_detail = '';
|
||||||
|
|
||||||
$.each(addresses, function() {
|
$.each(addresses, function() {
|
||||||
if (this.id_address == id_address_invoice)
|
if (this.id_address == id_address_invoice)
|
||||||
address_invoice_detail = this.company+' '+this.firstname+' '+this.lastname+'<br />'+this.address1+'<br />'+this.address2+'<br />'+this.postcode+' '+this.city+' '+this.country;
|
address_invoice_detail = this.company+' '+this.firstname+' '+this.lastname+'<br />'+this.address1+'<br />'+this.address2+'<br />'+this.postcode+' '+this.city+' '+this.country;
|
||||||
@@ -782,27 +791,10 @@
|
|||||||
success : function(res)
|
success : function(res)
|
||||||
{
|
{
|
||||||
displaySummary(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+'<br />';
|
|
||||||
address_detail += address.address1+'<br />';
|
|
||||||
address_detail += address.address2+'<br />';
|
|
||||||
address_detail += address.postcode+' '+address.city+' '+address.country;
|
|
||||||
$('#'+id).html(address_detail);
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
{if $show_toolbar}
|
{if $show_toolbar}
|
||||||
<div class="toolbar-placeholder">
|
<div class="toolbar-placeholder">
|
||||||
@@ -990,25 +982,29 @@
|
|||||||
<br />
|
<br />
|
||||||
<fieldset id="carriers_part" style="display:none;">
|
<fieldset id="carriers_part" style="display:none;">
|
||||||
<legend><img src="../img/t/AdminCarriers.gif" />{l s='Carriers'}</legend>
|
<legend><img src="../img/t/AdminCarriers.gif" />{l s='Carriers'}</legend>
|
||||||
<div>
|
<div id="carriers_err" style="display:none;" class="warn"></div>
|
||||||
<p>
|
<div id="carrier_form">
|
||||||
<label>{l s='Carriers:'} </label>
|
<div>
|
||||||
<select name="id_carrier" id="id_carrier">
|
<p>
|
||||||
</select>
|
<label>{l s='Carriers:'} </label>
|
||||||
</p>
|
<select name="id_carrier" id="id_carrier">
|
||||||
<p>
|
</select>
|
||||||
<label for="shipping_price">{l s='Shipping price:'}</label> <input type="text" id="shipping_price" name="shipping_price" size="7" /> <span class="currency_sign"></span>
|
</p>
|
||||||
<a class="button" href="#" onclick="resetShippingPrice()">{l s='Reset shipping price'}</a>
|
<p>
|
||||||
</p>
|
<label for="shipping_price">{l s='Shipping price:'}</label> <input type="text" id="shipping_price" name="shipping_price" size="7" /> <span class="currency_sign"></span>
|
||||||
</div>
|
<a class="button" href="#" onclick="resetShippingPrice()">{l s='Reset shipping price'}</a>
|
||||||
<div id="float:left;">
|
</p>
|
||||||
{if $recyclable_pack}
|
</div>
|
||||||
<p><input type="checkbox" name="carrier_recycled_package" value="1" id="carrier_recycled_package" /> <label for="carrier_recycled_package">{l s='Recycled package'}</label></p>
|
<div id="float:left;">
|
||||||
{/if}
|
{if $recyclable_pack}
|
||||||
{if $gift_wrapping}
|
<p><input type="checkbox" name="carrier_recycled_package" value="1" id="carrier_recycled_package" /> <label for="carrier_recycled_package">{l s='Recycled package'}</label></p>
|
||||||
<p><input type="checkbox" name="order_gift" id="order_gift" value="1" /> <label for="order_gift">{l s='Gift'}</label></p>
|
{/if}
|
||||||
<p><label for="gift_message">{l s='Gift message:'}</label><textarea id="gift_message" cols="40" rows="4"></textarea></p>
|
{if $gift_wrapping}
|
||||||
{/if}
|
<p><input type="checkbox" name="order_gift" id="order_gift" value="1" /> <label for="order_gift">{l s='Gift'}</label></p>
|
||||||
|
<p><label for="gift_message">{l s='Gift message:'}</label><textarea id="gift_message" cols="40" rows="4"></textarea></p>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<br />
|
<br />
|
||||||
|
|||||||
@@ -1604,12 +1604,15 @@ class AdminControllerCore extends Controller
|
|||||||
_PS_JS_DIR_.'toggle.js',
|
_PS_JS_DIR_.'toggle.js',
|
||||||
_PS_JS_DIR_.'tools.js',
|
_PS_JS_DIR_.'tools.js',
|
||||||
_PS_JS_DIR_.'ajax.js',
|
_PS_JS_DIR_.'ajax.js',
|
||||||
_PS_JS_DIR_.'notifications.js',
|
|
||||||
_PS_JS_DIR_.'toolbar.js'
|
_PS_JS_DIR_.'toolbar.js'
|
||||||
));
|
));
|
||||||
|
|
||||||
if (Configuration::get('PS_HELPBOX'))
|
if (!Tools::getValue('submitFormAjax'))
|
||||||
$this->addJS(_PS_JS_DIR_.'helpAccess.js');
|
{
|
||||||
|
$this->addJs(_PS_JS_DIR_.'notifications.js');
|
||||||
|
if (Configuration::get('PS_HELPBOX'))
|
||||||
|
$this->addJS(_PS_JS_DIR_.'helpAccess.js');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* use translations files to replace english expression.
|
* use translations files to replace english expression.
|
||||||
|
|||||||
Reference in New Issue
Block a user