Changeset 3022148
- Timestamp:
- 01/16/2024 06:57:05 AM (2 years ago)
- Location:
- lalamove
- Files:
-
- 6 edited
- 1 copied
-
tags/1.0.7 (copied) (copied from lalamove/trunk)
-
tags/1.0.7/includes/class-lalamove-widget-actions.php (modified) (3 diffs)
-
tags/1.0.7/lalamove.php (modified) (4 diffs)
-
tags/1.0.7/readme.txt (modified) (2 diffs)
-
trunk/includes/class-lalamove-widget-actions.php (modified) (3 diffs)
-
trunk/lalamove.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lalamove/tags/1.0.7/includes/class-lalamove-widget-actions.php
r2723141 r3022148 3 3 * Widget showed in WooCommerce order detail page 4 4 */ 5 use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController; 5 6 6 7 require_once 'utility-functions.php'; … … 33 34 public function add_meta_box() { 34 35 if ( ! empty( $_SERVER['REQUEST_URI'] ) ) { 35 $array = explode( '/', esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ); 36 if ( substr( end( $array ), 0, strlen( 'post-new.php' ) ) !== 'post-new.php' ) { 37 add_meta_box( 'wc-llm-widget', __( 'Lalamove', 'llm-widget' ), array( $this, 'meta_box' ), 'shop_order', 'side', 'high' ); 36 if (strstr( $_SERVER['REQUEST_URI'],'wc-orders') !== false && strstr( $_SERVER['REQUEST_URI'],'edit') !== false) { 37 $screen = class_exists( '\Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController' ) && wc_get_container()->get( CustomOrdersTableController::class )->custom_orders_table_usage_is_enabled() 38 ? wc_get_page_screen_id( 'shop_order' ) 39 : 'shop_order'; 40 add_meta_box( 'wc-llm-widget', __( 'Lalamove', 'llm-widget' ), array( $this, 'meta_box' ), $screen , 'side', 'high' ); 41 } else { 42 $array = explode( '/', esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ); 43 if ( substr( end( $array ), 0, strlen( 'post-new.php' ) ) !== 'post-new.php') { 44 add_meta_box( 'wc-llm-widget', __( 'Lalamove', 'llm-widget' ), array( $this, 'meta_box' ), 'shop_order', 'side', 'high' ); 45 } 38 46 } 39 47 } … … 43 51 * Generate Widget UI 44 52 */ 45 public function meta_box( ) {53 public function meta_box($wc_post) { 46 54 global $post; 47 $wc_order_id = $post->ID;55 $wc_order_id = isset($post) ? $post->ID : $wc_post->get_id(); 48 56 $lalamove_order_id = lalamove_get_single_order_id( $wc_order_id ); 49 57 $send_again_with_status = lalamove_get_send_again_with_status(); -
lalamove/tags/1.0.7/lalamove.php
r2821816 r3022148 4 4 * Plugin URI: https://wordpress.org/plugins/lalamove 5 5 * Description: A 24/7 on-demand delivery app 6 * Version: 1.0. 66 * Version: 1.0.7 7 7 * Author: partner.support@lalamove.com 8 8 * Author URI: https://lalamove.com/ … … 123 123 add_filter( 'bulk_actions-edit-shop_order', array( Lalamove_Widget_Actions::get_instance(), 'multi_stop_order' ) ); 124 124 add_filter( 'handle_bulk_actions-edit-shop_order', array( Lalamove_Widget_Actions::get_instance(), 'multi_stop_order_action' ), 10, 3 ); 125 $this->add_filter_when_hpos_open(); 125 126 } else { 126 127 add_action( 'admin_notices', array( $this, 'notice_activate_wc' ) ); … … 147 148 add_filter( 'manage_edit-shop_order_columns', array( $this, 'lalamove_add_column_in_order_list' ), 20 ); 148 149 add_action( 'manage_shop_order_posts_custom_column', array( $this, 'lalamove_order_column_fecth_data' ), 20, 2 ); 150 } 151 152 private function add_filter_when_hpos_open() { 153 add_filter( 'manage_woocommerce_page_wc-orders_columns', array( $this, 'lalamove_add_column_in_order_list' ), 20 ); 154 add_action( 'manage_woocommerce_page_wc-orders_custom_column', array( $this, 'lalamove_order_column_fecth_data_with_hpos' ), 20, 2 ); 155 add_filter( 'bulk_actions-woocommerce_page_wc-orders', array( Lalamove_Widget_Actions::get_instance(), 'multi_stop_order' ) ); 156 add_filter( 'handle_bulk_actions-woocommerce_page_wc-orders', array( Lalamove_Widget_Actions::get_instance(), 'multi_stop_order_action' ), 10, 3 ); 149 157 } 150 158 … … 190 198 } 191 199 200 function lalamove_order_column_fecth_data_with_hpos( $column, $post ) { 201 self::lalamove_order_column_fecth_data($column, $post->get_id()); 202 } 203 204 192 205 public function add_shipping_method( $methods ) { 193 206 $methods['LALAMOVE_CARRIER_SERVICE'] = 'WC_Lalamove_Shipping_Method'; -
lalamove/tags/1.0.7/readme.txt
r2821816 r3022148 4 4 Donate link: https://lalamove.com 5 5 Requires at least: 5.2 6 Tested up to: 6. 1.16 Tested up to: 6.4.2 7 7 Requires PHP: 7.0 8 Stable tag: 1.0. 68 Stable tag: 1.0.7 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 107 107 == Changelog == 108 108 109 = 1.0.7 = 110 * [Compatibility Support] Adapt WooCommerce High-Performance Order Storage(HPOS) feature 111 109 112 = 1.0.5 = 110 113 * Support multi-stop order -
lalamove/trunk/includes/class-lalamove-widget-actions.php
r2723141 r3022148 3 3 * Widget showed in WooCommerce order detail page 4 4 */ 5 use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController; 5 6 6 7 require_once 'utility-functions.php'; … … 33 34 public function add_meta_box() { 34 35 if ( ! empty( $_SERVER['REQUEST_URI'] ) ) { 35 $array = explode( '/', esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ); 36 if ( substr( end( $array ), 0, strlen( 'post-new.php' ) ) !== 'post-new.php' ) { 37 add_meta_box( 'wc-llm-widget', __( 'Lalamove', 'llm-widget' ), array( $this, 'meta_box' ), 'shop_order', 'side', 'high' ); 36 if (strstr( $_SERVER['REQUEST_URI'],'wc-orders') !== false && strstr( $_SERVER['REQUEST_URI'],'edit') !== false) { 37 $screen = class_exists( '\Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController' ) && wc_get_container()->get( CustomOrdersTableController::class )->custom_orders_table_usage_is_enabled() 38 ? wc_get_page_screen_id( 'shop_order' ) 39 : 'shop_order'; 40 add_meta_box( 'wc-llm-widget', __( 'Lalamove', 'llm-widget' ), array( $this, 'meta_box' ), $screen , 'side', 'high' ); 41 } else { 42 $array = explode( '/', esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ); 43 if ( substr( end( $array ), 0, strlen( 'post-new.php' ) ) !== 'post-new.php') { 44 add_meta_box( 'wc-llm-widget', __( 'Lalamove', 'llm-widget' ), array( $this, 'meta_box' ), 'shop_order', 'side', 'high' ); 45 } 38 46 } 39 47 } … … 43 51 * Generate Widget UI 44 52 */ 45 public function meta_box( ) {53 public function meta_box($wc_post) { 46 54 global $post; 47 $wc_order_id = $post->ID;55 $wc_order_id = isset($post) ? $post->ID : $wc_post->get_id(); 48 56 $lalamove_order_id = lalamove_get_single_order_id( $wc_order_id ); 49 57 $send_again_with_status = lalamove_get_send_again_with_status(); -
lalamove/trunk/lalamove.php
r2821816 r3022148 4 4 * Plugin URI: https://wordpress.org/plugins/lalamove 5 5 * Description: A 24/7 on-demand delivery app 6 * Version: 1.0. 66 * Version: 1.0.7 7 7 * Author: partner.support@lalamove.com 8 8 * Author URI: https://lalamove.com/ … … 123 123 add_filter( 'bulk_actions-edit-shop_order', array( Lalamove_Widget_Actions::get_instance(), 'multi_stop_order' ) ); 124 124 add_filter( 'handle_bulk_actions-edit-shop_order', array( Lalamove_Widget_Actions::get_instance(), 'multi_stop_order_action' ), 10, 3 ); 125 $this->add_filter_when_hpos_open(); 125 126 } else { 126 127 add_action( 'admin_notices', array( $this, 'notice_activate_wc' ) ); … … 147 148 add_filter( 'manage_edit-shop_order_columns', array( $this, 'lalamove_add_column_in_order_list' ), 20 ); 148 149 add_action( 'manage_shop_order_posts_custom_column', array( $this, 'lalamove_order_column_fecth_data' ), 20, 2 ); 150 } 151 152 private function add_filter_when_hpos_open() { 153 add_filter( 'manage_woocommerce_page_wc-orders_columns', array( $this, 'lalamove_add_column_in_order_list' ), 20 ); 154 add_action( 'manage_woocommerce_page_wc-orders_custom_column', array( $this, 'lalamove_order_column_fecth_data_with_hpos' ), 20, 2 ); 155 add_filter( 'bulk_actions-woocommerce_page_wc-orders', array( Lalamove_Widget_Actions::get_instance(), 'multi_stop_order' ) ); 156 add_filter( 'handle_bulk_actions-woocommerce_page_wc-orders', array( Lalamove_Widget_Actions::get_instance(), 'multi_stop_order_action' ), 10, 3 ); 149 157 } 150 158 … … 190 198 } 191 199 200 function lalamove_order_column_fecth_data_with_hpos( $column, $post ) { 201 self::lalamove_order_column_fecth_data($column, $post->get_id()); 202 } 203 204 192 205 public function add_shipping_method( $methods ) { 193 206 $methods['LALAMOVE_CARRIER_SERVICE'] = 'WC_Lalamove_Shipping_Method'; -
lalamove/trunk/readme.txt
r2821816 r3022148 4 4 Donate link: https://lalamove.com 5 5 Requires at least: 5.2 6 Tested up to: 6. 1.16 Tested up to: 6.4.2 7 7 Requires PHP: 7.0 8 Stable tag: 1.0. 68 Stable tag: 1.0.7 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 107 107 == Changelog == 108 108 109 = 1.0.7 = 110 * [Compatibility Support] Adapt WooCommerce High-Performance Order Storage(HPOS) feature 111 109 112 = 1.0.5 = 110 113 * Support multi-stop order
Note: See TracChangeset
for help on using the changeset viewer.