Skip to content

Instantly share code, notes, and snippets.

@webdados
Last active November 15, 2024 17:25
Show Gist options
  • Save webdados/a60dfe4d064342d54f967e1e932e4c96 to your computer and use it in GitHub Desktop.
Save webdados/a60dfe4d064342d54f967e1e932e4c96 to your computer and use it in GitHub Desktop.
<?php
// You need this plugin: https://ptwooplugins.com/product/dpd-portugal-for-woocommerce/
// Change order status after issuing label
add_action( 'woo_dpd_portugal_label_issued', function( $order_id ) {
$order = wc_get_order( $order_id );
$order->update_status( 'completed', 'Order automatically set to Completed after issuing DPD label' );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment