Skip to content

Instantly share code, notes, and snippets.

@bekarice
Last active February 26, 2020 05:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bekarice/7148225e80afdd309b4e0553f30a67e0 to your computer and use it in GitHub Desktop.
Save bekarice/7148225e80afdd309b4e0553f30a67e0 to your computer and use it in GitHub Desktop.
<?php // only copy this line if needed!
/**
* Filter the Jilt financial status for the order.
*
* @param string $status the financial status
* @param int $order_id the order's ID
* @return string updated status
*/
add_filter( 'wc_jilt_order_financial_status', function( $status, $order_id ) {
// ENTER YOUR CUSTOM STATUS SLUG HERE IN THE QUOTES
$custom_status = "phone-order";
$order = wc_get_order( $order_id );
// maybe change status from pending to paid for phone orders
if ( $order instanceof \WC_Order && $order->has_status( $custom_status ) ) {
$status = 'paid';
}
return $status;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment