Woocommerce neuer Bestellstatus (Fertiggestellt nicht bezahlt)
/**
* Register new woocommerce status
**/
function register_shipment_arrival_order_status_2() {
register_post_status( 'wc-nopaycomp', array(
'label' => 'Versand1 nicht bezahlt',
'public' => true,
'show_in_admin_status_list' => true,
'show_in_admin_all_list' => true,
'exclude_from_search' => false,
'label_count' => _n_noop( 'Versand2 nicht bezahlt <span class="count">(%s)</span>', 'Versand, aber nicht bezahlt <span class="count">(%s)</span>' )
) );
}
add_action( 'init', 'register_shipment_arrival_order_status_2' );
function add_awaiting_shipment_to_order_statuses_2( $order_statuses ) {
$new_order_statuses = array();
foreach ( $order_statuses as $key => $status ) {
$new_order_statuses[ $key ] = $status;
if ( 'wc-processing' === $key ) {
$new_order_statuses['wc-nopaycomp'] = 'Rechnung offen';
}
}
return $new_order_statuses;
}
add_filter( 'wc_order_statuses', 'add_awaiting_shipment_to_order_statuses_2' );
Für alle snippets benutzen wir das Plugin code snippet.