Plugin Directory

Changeset 3404834


Ignore:
Timestamp:
11/28/2025 08:02:25 AM (4 months ago)
Author:
arture
Message:

Version 2.2.8

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

Legend:

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

    r3387101 r3404834  
    13061306                        $app_users[$app_users_counter]['app_users_picking_amount'] = $item['value'];
    13071307                    }
    1308                     else {
     1308                    elseif (str_contains($item['name'], 'app_users_type')) {
    13091309                        $app_users[$app_users_counter]['app_users_type'] = $item['value'];
     1310                    }
     1311                    else{
     1312                        $app_users[$app_users_counter]['app_users_wp_user_id'] = $item['value'];
    13101313                        $app_users_counter++;
    13111314                    }
  • order-picking-app/trunk/admin/partials/orderpickingapp-settings-page.php

    r3386883 r3404834  
    540540                        <p style="font-size: 14px; text-align: center; margin: 0 15%;">Add all employees who will use the Order Picking App here. In the app you start by choosing a picker. For picked orders/products, the relevant picker is noted in the order notes.</p>
    541541                        <?php
     542
     543                        $wp_users = get_users( array(
     544                            'fields' => array( 'ID', 'display_name', 'user_email' ),
     545                        ) );
     546
    542547                        $noUsers = true;
    543548                        if( isset($app_settings['app_users']) && !empty($app_settings['app_users']) && is_array($app_settings['app_users']) ):
    544549                            $i = count($app_settings['app_users']);
     550
    545551                            foreach( $app_settings['app_users'] as $app_user ):
    546552
     
    552558                                        'app_users_type'            => '',
    553559                                        'app_users_start_time'      => '',
    554                                         'app_users_end_time'        => ''
     560                                        'app_users_end_time'        => '',
     561                                        'app_users_wp_user_id'      => ''
    555562                                    );
    556563                                }
     
    564571                                $i--; ?>
    565572                                <div class="form-group <?php echo ($i == 0)? 'duplicate_row' : ''; ?>" style="width: 100%;margin: 10px 0; min-height: 30px;">
    566                                     <input style="float: left; width: 20%;margin-right: 10px;" type="text" class="form-control app_users_name" name="app_users[][app_users[][app_users_name]]" value="<?php echo $app_user['app_users_name']; ?>" placeholder="<?php echo $app_user['app_users_name']; ?>"/>
     573                                    <input style="float: left; width: 20%;margin-right: 10px;" type="text" class="form-control app_users_name" name="app_users[][app_users_name]]" value="<?php echo $app_user['app_users_name']; ?>" placeholder="<?php echo $app_user['app_users_name']; ?>"/>
    567574                                    <input style="float: left; width: 20%;margin-right: 10px;" type="text" class="form-control" name="app_users[][app_users_password]" value="<?php echo $app_user['app_users_password']; ?>" placeholder="<?php echo __( 'Enter user password (optional)', 'orderpickingapp' ); ?>"/>
    568575                                    <input style="float: left; width: 8%;margin-right: 10px;" type="number" min="0" max="23" step="1" class="woocommerce-Input woocommerce-Input--text input-text" name="app_users[][app_users_start_time]" value="<?php echo $app_user['app_users_start_time']; ?>" placeholder="Start"/>
     
    588595                                        <?php endif; ?>
    589596                                    </select>
     597
     598                                    <select style="float: left; width: 20%;margin-right: 10px;" name="app_users[][app_users_wp_user_id]">
     599                                        <option value=""><?php _e( '— Not connected —', 'orderpickingapp' ); ?></option>
     600                                        <?php if ( ! empty( $wp_users ) ) : ?>
     601                                            <?php foreach ( $wp_users as $user ) : ?>
     602                                                <option value="<?php echo esc_attr( $user->ID ); ?>"
     603                                                    <?php selected( isset($app_user['app_users_wp_user_id']) ? $app_user['app_users_wp_user_id'] : '', $user->ID ); ?>>
     604                                                    <?php echo esc_html( $user->display_name . ' (' . $user->user_email . ')' ); ?>
     605                                                </option>
     606                                            <?php endforeach; ?>
     607                                        <?php endif; ?>
     608                                    </select>
    590609                                </div>
    591610                            <?php
     
    612631                                    <?php if( $app_settings['subscription']['inventory_addon'] ): ?>
    613632                                        <option value="inventory">Inventory</option>
     633                                    <?php endif; ?>
     634                                </select>
     635
     636                                <select style="float: left; width: 20%;margin-right: 10px;" name="app_users[][app_users_wp_user_id]">
     637                                    <option value=""><?php _e( '— Not connected —', 'orderpickingapp' ); ?></option>
     638                                    <?php if ( ! empty( $wp_users ) ) : ?>
     639                                        <?php foreach ( $wp_users as $user ) : ?>
     640                                            <option value="<?php echo esc_attr( $user->ID ); ?>">
     641                                                <?php echo esc_html( $user->display_name . ' (' . $user->user_email . ')' ); ?>
     642                                            </option>
     643                                        <?php endforeach; ?>
    614644                                    <?php endif; ?>
    615645                                </select>
  • order-picking-app/trunk/includes/class-orderpickingapp.php

    r3386883 r3404834  
    722722                                    $order_date = apply_filters('orderpickingapp_order_date', $order_date, $total_picking_order);
    723723
    724                                     $open_picking_orders[] = array(
     724                                    $order_data = array(
    725725                                        'orderid'               => $total_picking_order_id,
    726726                                        'order_number'          => $order_number,
     
    734734                                        'custom_field'          => $custom_field,
    735735                                    );
     736                                    $open_picking_orders[] = apply_filters('orderpickingapp_order_data', $order_data);
    736737
    737738                                    $total_picking_orders++;
     
    10491050                                    }
    10501051
    1051                                     $open_picking_orders[] = array(
     1052                                    $order_data = array(
    10521053                                        'orderid'               => $total_picking_order_id,
    10531054                                        'order_number'          => $order_number,
     
    10611062                                        'custom_field'          => $custom_field,
    10621063                                    );
     1064                                    $open_picking_orders[] = apply_filters('orderpickingapp_order_data', $order_data);
    10631065
    10641066                                    $total_picking_orders++;
     
    13101312                                            $order_date = apply_filters('orderpickingapp_order_date', $order_date, $total_picking_order);
    13111313
    1312                                             $open_picking_orders[] = array(
    1313                                                 'orderid' => $total_picking_order_id,
     1314                                            $order_data = array(
     1315                                                'orderid'       => $total_picking_order_id,
    13141316                                                'order_number' => $order_number,
    13151317                                                'date' => $order_date,
    13161318                                                'items' => $total_items,
    1317                                                 'total' => $currency_symbol . ' ' . $total_picking_order->get_total(),
    1318                                                 'lastname' => $lastname,
     1319                                            'total'                    => $currency_symbol . ' ' . $total_picking_order->get_total(),
     1320                                                'lastname'              => $lastname,
    13191321                                                'shipping'              => $total_picking_order->get_shipping_method(),
    1320                                                 'claimed_by' => $total_picking_order->get_meta('user_claimed'),
    1321                                                 'custom_field_label' => $custom_field_label,
    1322                                                 'custom_field' => $custom_field,
     1322                                                'claimed_by'            => $total_picking_order->get_meta('user_claimed'),
     1323                                                'custom_field_label'    => $custom_field_label,
     1324                                                'custom_field'          => $custom_field,
    13231325                                            );
     1326                                            $open_picking_orders[] = apply_filters('orderpickingapp_order_data', $order_data);
    13241327
    13251328                                            $total_picking_orders++;
     
    15091512                        $order = wc_create_order();
    15101513                        $order->set_customer_id($customer_id);
     1514
     1515                        // Haal klantgegevens op
     1516                        $customer = new WC_Customer($customer_id);
     1517
     1518                        $billing = [
     1519                            'first_name' => $customer->get_billing_first_name(),
     1520                            'last_name'  => $customer->get_billing_last_name(),
     1521                            'company'    => $customer->get_billing_company(),
     1522                            'address_1'  => $customer->get_billing_address_1(),
     1523                            'address_2'  => $customer->get_billing_address_2(),
     1524                            'city'       => $customer->get_billing_city(),
     1525                            'state'      => $customer->get_billing_state(),
     1526                            'postcode'   => $customer->get_billing_postcode(),
     1527                            'country'    => $customer->get_billing_country(),
     1528                            'email'      => $customer->get_billing_email(),
     1529                            'phone'      => $customer->get_billing_phone(),
     1530                        ];
     1531                        $order->set_address($billing, 'billing');
     1532
     1533                        $shipping = [
     1534                            'first_name' => $customer->get_shipping_first_name(),
     1535                            'last_name'  => $customer->get_shipping_last_name(),
     1536                            'company'    => $customer->get_shipping_company(),
     1537                            'address_1'  => $customer->get_shipping_address_1(),
     1538                            'address_2'  => $customer->get_shipping_address_2(),
     1539                            'city'       => $customer->get_shipping_city(),
     1540                            'state'      => $customer->get_shipping_state(),
     1541                            'postcode'   => $customer->get_shipping_postcode(),
     1542                            'country'    => $customer->get_shipping_country(),
     1543                        ];
     1544                        $order->set_address($shipping, 'shipping');
     1545
    15111546                        $order->set_status('wc-on-hold', 'Order created by ' . ucfirst($appuser) . ' | Order Picking App | ');
    15121547                        foreach ($data['products'] as $product) {
     
    16281663                        $order_date = apply_filters('orderpickingapp_order_date', $order_date, $order);
    16291664
    1630                         wp_send_json( array(
     1665                        $order_data = array(
    16311666                            'orderid'               => $order_id,
    16321667                            'order_number'          => $order_number,
     
    16371672                            'shipping'              => $order->get_shipping_method(),
    16381673                            'order_note'            => $customer_note,
    1639                         ));
     1674                        );
     1675                        $order_data = apply_filters('orderpickingapp_order_data', $order_data);
     1676
     1677                        wp_send_json($order_data);
    16401678                    } else {
    16411679                        $args = array(
     
    19932031                                    $order_date = apply_filters('orderpickingapp_order_date', $order_date, $open_order);
    19942032
    1995                                     $open_picking_orders[] = array(
     2033                                    $order_data = array(
    19962034                                        'orderid'               => $picking_order_id,
    19972035                                        'order_number'          => $order_number,
     
    20052043                                        'custom_field'          => $custom_field,
    20062044                                    );
     2045                                    $open_picking_orders[] = apply_filters('orderpickingapp_order_data', $order_data);
    20072046
    20082047                                    $total_picking_orders++;
     
    22182257                                        $price = $product_info->get_price();
    22192258                                        if (isset($price) && !empty($price)) {
    2220                                             $price = $currency_symbol . ' ' . number_format($product_info->get_price(), 2, ",", ".");
     2259                                            $price = (float)$product_info->get_price();
     2260                                            $price = $currency_symbol . ' ' . number_format($price, 2, ",", ".");
    22212261                                        } else {
    22222262                                            $price = '-';
     
    23262366                                        'custom_field' => '',
    23272367                                    );
    2328                                     $product_data = apply_filters('orderpickingapp_product_data', $product_data);
     2368                                    $product_data = apply_filters('orderpickingapp_product_data', $product_data, $item);
    23292369
    23302370                                    $custom_product_field_label = apply_filters('opa_custom_product_field_label', $custom_product_field_label, $product_id, $item_id);
     
    33423382                        }
    33433383
     3384                        $product_data = apply_filters('orderpickingapp_product_data', $product_data, $item);
     3385
    33443386                        if (isset($output[$packing_order_id]['products'][$identifier]['quantity'])) {
    33453387                            $output[$packing_order_id]['products'][$identifier]['quantity'] += $product_data['quantity'];
     
    37803822                                'picking_locations' => $picking_locations,
    37813823                            );
    3782                             $product_data = apply_filters('orderpickingapp_product_data', $product_data);
     3824                            $product_data = apply_filters('orderpickingapp_product_data', $product_data, []);
    37833825
    37843826                            $product_data['second_barcode'] =  '';
  • order-picking-app/trunk/orderpickingapp.php

    r3387101 r3404834  
    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.7
     5 * Version:           2.2.8
    66 * Author:            Arture | PHP Professionals
    77 * Author URI:        http://arture.nl
  • order-picking-app/trunk/readme.txt

    r3387101 r3404834  
    55Requires at least: 6.0
    66Tested up to: 6.8.3
    7 Stable tag: 2.2.7
     7Stable tag: 2.2.8
    88Requires PHP: 8.0
    99License: GPLv2 or later
     
    5959== Changelog ==
    6060
     61= 2.2.8 =
     62* Added customer fields for billing and shipping to POS order create
     63* Added user connection with picker
     64
    6165= 2.2.7 =
    6266* Bugfix for product finder action and picking location
Note: See TracChangeset for help on using the changeset viewer.