Plugin Directory

Changeset 3022148


Ignore:
Timestamp:
01/16/2024 06:57:05 AM (2 years ago)
Author:
lalamove
Message:

release 1.0.7

Location:
lalamove
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • lalamove/tags/1.0.7/includes/class-lalamove-widget-actions.php

    r2723141 r3022148  
    33 * Widget showed in WooCommerce order detail page
    44 */
     5use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController;
    56
    67require_once 'utility-functions.php';
     
    3334        public function add_meta_box() {
    3435            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                    }
    3846                }
    3947            }
     
    4351         * Generate Widget UI
    4452         */
    45         public function meta_box() {
     53        public function meta_box($wc_post) {
    4654            global $post;
    47             $wc_order_id            = $post->ID;
     55            $wc_order_id            = isset($post) ? $post->ID : $wc_post->get_id();
    4856            $lalamove_order_id      = lalamove_get_single_order_id( $wc_order_id );
    4957            $send_again_with_status = lalamove_get_send_again_with_status();
  • lalamove/tags/1.0.7/lalamove.php

    r2821816 r3022148  
    44 * Plugin URI:        https://wordpress.org/plugins/lalamove
    55 * Description:       A 24/7 on-demand delivery app
    6  * Version:           1.0.6
     6 * Version:           1.0.7
    77 * Author:            partner.support@lalamove.com
    88 * Author URI:        https://lalamove.com/
     
    123123                add_filter( 'bulk_actions-edit-shop_order', array( Lalamove_Widget_Actions::get_instance(), 'multi_stop_order' ) );
    124124                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();
    125126            } else {
    126127                add_action( 'admin_notices', array( $this, 'notice_activate_wc' ) );
     
    147148            add_filter( 'manage_edit-shop_order_columns', array( $this, 'lalamove_add_column_in_order_list' ), 20 );
    148149            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 );
    149157        }
    150158
     
    190198        }
    191199
     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
    192205        public function add_shipping_method( $methods ) {
    193206            $methods['LALAMOVE_CARRIER_SERVICE'] = 'WC_Lalamove_Shipping_Method';
  • lalamove/tags/1.0.7/readme.txt

    r2821816 r3022148  
    44Donate link: https://lalamove.com
    55Requires at least: 5.2
    6 Tested up to: 6.1.1
     6Tested up to: 6.4.2
    77Requires PHP: 7.0
    8 Stable tag: 1.0.6
     8Stable tag: 1.0.7
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    107107== Changelog ==
    108108
     109= 1.0.7 =
     110* [Compatibility Support] Adapt WooCommerce High-Performance Order Storage(HPOS) feature
     111
    109112= 1.0.5 =
    110113* Support multi-stop order
  • lalamove/trunk/includes/class-lalamove-widget-actions.php

    r2723141 r3022148  
    33 * Widget showed in WooCommerce order detail page
    44 */
     5use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController;
    56
    67require_once 'utility-functions.php';
     
    3334        public function add_meta_box() {
    3435            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                    }
    3846                }
    3947            }
     
    4351         * Generate Widget UI
    4452         */
    45         public function meta_box() {
     53        public function meta_box($wc_post) {
    4654            global $post;
    47             $wc_order_id            = $post->ID;
     55            $wc_order_id            = isset($post) ? $post->ID : $wc_post->get_id();
    4856            $lalamove_order_id      = lalamove_get_single_order_id( $wc_order_id );
    4957            $send_again_with_status = lalamove_get_send_again_with_status();
  • lalamove/trunk/lalamove.php

    r2821816 r3022148  
    44 * Plugin URI:        https://wordpress.org/plugins/lalamove
    55 * Description:       A 24/7 on-demand delivery app
    6  * Version:           1.0.6
     6 * Version:           1.0.7
    77 * Author:            partner.support@lalamove.com
    88 * Author URI:        https://lalamove.com/
     
    123123                add_filter( 'bulk_actions-edit-shop_order', array( Lalamove_Widget_Actions::get_instance(), 'multi_stop_order' ) );
    124124                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();
    125126            } else {
    126127                add_action( 'admin_notices', array( $this, 'notice_activate_wc' ) );
     
    147148            add_filter( 'manage_edit-shop_order_columns', array( $this, 'lalamove_add_column_in_order_list' ), 20 );
    148149            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 );
    149157        }
    150158
     
    190198        }
    191199
     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
    192205        public function add_shipping_method( $methods ) {
    193206            $methods['LALAMOVE_CARRIER_SERVICE'] = 'WC_Lalamove_Shipping_Method';
  • lalamove/trunk/readme.txt

    r2821816 r3022148  
    44Donate link: https://lalamove.com
    55Requires at least: 5.2
    6 Tested up to: 6.1.1
     6Tested up to: 6.4.2
    77Requires PHP: 7.0
    8 Stable tag: 1.0.6
     8Stable tag: 1.0.7
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    107107== Changelog ==
    108108
     109= 1.0.7 =
     110* [Compatibility Support] Adapt WooCommerce High-Performance Order Storage(HPOS) feature
     111
    109112= 1.0.5 =
    110113* Support multi-stop order
Note: See TracChangeset for help on using the changeset viewer.