Changeset 3143097
- Timestamp:
- 08/28/2024 05:31:20 PM (19 months ago)
- Location:
- routeapp/trunk
- Files:
-
- 3 edited
-
includes/class-routeapp-woocommerce.php (modified) (7 diffs)
-
readme.txt (modified) (2 diffs)
-
routeapp.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
routeapp/trunk/includes/class-routeapp-woocommerce.php
r3142452 r3143097 24 24 if ($this->routeapp_route_enabled_extra_columns()) { 25 25 add_filter( 'manage_edit-shop_order_columns', array( $this, 'routeapp_add_order_route_columns_header' ), 20 ); 26 add_action( 'manage_shop_order_posts_custom_column', array( $this, 'routeapp_manage_route_charge_posts_custom_column' ) , 99, 2);27 add_action( 'restrict_manage_posts', array( $this, 'routeapp_display_admin_shop_order_route_protection_filter' ) , 99);28 add_action( 'pre_get_posts', array( $this, 'routeapp_process_admin_shop_order_route_protection' ) , 99);29 30 add_action( 'manage_woocommerce_page_wc-orders_custom_column', array( $this, 'routeapp_manage_route_charge_posts_custom_column ' ) , 99, 2 );31 add_action( 'manage_shop_order_custom_column', array( $this, 'routeapp_manage_route_charge_posts_custom_column ' ) , 99, 2 );26 add_action( 'manage_shop_order_posts_custom_column', array( $this, 'routeapp_manage_route_charge_posts_custom_column' )); 27 add_action( 'restrict_manage_posts', array( $this, 'routeapp_display_admin_shop_order_route_protection_filter' ) ); 28 add_action( 'pre_get_posts', array( $this, 'routeapp_process_admin_shop_order_route_protection' )); 29 30 add_action( 'manage_woocommerce_page_wc-orders_custom_column', array( $this, 'routeapp_manage_route_charge_posts_custom_column_new' ) , 99, 2 ); 31 add_action( 'manage_shop_order_custom_column', array( $this, 'routeapp_manage_route_charge_posts_custom_column_new' ) , 99, 2 ); 32 32 33 33 add_filter( 'manage_woocommerce_page_wc-orders_columns', array( $this, 'routeapp_add_order_route_columns_header' ), 20 ); … … 57 57 58 58 /** 59 * Add their respective Route Protection and Route Charge values. 60 * 61 * @since 1.0.3 62 * @return void 63 */ 64 public function routeapp_manage_route_charge_posts_custom_column( $column ) { 65 global $post; 66 $order = wc_get_order( $post->ID ); 67 68 if ( $column === 'route_charge' ) { 69 echo wc_price( $this->routeapp_get_route_charge_fee( $order ), array( 'currency' => $order->get_currency() ) ); 70 } else if ( $column === 'route_protection' ) { 71 echo $this->routeapp_order_has_route_protection_fee( $order ) ? "Yes" : "No"; 72 } 73 } 74 75 /** 59 76 * Add their respective Route Protection and Route Charge values. 60 77 * … … 62 79 * @return void 63 80 */ 64 public function routeapp_manage_route_charge_posts_custom_column ( $column, $orderParam ) {81 public function routeapp_manage_route_charge_posts_custom_column_new( $column, $orderParam ) { 65 82 global $post; 66 83 … … 87 104 */ 88 105 public function routeapp_get_route_charge_fee( $order ) { 106 global $post; 89 107 $price = ""; 90 108 if ( class_exists('Automattic\WooCommerce\Utilities\OrderUtil') … … 93 111 $price = $order->get_meta('_routeapp_route_charge'); 94 112 } else { 95 // Traditional CPT-based orders are in use. 96 $price = get_post_meta($order->get_id(), '_routeapp_route_charge', true); 113 $orderData = wc_get_order( $post->ID ); 114 if ($orderData) { 115 // Traditional CPT-based orders are in use. 116 $price = get_post_meta($order->get_id(), '_routeapp_route_charge', true); 117 } 97 118 } 98 119 … … 113 134 */ 114 135 public function routeapp_order_has_route_protection_fee( $order ) { 136 global $post; 115 137 $route_protection = "0"; 116 138 if ( class_exists('Automattic\WooCommerce\Utilities\OrderUtil') … … 119 141 $route_protection = $order->get_meta('_routeapp_route_protection'); 120 142 } else { 121 // Traditional CPT-based orders are in use. 122 $route_protection = get_post_meta($order->get_id(), '_routeapp_route_protection', true); 143 $orderData = wc_get_order( $post->ID ); 144 if ($orderData) { 145 // Traditional CPT-based orders are in use. 146 $route_protection = get_post_meta($orderData->get_id(), '_routeapp_route_protection', true); 147 } 123 148 } 124 149 -
routeapp/trunk/readme.txt
r3142452 r3143097 6 6 Requires at least: 4.0 7 7 Tested up to: 6.4.1 8 Stable tag: 2.2.2 08 Stable tag: 2.2.21 9 9 Requires PHP: 5.6 10 10 License: GPLv2 or later … … 106 106 107 107 == Changelog == 108 = 2.2.21 = 109 * Fix route information columns 110 108 111 = 2.2.20 = 109 112 * Fix route information columns, display correct information -
routeapp/trunk/routeapp.php
r3142452 r3143097 10 10 * Plugin URI: https://route.com/for-merchants/ 11 11 * Description: Route allows shoppers to insure their orders with one-click during checkout, adding a layer of 3rd party trust while improving the customer shopping experience. 12 * Version: 2.2.2 012 * Version: 2.2.21 13 13 * Author: Route 14 14 * Author URI: https://route.com/ … … 26 26 * Currently plugin version. 27 27 */ 28 define( 'ROUTEAPP_VERSION', '2.2.2 0' );28 define( 'ROUTEAPP_VERSION', '2.2.21' ); 29 29 30 30 /**
Note: See TracChangeset
for help on using the changeset viewer.