Changeset 3383093
- Timestamp:
- 10/23/2025 06:27:55 AM (5 months ago)
- Location:
- order-picking-app/trunk
- Files:
-
- 4 edited
-
admin/class-orderpickingapp-admin.php (modified) (1 diff)
-
includes/class-orderpickingapp.php (modified) (12 diffs)
-
orderpickingapp.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
order-picking-app/trunk/admin/class-orderpickingapp-admin.php
r3363062 r3383093 779 779 $order->update_meta_data('user_claimed', $_POST['user_claimed']); 780 780 $order->save(); 781 782 $orderpickingapp_apikey = get_option('orderpickingapp_apikey'); 783 if (!isset($orderpickingapp_apikey) || empty($orderpickingapp_apikey)){ 784 785 $data = array( 786 'platform' => 'woocommerce', 787 'type' => 'picker_assigned', 788 'message' => __('New order assigned to picker: ' .$_POST['user_claimed'], 'orderpickingapp' ), 789 ); 790 791 $url = 'https://orderpickingapp.com/wp-json/picking/v1/send-push-message'; 792 $ch = curl_init(); 793 curl_setopt($ch, CURLOPT_URL, $url); 794 $headers = [ 795 'Authorization: Bearer ' . $_POST['token'], 796 'Referer: ' . site_url(), 797 'Content-Type: application/json', 798 ]; 799 curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 800 curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); 801 curl_setopt($ch, CURLOPT_REFERER, site_url()); 802 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 803 $response = curl_exec($ch); 804 curl_close($ch); 805 } 781 806 } 782 807 } -
order-picking-app/trunk/includes/class-orderpickingapp.php
r3372255 r3383093 1881 1881 if (isset($orderid) && strpos($orderid, 'find_') !== false) { 1882 1882 $selected_orderid = str_replace('find_', '', $orderid); 1883 1884 1883 if( $selected_orderid == $picking_order_id ){ 1885 1884 $picking_orders[] = $open_order; 1885 } 1886 else{ 1887 $custom_order_number = $open_order->get_meta('_alg_wc_full_custom_order_number'); 1888 if( !isset($custom_order_number) || empty($custom_order_number) ){ 1889 $custom_order_number = $open_order->get_meta('_order_number'); 1890 } 1891 if( $selected_orderid == $custom_order_number ){ 1892 $picking_orders[] = $open_order; 1893 } 1886 1894 } 1887 1895 } … … 1901 1909 elseif (isset($orderid) && strpos($orderid, 'takeover') !== false) { 1902 1910 $selected_orderid = str_replace('takeover_', '', $orderid); 1903 1904 1911 1905 1912 // Save new picking user … … 2130 2137 $ordered_product_picking_locations = array_reverse($product_picking_locations); 2131 2138 $picking_location = array_pop($ordered_product_picking_locations); 2132 2133 $FullCategoryPath = get_term_parents_list($order_cat_id, 'pickingroute', array('separator' => ' / ', 'link' => false, 'format' => 'name'));2134 2139 2135 2140 $picking_path = get_term_parents_list($order_cat_id, 'pickingroute', array('separator' => ' / ', 'link' => false, 'format' => 'name')); … … 3525 3530 function getProduct($request) 3526 3531 { 3527 3528 global $woocommerce;3529 3530 3532 header('Access-Control-Allow-Origin: *'); 3531 3533 header("Access-Control-Allow-Methods: GET"); … … 3597 3599 3598 3600 $Products = array(); 3601 $product_variations_amount = 0; 3599 3602 if (isset($product_ids[0])) { 3600 3603 foreach ($product_ids as $product_id) { 3601 3604 3602 3605 $product_info = wc_get_product($product_id); 3603 3604 $product_details = $product_info->get_data();3605 3606 $title = $product_info->get_name();3607 3606 3608 3607 $main_product_id = $product_id; … … 3612 3611 } 3613 3612 else{ 3613 3614 3614 // Skip variable parent/main product 3615 $product_variations = (array)$product_info->get_children(); 3616 $product_variations_amount = count($product_variations); 3615 3617 if( $product_info->get_type() == 'variable' ) { 3616 continue; 3618 3619 if( $product_variations_amount > 1 ) { 3620 continue; 3621 } 3622 else{ 3623 $parent_id = $product_id; 3624 $product_id = $product_variations[0]; 3625 $product_info = wc_get_product($product_id); 3626 } 3617 3627 } 3618 3628 } 3629 3630 3631 $product_details = $product_info->get_data(); 3632 3633 $title = $product_info->get_name(); 3619 3634 3620 3635 // YOAST COMPATIBILITY … … 3651 3666 } 3652 3667 3653 $product_picking_locations = wp_get_post_terms($product_id, 'pickingroute', array("orderby" => "parent")); 3668 $picking_path = ''; 3669 $product_picking_locations = wp_get_post_terms($parent_id, 'pickingroute', array("orderby" => "parent")); 3654 3670 if (isset($product_picking_locations) && !empty($product_picking_locations)) { 3655 3671 $order_cat_id = end($product_picking_locations)->term_id; 3656 3672 $categories = wp_list_pluck($product_picking_locations, 'name'); 3673 $picking_path = get_term_parents_list($order_cat_id, 'pickingroute', array('separator' => ' / ', 'link' => false, 'format' => 'name')); 3674 $picking_path = rtrim($picking_path, " / "); 3657 3675 } 3658 3676 3659 3677 $thumbnail = get_the_post_thumbnail_url($main_product_id, 'medium'); 3660 3661 $sku = $product_details['sku'];3662 3663 if (empty($sku)) {3664 $sku = (string)$product_id;3665 $barcode = '';3666 } else {3667 $barcode = $sku;3668 }3669 3678 3670 3679 if (!empty($product_details['short_description'])) { … … 3708 3717 } 3709 3718 3719 3720 $sku = $product_details['sku']; 3721 if (empty($sku)) { 3722 $parent = wc_get_product($parent_id); 3723 $sku = (string)$product_id; 3724 $barcode = $parent ? $parent->get_sku() : (string)$product_id; 3725 } else { 3726 $barcode = $sku; 3727 } 3728 3729 3710 3730 if (strpos($thumbnail, "?")) { 3711 3731 $thumbnail = substr($thumbnail, 0, strpos($thumbnail, "?")); … … 3722 3742 3723 3743 $allocated_qty = $this->get_allocated_qty_for_product($product_info); 3744 3745 $picking_locations = []; 3746 $all_pickingroute_terms = get_terms(array('taxonomy' => 'pickingroute', 'orderby' => 'name')); 3747 if (isset($all_pickingroute_terms) && !empty($all_pickingroute_terms)) { 3748 foreach( $all_pickingroute_terms as $all_pickingroute_term ){ 3749 $term_parents_list = get_term_parents_list($all_pickingroute_term->term_id, 'pickingroute', array('separator' => ' / ', 'link' => false, 'format' => 'name')); 3750 $picking_locations[$all_pickingroute_term->term_id] = rtrim($term_parents_list, "/ "); } 3751 } 3724 3752 3725 3753 $product_data = array( … … 3731 3759 'barcode' => $barcode, 3732 3760 'price' => $price, 3733 'stock' => $stock,3734 'allocated_qty' => $allocated_qty,3761 'stock' => (int)$stock, 3762 'allocated_qty' => (int)$allocated_qty, 3735 3763 'order_cat' => $order_cat_id, 3736 3764 'categories' => implode(' / ', $categories), … … 3738 3766 'supplier' => $supplier, 3739 3767 'supplier_sku' => get_post_meta($product_id, 'opa_supplier_sku', true), 3740 'picking_path' => '',3741 'picking_locations' => [],3768 'picking_path' => $picking_path, 3769 'picking_locations' => $picking_locations, 3742 3770 ); 3743 3771 $product_data = apply_filters('orderpickingapp_product_data', $product_data); 3744 3745 $picking_path = '';3746 $opa_picking_location = get_post_meta($main_product_id, 'opa_picking_location', true);3747 if( empty($opa_picking_location)) {3748 3749 $all_pickingroute_terms = get_terms(array('taxonomy' => 'pickingroute', 'orderby' => 'name'));3750 if (isset($all_pickingroute_terms) && !empty($all_pickingroute_terms)) {3751 3752 $ordered_product_picking_locations = [];3753 foreach( $all_pickingroute_terms as $all_pickingroute_term ){3754 $ordered_product_picking_locations[$all_pickingroute_term->term_id] = get_term_parents_list($all_pickingroute_term->term_id, 'pickingroute', array('separator' => ' / ', 'link' => false, 'format' => 'name'));3755 }3756 3757 $product_data['picking_locations'] = $ordered_product_picking_locations;3758 }3759 }3760 3772 3761 3773 $product_data['second_barcode'] = ''; … … 3864 3876 if (isset($orderpickingapp_order_status) && !empty($orderpickingapp_order_status)) { 3865 3877 $order_statussen = (array)$orderpickingapp_order_status; 3878 $order_statussen = apply_filters('orderpickingapp_order_statussen_for_allocated_qty', $order_statussen); 3866 3879 } 3867 3880 $statusPlaceholders = implode(',', array_fill(0, count($order_statussen), '%s')); -
order-picking-app/trunk/orderpickingapp.php
r3372255 r3383093 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. 35 * Version: 2.2.4 6 6 * Author: Arture | PHP Professionals 7 7 * Author URI: http://arture.nl -
order-picking-app/trunk/readme.txt
r3372255 r3383093 5 5 Requires at least: 6.0 6 6 Tested up to: 6.8.3 7 Stable tag: 2.2. 37 Stable tag: 2.2.4 8 8 Requires PHP: 8.0 9 9 License: GPLv2 or later … … 59 59 == Changelog == 60 60 61 = 2.2.4 = 62 * Fallback check on find_ product on custom order number/name 63 * Add picking locations to the GetProduct action 64 * Fallback on product search by SKU on parent product with one variation 65 * Allocated quantity field added 66 61 67 = 2.2.3 = 62 68 * Updated features list and app description
Note: See TracChangeset
for help on using the changeset viewer.