Commit ef8391d7 authored by Varun Sridharan's avatar Varun Sridharan

Fixes #21

Fixed issue #21
parent 27b0ba82
...@@ -20,7 +20,7 @@ class WooCommerce_Quick_Donation_Admin_Function { ...@@ -20,7 +20,7 @@ class WooCommerce_Quick_Donation_Admin_Function {
public function __construct(){ public function __construct(){
add_action( 'post_row_actions', array($this,'protect_donation_product'),99,2); add_action( 'post_row_actions', array($this,'protect_donation_product'),99,2);
add_action( 'parse_query', array( $this, 'hide_donation_order_woocommerce_order' ) ); add_action( 'parse_query', array( $this, 'hide_donation_order_woocommerce_order' ) );
add_filter( 'wc_order_types',array($this,'add_wc_order_types'),99,2); add_filter( 'wc_order_types',array($this,'add_wc_order_types'),1,2);
} }
...@@ -40,12 +40,18 @@ class WooCommerce_Quick_Donation_Admin_Function { ...@@ -40,12 +40,18 @@ class WooCommerce_Quick_Donation_Admin_Function {
public function add_wc_order_types($order_types,$type){ public function add_wc_order_types($order_types,$type){
$order_type = $order_types; $order_type = $order_types;
global $post_type;
if('' == $type){ if('' == $type){
$order_type[] = WC_QD_PT; $order_type[] = WC_QD_PT;
$order_type[] = 'wcqd_project'; $order_type[] = 'wc_qd_orders';
} }
if('shop_order' == $type){
$order_type[] = WC_QD_PT;
$order_type[] = 'wc_qd_orders';
}
return $order_type; return $order_type;
} }
......
This diff is collapsed.
...@@ -139,6 +139,7 @@ class WooCommerce_Quick_Donation_Admin { ...@@ -139,6 +139,7 @@ class WooCommerce_Quick_Donation_Admin {
public function init_admin_class(){ public function init_admin_class(){
$this->functions = new WooCommerce_Quick_Donation_Admin_Function; $this->functions = new WooCommerce_Quick_Donation_Admin_Function;
$this->admin_order_page = new WooCommerce_Quick_Donation_Admin_Order_Page_Functions; $this->admin_order_page = new WooCommerce_Quick_Donation_Admin_Order_Page_Functions;
$this->admin_help = new WooCommerce_Quick_Donation_Admin_Help;
} }
...@@ -180,7 +181,7 @@ class WooCommerce_Quick_Donation_Admin { ...@@ -180,7 +181,7 @@ class WooCommerce_Quick_Donation_Admin {
$args['meta_query'][]['value'] = $_GET['dproj']; $args['meta_query'][]['value'] = $_GET['dproj'];
$args['meta_query'][]['compare'] = '='; $args['meta_query'][]['compare'] = '=';
} }
if(isset($_GET['order_status'])){ $args['post_status'] = $_GET['order_status'];} if(isset($_GET['post_status'])){ $args['post_status'] = $_GET['post_status'];}
$wp_query = new WP_Query($args); $wp_query = new WP_Query($args);
require('wp-donation-listing-table.php'); require('wp-donation-listing-table.php');
tt_render_list_page($wp_query); tt_render_list_page($wp_query);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment