-
-
Save bekarice/7148225e80afdd309b4e0553f30a67e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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