Plugin Directory

Changeset 3363749


Ignore:
Timestamp:
09/18/2025 07:36:59 AM (6 months ago)
Author:
arture
Message:

Version 2.2.2

Location:
order-picking-app/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • order-picking-app/trunk/includes/class-orderpickingapp.php

    r3363062 r3363749  
    237237            'methods' => 'GET',
    238238            'callback' => array($this, 'getOrder'),
     239            'permission_callback' => '__return_true',
     240        ));
     241        register_rest_route('picking/v1', '/unclaim-order', array(
     242            'methods' => 'POST',
     243            'callback' => array($this, 'unClaimOrder'),
    239244            'permission_callback' => '__return_true',
    240245        ));
     
    14021407
    14031408    public
     1409    function unClaimOrder($request)
     1410    {
     1411
     1412        header('Access-Control-Allow-Origin: *');
     1413        header("Access-Control-Allow-Credentials: true");
     1414        header('Access-Control-Allow-Methods: POST');
     1415        header('Access-Control-Max-Age: 1000');
     1416        header('Access-Control-Allow-Headers: Origin, Content-Type, X-Auth-Token , Authorization');
     1417
     1418        $token      = $request->get_param('token');
     1419        $orderid    = $request->get_param('order_id');
     1420
     1421        if (class_exists('WooCommerce')) {
     1422            if (isset($token)) {
     1423                $orderpickingapp_apikey = get_option('orderpickingapp_apikey');
     1424                if (isset($orderpickingapp_apikey) && $token == $orderpickingapp_apikey) {
     1425
     1426                    $Order = wc_get_order($orderid);
     1427                    if (!empty($Order)) {
     1428                        $Order->delete_meta_data('user_claimed');
     1429                        $Order->save();
     1430
     1431                        wp_send_json('Current picker has been removed from order ' . $orderid);
     1432                    } else {
     1433                        wp_send_json('Unknown order ID: ' . $orderid);
     1434                    }
     1435                } else {
     1436                    wp_send_json('Unauthorized');
     1437                    header("HTTP/1.1 401 Unauthorized");
     1438                    exit;
     1439                }
     1440            } else {
     1441                wp_send_json('Unauthorized');
     1442                header("HTTP/1.1 401 Unauthorized");
     1443                exit;
     1444            }
     1445        }
     1446        exit;
     1447    }
     1448
     1449    public
    14041450    function createOrder($request)
    14051451    {
     
    18191865                            $picking_status = $open_order->get_meta('picking_status');
    18201866
    1821                             // Fallback voor sitiatie met otrder gemarkeerd als 'completed' maar nog niet gepickt
     1867                            // Fallback voor sitiatie met order gemarkeerd als 'completed' maar nog niet gepickt
    18221868                            $user_claimed = $open_order->get_meta('user_claimed');
    18231869                            if( $picking_status == 'completed' && (!isset($user_claimed) || empty($user_claimed)) ){
     
    18551901                                    elseif (isset($orderid) && strpos($orderid, 'takeover') !== false) {
    18561902                                        $selected_orderid = str_replace('takeover_', '', $orderid);
    1857                                         delete_post_meta($selected_orderid, 'user_claimed');
     1903
     1904
     1905                                        // Save new picking user
    18581906                                        if( $selected_orderid == $picking_order_id ){
    18591907                                            $picking_orders[] = $open_order;
     1908
     1909                                            $open_order->update_meta_data('user_claimed', $appuser);
     1910                                            $open_order->save();
    18601911                                        }
    18611912                                    }
     
    20772128                                            $picking_location = array_pop($ordered_product_picking_locations);
    20782129
    2079                                             $picking_path = implode(' / ', $product_picking_locations);
     2130                                            $FullCategoryPath = get_term_parents_list($order_cat_id, 'pickingroute', array('separator' => ' / ', 'link' => false, 'format' => 'name'));
     2131
     2132                                            $picking_path = get_term_parents_list($order_cat_id, 'pickingroute', array('separator' => ' / ', 'link' => false, 'format' => 'name'));
     2133                                            $picking_path = rtrim($picking_path, " / ");
    20802134                                        }
     2135
    20812136
    20822137                                        $thumbnail = get_the_post_thumbnail_url($product_id, 'medium');
  • order-picking-app/trunk/orderpickingapp.php

    r3363062 r3363749  
    33 * Plugin Name:       Order Picking App
    44 * Description:       Make your life easier by using the Orderpicking App. You'll never be inefficient if the Orderpicking App is installed in your store. We assist you in all aspects of your webshop. From intelligent selecting to order packing, we have you covered. Connecting the Orderpicking App to your Woocommerce webshop is simple and quick. Within an hour, you'll be online with the Orderpicking App. You're able to pick and pack your orders three times faster and with greater accuracy.
    5  * Version:           2.2.1
     5 * Version:           2.2.2
    66 * Author:            Arture | PHP Professionals
    77 * Author URI:        http://arture.nl
  • order-picking-app/trunk/readme.txt

    r3363062 r3363749  
    55Requires at least: 6.0
    66Tested up to: 6.8.1
    7 Stable tag: 2.2.1
     7Stable tag: 2.2.2
    88Requires PHP: 8.0
    99License: GPLv2 or later
     
    3737== Changelog ==
    3838
     39= 2.2.2 =
     40* New function to unclaim the current picker from the order
     41* Bugfix with takeover action of an order
     42
    3943= 2.2.1 =
    4044* New filter hook for custom product_data change
Note: See TracChangeset for help on using the changeset viewer.