Changeset 3142456
- Timestamp:
- 08/27/2024 06:28:31 PM (18 months ago)
- Location:
- ni-woocommerce-admin-order-columns
- Files:
-
- 9 added
- 3 edited
-
tags/1.6.3 (added)
-
tags/1.6.3/includes (added)
-
tags/1.6.3/includes/ni-order-columns-init.php (added)
-
tags/1.6.3/includes/niocowoo-function.php (added)
-
tags/1.6.3/index.html (added)
-
tags/1.6.3/ni-woocommerce-admin-order-columns.php (added)
-
tags/1.6.3/readme.txt (added)
-
tags/1.6.3/screenshot-1.png (added)
-
trunk/includes/ni-order-columns-init.php (modified) (2 diffs)
-
trunk/includes/niocowoo-function.php (added)
-
trunk/ni-woocommerce-admin-order-columns.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ni-woocommerce-admin-order-columns/trunk/includes/ni-order-columns-init.php
r2649109 r3142456 2 2 if ( ! defined( 'ABSPATH' ) ) { exit;} 3 3 if( !class_exists( 'Ni_Order_Columns_Init' ) ) { 4 class Ni_Order_Columns_Init{ 4 include_once("niocowoo-function.php"); 5 class Ni_Order_Columns_Init extends NiOCoWoo_Function{ 6 var $is_hpos_enable = false; 5 7 function __construct(){ 6 add_filter('manage_edit-shop_order_columns', array(&$this,'ni_add_custom_column'), 11); 7 add_action( 'manage_shop_order_posts_custom_column' , array(&$this,'ni_add_custom_column_content'), 11, 2 ); 8 9 8 $this->is_hpos_enable =$this->is_hpos_enabled() ; 9 10 if ($this->is_hpos_enable){ 11 add_filter( 'manage_woocommerce_page_wc-orders_columns', array(&$this,'ni_add_custom_column'), 11); 12 add_action( 'manage_woocommerce_page_wc-orders_custom_column' , array(&$this,'ni_add_custom_column_content_hpos'), 11, 2 ); 13 }else{ 14 15 add_filter('manage_edit-shop_order_columns', array(&$this,'ni_add_custom_column'), 11); 16 add_action( 'manage_shop_order_posts_custom_column' , array(&$this,'ni_add_custom_column_content'), 11, 2 ); 17 18 } 10 19 11 20 12 21 } 22 13 23 function ni_add_custom_column($columns){ 14 24 $new_columns = array(); 25 26 15 27 16 28 foreach ( $columns as $column_name => $column_info ) { … … 80 92 81 93 } 94 function ni_add_custom_column_content_hpos($column, $post_id){ 95 96 $the_order = wc_get_order( $post_id ); 97 98 //error_log(print_r($the_order, true)); 99 switch ( $column ) { 100 case 'order_products' : 101 $order_items = $the_order->get_items(); 102 103 $admin_url = admin_url("post.php")."?post=niproductid&action=edit"; 104 105 $prodct_name = ''; 106 $prodct_names = array(); 107 foreach( $order_items as $product ) { 108 109 $product_id = isset( $product['product_id'])?$product['product_id']:0; 110 111 $product_sku = get_post_meta($product_id,'_sku',true); 112 113 $product_name = isset( $product['name'])?$product['name']:''; 114 $product_qty = isset( $product['qty'])?$product['qty']:''; 115 116 if ($product_sku != ''){ 117 $prodct_names[] = '<a target="_blank" href="'. str_replace ("niproductid", $product_id,$admin_url) .'">'.$product_name.'</a>' . ' ('. $product_sku .')' .' x '. $product_qty; 118 }else{ 119 $prodct_names[] = '<a target="_blank" href="'. str_replace ("niproductid", $product_id,$admin_url) .'">'.$product_name.'</a>' .' x '. $product_qty; 120 } 121 122 } 123 124 echo $product_list = implode( ', ', $prodct_names ); 125 break; 126 case 'customer_ip_address' : 127 echo $customer_ip = $the_order->get_customer_ip_address(); 128 break; 129 case 'payment_method_title' : 130 echo $payment_method = $the_order->get_payment_method_title(); 131 break; 132 case 'tax_total' : 133 echo wc_price($the_order->get_total_tax()); 134 break; 135 } 136 137 } 82 138 83 139 } -
ni-woocommerce-admin-order-columns/trunk/ni-woocommerce-admin-order-columns.php
r3095547 r3142456 5 5 Description: Ni WooCommerce Admin Order Columns add the order product columns in admin order list. 6 6 Author: anzia 7 Version: 1.6. 27 Version: 1.6.3 8 8 Author URI: http://naziinfotech.com/ 9 9 Plugin URI: https://wordpress.org/plugins/ni-woocommerce-admin-order-columns/ … … 11 11 License URI: http://www.gnu.org/licenses/agpl-3.0.html 12 12 Requires at least: 4.7 13 Tested up to: 6. 5.313 Tested up to: 6.6.1 14 14 WC requires at least: 3.0.0 15 WC tested up to: 8.9.116 Last Updated Date: 31-May-202415 WC tested up to: 9.2.3 16 Last Updated Date: 27-August-2024 17 17 Requires PHP: 7.0 18 18 … … 22 22 public function __construct(){ 23 23 24 add_action( 'before_woocommerce_init', array(&$this,'before_woocommerce_init') ); 25 add_action('plugins_loaded', array($this, 'plugins_loaded')); 26 } 27 function before_woocommerce_init(){ 28 if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { 29 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); 30 } 31 } 32 function plugins_loaded(){ 24 33 include_once('includes/ni-order-columns-init.php'); 25 34 $ni_order_columns_init = new Ni_Order_Columns_Init(); 26 27 add_action( 'before_woocommerce_init', array(&$this,'before_woocommerce_init') );28 35 } 29 function before_woocommerce_init(){30 if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {31 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, false );32 }33 }34 36 } 35 37 $obj = new Ni_WooCommerce_Admin_Order_Columns(); -
ni-woocommerce-admin-order-columns/trunk/readme.txt
r3095557 r3142456 2 2 Contributors: anzia 3 3 Tags: product columns, order columns, admin columns, custom admin columns, sold item 4 Stable tag: 1.6. 24 Stable tag: 1.6.3 5 5 License: GPLv3 or later 6 6 License URI: http://www.gnu.org/licenses/agpl-3.0.html 7 7 Requires at least: 4.7 8 Tested up to: 6. 5.38 Tested up to: 6.6.1 9 9 WC requires at least: 3.0.0 10 WC tested up to: 8.9.111 Last Updated Date: 31-May-202410 WC tested up to: 9.2.3 11 Last Updated Date: 27-August-2024 12 12 Requires PHP: 7.0 13 13 … … 30 30 </ul> 31 31 32 <p> 33 <strong>Note</strong>: This plugin is fully compatible with both WooCommerce's new High-Performance Order Storage (HPOS) and the legacy WordPress posts storage. Whether you are utilizing HPOS or the traditional storage method, you can rely on this plugin to work seamlessly with your current setup. 34 </p> 35 32 36 == Installation == 33 37 … … 54 58 55 59 == Changelog == 60 61 = version 1.6.3 -27-August-2024 = 62 * Tested: Compatible With WooCommerce 9.2.3 63 * Tested: Compatible With WordPress 6.6.1 64 * Compatible: compatible with woocommerce HPOS 56 65 57 66 = version 1.6.2 - 31-May-2024 =
Note: See TracChangeset
for help on using the changeset viewer.