ver. 0.276: ShopOrder migration, Integrations cleanup, global admin search
This commit is contained in:
38
admin/templates/shop-order/order-edit-custom-script.php
Normal file
38
admin/templates/shop-order/order-edit-custom-script.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
function toggleInpostField() {
|
||||
if ($('#transport_id').val() != '2') {
|
||||
$('#inpost_paczkomat').closest('.row').hide();
|
||||
} else {
|
||||
$('#inpost_paczkomat').closest('.row').show();
|
||||
}
|
||||
}
|
||||
|
||||
toggleInpostField();
|
||||
|
||||
$('body').on('change', '#transport_id', function() {
|
||||
toggleInpostField();
|
||||
});
|
||||
|
||||
$('body').on('click', '.btn-paczkomat', function() {
|
||||
window.easyPackAsyncInit = function () {
|
||||
easyPack.init({
|
||||
mapType: 'osm',
|
||||
searchType: 'osm',
|
||||
});
|
||||
|
||||
easyPack.mapWidget('inpost-map', function(point) {
|
||||
$('#inpost_paczkomat').val(point.name + ' | ' + point.address.line1 + ', ' + point.address.line2);
|
||||
$('.inpost-map-container').hide();
|
||||
});
|
||||
};
|
||||
|
||||
$('.inpost-map-container').show();
|
||||
});
|
||||
|
||||
$('body').on('click', '#order-save', function(e) {
|
||||
e.preventDefault();
|
||||
$('#fg-order-details').attr('method', 'POST').attr('action', '/admin/shop_order/order_save/').submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user