Skip to content

Commit

Permalink
uninstaller added
Browse files Browse the repository at this point in the history
  • Loading branch information
simongomes committed Apr 29, 2021
1 parent e3c04c7 commit ba50ec1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions assets/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
let errorMessage = $( '.error-message' );
let bookingForm = $( '#ste-booking-metabox-form' );
let bookingMetaBoxMessage = $( '#ste-booking-metabox-message' );

parcelSubmitButton.on("click", function (e) {
e.preventDefault();
parcelSubmitButton.prop( 'disabled', true );
Expand Down
2 changes: 1 addition & 1 deletion includes/Admin/STE_Metabox.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function metabox_view_handler() {
*
* @return void
*/
public function set_shipping_info( $order ) {
public function set_shipping_info( \WC_Order $order ) {
$this->shipping_info['recipient_name'] = '' !== trim( $order->get_formatted_shipping_full_name() ) ? $order->get_formatted_shipping_full_name() : $order->get_formatted_billing_full_name();
$this->shipping_info['recipient_mobile'] = $order->get_billing_phone();
$this->shipping_info['recipient_city'] = '' !== trim( $order->get_shipping_city() ) ? $order->get_shipping_city() : $order->get_billing_city();
Expand Down
15 changes: 15 additions & 0 deletions uninstall.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* This will be triggered on plugin uninstall. This will remove the eCourier configurations.
*
* @package ShipToEcourier
*/

if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
die;
}

// Remove eCourier API credentials.
if ( get_option( 'ste_settings' ) ) {
delete_option( 'ste_settings' );
}

0 comments on commit ba50ec1

Please sign in to comment.