From 96f8c5ef973f74d6fb8ffc3cab74c917590762ce Mon Sep 17 00:00:00 2001 From: George Burduli Date: Mon, 29 Jul 2024 12:02:37 +0400 Subject: [PATCH] Automatically delete PayPal Package --- modules/ppcp-compat/resources/js/tracking-compat.js | 11 +++++++++++ .../src/Integration/DhlShipmentIntegration.php | 2 -- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/ppcp-compat/resources/js/tracking-compat.js b/modules/ppcp-compat/resources/js/tracking-compat.js index a907ddc8f..3849249ba 100644 --- a/modules/ppcp-compat/resources/js/tracking-compat.js +++ b/modules/ppcp-compat/resources/js/tracking-compat.js @@ -92,6 +92,17 @@ document.addEventListener( 'DOMContentLoaded', () => { } ); } + jQuery( document ).on( + 'mouseover mouseout', + '#dhl_delete_label', + function ( event ) { + jQuery( '#ppcp-shipment-status' ) + .val( 'CANCELLED' ) + .trigger( 'change' ); + document.querySelector( '.update_shipment' ).click(); + } + ); + if ( wcShippingTaxSyncEnabled && typeof wcShippingTaxSyncEnabled !== 'undefined' diff --git a/modules/ppcp-order-tracking/src/Integration/DhlShipmentIntegration.php b/modules/ppcp-order-tracking/src/Integration/DhlShipmentIntegration.php index 1e8961fcb..f51d880ef 100644 --- a/modules/ppcp-order-tracking/src/Integration/DhlShipmentIntegration.php +++ b/modules/ppcp-order-tracking/src/Integration/DhlShipmentIntegration.php @@ -76,8 +76,6 @@ class DhlShipmentIntegration implements Integration { return; } - $foo = $tracking_details; - $paypal_order = ppcp_get_paypal_order( $wc_order ); $capture_id = $this->get_paypal_order_transaction_id( $paypal_order ); $tracking_number = $tracking_details['tracking_number'];