Plugin Directory

Changeset 3229864


Ignore:
Timestamp:
01/27/2025 06:20:35 PM (14 months ago)
Author:
routedev
Message:

allow-sync-on-any-status

Location:
routeapp/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • routeapp/trunk/public/class-routeapp-public.php

    r3226449 r3229864  
    879879            }
    880880        }
     881
     882        //Update route included order statuses and route cancel order statuses when the order is created by the admin page without route fee
     883        if(is_admin()){
     884            $this->updateRouteIncludedOrderStatusMetaFields( $order );
     885        }
    881886    }
    882887
     
    16411646    }
    16421647
     1648    /**
     1649     * @param $order
     1650     *
     1651     * @return void
     1652     */
     1653    public function updateRouteIncludedOrderStatusMetaFields( $order ): void {
     1654        try {
     1655            $acceptedOrderStatuses    = get_option( 'routeapp_included_order_statuses' ) ? get_option( 'routeapp_included_order_statuses' ) : [];
     1656            $acceptedCanceledStatuses = get_option( 'routeapp_cancel_order_statuses' ) ? get_option( 'routeapp_cancel_order_statuses' ) : [];
     1657
     1658            if ( class_exists( 'Automattic\WooCommerce\Utilities\OrderUtil' )
     1659                 && OrderUtil::custom_orders_table_usage_is_enabled() ) {
     1660                //save to order the configuration selected regarding order statuses
     1661                $order->update_meta_data( '_routeapp_included_order_statuses', json_encode( $acceptedOrderStatuses ) );
     1662                $order->update_meta_data( '_routeapp_cancel_order_statuses', json_encode( $acceptedCanceledStatuses ) );
     1663                $order->save();
     1664            } else {
     1665                update_post_meta( $order->get_id(), '_routeapp_included_order_statuses', json_encode( $acceptedOrderStatuses ) );
     1666                update_post_meta( $order->get_id(), '_routeapp_cancel_order_statuses', json_encode( $acceptedCanceledStatuses ) );
     1667            }
     1668        } catch ( Exception $e ) {
     1669            // Log the exception and ensure the application flow continues
     1670            error_log( "An error occurred while updating Route order status meta fields: " . $e->getMessage() );
     1671        }
     1672    }
     1673
    16431674}
    16441675
  • routeapp/trunk/readme.txt

    r3226449 r3229864  
    66Requires at least: 4.0
    77Tested up to: 6.7.1
    8 Stable tag: 2.2.23
     8Stable tag: 2.2.24
    99Requires PHP: 5.6
    1010License: GPLv2 or later
     
    106106
    107107== Changelog ==
     108= 2.2.24 =
     109* Update Route Order Status for admin orders without Route Fee
     110
    108111= 2.2.23 =
    109112* Display correctly route fee amount in orders admin view
  • routeapp/trunk/routeapp.php

    r3226449 r3229864  
    1010 * Plugin URI:        https://route.com/for-merchants/
    1111 * 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.23
     12 * Version:           2.2.24
    1313 * Author:            Route
    1414 * Author URI:        https://route.com/
     
    2626 * Currently plugin version.
    2727 */
    28 define( 'ROUTEAPP_VERSION', '2.2.23' );
     28define( 'ROUTEAPP_VERSION', '2.2.24' );
    2929
    3030/**
Note: See TracChangeset for help on using the changeset viewer.