Я использовал нижеприведенный php, чтобы добавить статус «импортированного» индивидуального заказа в woocommerce, и он отлично работает
> **/ function register_imported_order_status() {
> register_post_status( 'wc-imported', array(
> 'label' => 'Imported',
> 'public' => true,
> 'exclude_from_search' => false,
> 'show_in_admin_all_list' => true,
> 'show_in_admin_status_list' => true,
> 'label_count' => _n_noop( 'Imported <span class="count">(%s)</span>', 'Imported <span class="count">(%s)</span>'
> )
> ) ); } add_action( 'init', 'register_imported_order_status' );
>
> // Add to list of WC Order statuses function
> add_imported_to_order_statuses( $order_statuses ) {
>
> $new_order_statuses = array();
>
> // add new order status after processing
> foreach ( $order_statuses as $key => $status ) {
>
> $new_order_statuses[ $key ] = $status;
>
> if ( 'wc-processing' === $key ) {
> $new_order_statuses['wc-imported'] = 'Imported';
> }
> }
>
> return $new_order_statuses; } add_filter( 'wc_order_statuses', 'add_imported_to_order_statuses' );
-
Однако, когда я пытаюсь массово обновить статус заказа - статус настраиваемого заказа не отображается, как я могу добавить настраиваемый статус к массовым действиям в заказах Woocommerce.
Кроме того, я хочу, чтобы импортированный статус считался зафиксированным платежом. В настоящий момент система не сообщает о продажах $$$, пока мы не изменим статус на «Завершено», но мы хотим, чтобы продажи $$ были доступны сразу после оформления заказа. Как я могу включить в этот статус зафиксированный платеж?
С уважением, Джейкоб