Changeset 3363749
- Timestamp:
- 09/18/2025 07:36:59 AM (6 months ago)
- Location:
- order-picking-app/trunk
- Files:
-
- 3 edited
-
includes/class-orderpickingapp.php (modified) (5 diffs)
-
orderpickingapp.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
order-picking-app/trunk/includes/class-orderpickingapp.php
r3363062 r3363749 237 237 'methods' => 'GET', 238 238 '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'), 239 244 'permission_callback' => '__return_true', 240 245 )); … … 1402 1407 1403 1408 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 1404 1450 function createOrder($request) 1405 1451 { … … 1819 1865 $picking_status = $open_order->get_meta('picking_status'); 1820 1866 1821 // Fallback voor sitiatie met o trder gemarkeerd als 'completed' maar nog niet gepickt1867 // Fallback voor sitiatie met order gemarkeerd als 'completed' maar nog niet gepickt 1822 1868 $user_claimed = $open_order->get_meta('user_claimed'); 1823 1869 if( $picking_status == 'completed' && (!isset($user_claimed) || empty($user_claimed)) ){ … … 1855 1901 elseif (isset($orderid) && strpos($orderid, 'takeover') !== false) { 1856 1902 $selected_orderid = str_replace('takeover_', '', $orderid); 1857 delete_post_meta($selected_orderid, 'user_claimed'); 1903 1904 1905 // Save new picking user 1858 1906 if( $selected_orderid == $picking_order_id ){ 1859 1907 $picking_orders[] = $open_order; 1908 1909 $open_order->update_meta_data('user_claimed', $appuser); 1910 $open_order->save(); 1860 1911 } 1861 1912 } … … 2077 2128 $picking_location = array_pop($ordered_product_picking_locations); 2078 2129 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, " / "); 2080 2134 } 2135 2081 2136 2082 2137 $thumbnail = get_the_post_thumbnail_url($product_id, 'medium'); -
order-picking-app/trunk/orderpickingapp.php
r3363062 r3363749 3 3 * Plugin Name: Order Picking App 4 4 * 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. 15 * Version: 2.2.2 6 6 * Author: Arture | PHP Professionals 7 7 * Author URI: http://arture.nl -
order-picking-app/trunk/readme.txt
r3363062 r3363749 5 5 Requires at least: 6.0 6 6 Tested up to: 6.8.1 7 Stable tag: 2.2. 17 Stable tag: 2.2.2 8 8 Requires PHP: 8.0 9 9 License: GPLv2 or later … … 37 37 == Changelog == 38 38 39 = 2.2.2 = 40 * New function to unclaim the current picker from the order 41 * Bugfix with takeover action of an order 42 39 43 = 2.2.1 = 40 44 * New filter hook for custom product_data change
Note: See TracChangeset
for help on using the changeset viewer.