diff --git a/admin/templates/shop-order/order-details.php b/admin/templates/shop-order/order-details.php index be003e2..a877733 100644 --- a/admin/templates/shop-order/order-details.php +++ b/admin/templates/shop-order/order-details.php @@ -206,6 +206,12 @@ if ( $this -> next_order_id ) 'class' => 'btn btn-success btn-sm mr5 ml5' ]; } +$grid -> buttons[] = [ + 'label' => 'Wyślij ponownie zamówienie do apilo.com', + 'url' => '/admin/shop_order/send_order_to_apilo/order_id=' . $this -> order['id'], + 'icon' => 'fa-refresh', + 'class' => 'btn btn-primary btn-sm mr5 ml5 pull-right btn-send-order-to-apilo' +]; $grid -> default_buttons = false; $grid -> external_code = $out; echo $grid -> draw(); @@ -241,6 +247,38 @@ echo $grid -> draw(); }); }, 500 ); }); + + $( 'body' ).on( 'click', '.btn-send-order-to-apilo', function(e) { + e.preventDefault(); + var href = $( this ).attr( 'href' ); + $.alert({ + title: 'Potwierdź', + content: 'Czy na pewno chcesz wysłać zamówienie do apilo.com?', + type: 'orange', + closeIcon: true, + closeIconClass: 'fa fa-times', + typeAnimated: true, + animation: 'opacity', + columnClass: 'col-12 col-lg-10', + theme: 'modern', + icon: 'fa fa-question', + buttons: { + confirm: { + text: 'Tak', + btnClass: 'btn-success', + keys: ['enter'], + action: function() { + document.location.href = href; + } + }, + cancel: { + text: 'Nie', + btnClass: 'btn-dark', + action: function() {} + } + } + }); + }); }); // set_order_as_unpaid diff --git a/admin/templates/site/main-layout.php b/admin/templates/site/main-layout.php index fbb9af0..87e167d 100644 --- a/admin/templates/site/main-layout.php +++ b/admin/templates/site/main-layout.php @@ -168,7 +168,10 @@
-
+ +