From 3bf0fabfa2b5f731a1c3de6b3cc280924e1b56fb Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Mon, 31 Oct 2011 17:39:09 +0000 Subject: [PATCH] Added quick status change buttons (processing/complete) to orders panel. Closes #49. --- admin/admin-post-types.php | 49 ++++++++++++++++++++++++++++++++++++++ readme.txt | 1 + 2 files changed, 50 insertions(+) diff --git a/admin/admin-post-types.php b/admin/admin-post-types.php index 65cd36d8f90..672ea027e33 100644 --- a/admin/admin-post-types.php +++ b/admin/admin-post-types.php @@ -400,6 +400,7 @@ function woocommerce_edit_order_columns($columns){ $columns["shipping_address"] = __("Shipping", 'woothemes'); $columns["total_cost"] = __("Order Total", 'woothemes'); $columns["order_date"] = __("Date", 'woothemes'); + $columns["order_actions"] = __("Actions", 'woothemes'); return $columns; } @@ -498,6 +499,15 @@ function woocommerce_custom_order_columns($column) { echo '' . apply_filters( 'post_date_column_time', $h_time, $post ) . ''; break; + case "order_actions" : + + ?>

+ status, array('pending', 'on-hold'))) : ?> + status, array('pending', 'on-hold', 'processing'))) : ?> + +

update_status( 'completed' ); + + wp_safe_redirect( wp_get_referer() ); + +} +add_action('wp_ajax_woocommerce-mark-order-complete', 'woocommerce_mark_order_complete'); + +/** + * Mark an order as processing + */ +function woocommerce_mark_order_processing() { + + if( !is_admin() ) die; + if( !current_user_can('edit_posts') ) wp_die( __('You do not have sufficient permissions to access this page.') ); + if( !check_admin_referer()) wp_die( __('You have taken too long. Please go back and retry.', 'woothemes') ); + $order_id = isset($_GET['order_id']) && (int) $_GET['order_id'] ? (int) $_GET['order_id'] : ''; + if(!$order_id) die; + + $order = &new woocommerce_order( $order_id ); + $order->update_status( 'processing' ); + + wp_safe_redirect( wp_get_referer() ); + +} +add_action('wp_ajax_woocommerce-mark-order-processing', 'woocommerce_mark_order_processing'); + + /** * Feature a product from admin */ diff --git a/readme.txt b/readme.txt index 07b9652da50..5d33ff32f0d 100644 --- a/readme.txt +++ b/readme.txt @@ -96,6 +96,7 @@ Yes you can! Join in on our GitHub repository :) https://github.com/woothemes/wo * Made use of transients to store average ratings and improve performance * Adding cart item resets shipping - so free shipping etc is selected when going over a threshold * Changes to shipping calc - if no rates are found, but the user did not enter a state/postcode, it asks them to do so. +* Added quick status change buttons (processing/complete) to orders panel = 1.1.3 - 27/10/2011 = * Improved Force SSL Setting - now forces https urls for enqueued scripts and styles