Skip to content

Commit 471dba2

Browse files
committed
v1.4.7
1 parent 3bb2e7e commit 471dba2

File tree

6 files changed

+35
-30
lines changed

6 files changed

+35
-30
lines changed

includes/Admin/Orders/HPOS_List_Orders.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,22 @@ public function orders_custom_column_content( string $column_name, $order ): voi
5252
}
5353
}
5454

55-
public function query_args($args) {
55+
public function query_args( $args ) {
5656
$pos_order_filter = $_GET['pos_order'] ?? '';
5757

58-
if ($pos_order_filter) {
59-
if ( ! isset($args['field_query'])) {
58+
if ( $pos_order_filter ) {
59+
if ( ! isset( $args['field_query'] ) ) {
6060
$args['field_query'] = array();
6161
}
6262

63-
if ('yes' === $pos_order_filter) {
63+
if ( 'yes' === $pos_order_filter ) {
6464
$args['field_query'][] = array(
6565
'field' => 'created_via',
6666
'value' => 'woocommerce-pos',
6767
);
6868
}
6969

70-
if ('no' === $pos_order_filter) {
70+
if ( 'no' === $pos_order_filter ) {
7171
$args['field_query'][] = array(
7272
'field' => 'created_via',
7373
'value' => 'woocommerce-pos',

includes/Admin/Orders/Single_Order.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
class Single_Order {
88
public function __construct() {
99
add_filter( 'wc_order_is_editable', array( $this, 'wc_order_is_editable' ), 10, 2 );
10-
add_action('woocommerce_admin_order_data_after_order_details', array( $this, 'add_cashier_select' ) );
11-
add_action('woocommerce_process_shop_order_meta', array( $this, 'save_cashier_select' ) );
10+
add_action( 'woocommerce_admin_order_data_after_order_details', array( $this, 'add_cashier_select' ) );
11+
add_action( 'woocommerce_process_shop_order_meta', array( $this, 'save_cashier_select' ) );
1212
}
1313

1414
/**
@@ -32,22 +32,22 @@ public function wc_order_is_editable( bool $is_editable, WC_Order $order ): bool
3232
*/
3333
public function add_cashier_select( WC_Order $order ): void {
3434
// only show if order created by POS
35-
if ( 'woocommerce-pos' !== $order->get_created_via()) {
35+
if ( 'woocommerce-pos' !== $order->get_created_via() ) {
3636
return;
3737
}
38-
39-
$cashier_id = $order->get_meta('_pos_user');
38+
39+
$cashier_id = $order->get_meta( '_pos_user' );
4040

4141
// Create nonce for security
42-
wp_nonce_field('pos_cashier_select_action', 'pos_cashier_select_nonce');
42+
wp_nonce_field( 'pos_cashier_select_action', 'pos_cashier_select_nonce' );
4343

4444
echo '<p class="form-field form-field-wide">';
4545
echo '<label for="_pos_user">' . esc_html__( 'POS Cashier', 'woocommerce-pos' ) . ':</label>';
46-
echo '<select class="wc-customer-search" id="_pos_user" name="_pos_user" data-placeholder="' . esc_attr__('Search for a cashier&hellip;', 'woocommerce-pos') . '" data-allow_clear="true" style="width: 100%;">';
47-
if ($cashier_id) {
48-
$user = get_user_by('id', $cashier_id);
49-
if ($user) {
50-
echo '<option value="' . esc_attr($user->ID) . '"' . selected(true, true, false) . '>' . esc_html($user->display_name . ' (#' . $user->ID . ' &ndash; ' . $user->user_email) . ')</option>';
46+
echo '<select class="wc-customer-search" id="_pos_user" name="_pos_user" data-placeholder="' . esc_attr__( 'Search for a cashier&hellip;', 'woocommerce-pos' ) . '" data-allow_clear="true" style="width: 100%;">';
47+
if ( $cashier_id ) {
48+
$user = get_user_by( 'id', $cashier_id );
49+
if ( $user ) {
50+
echo '<option value="' . esc_attr( $user->ID ) . '"' . selected( true, true, false ) . '>' . esc_html( $user->display_name . ' (#' . $user->ID . ' &ndash; ' . $user->user_email ) . ')</option>';
5151
}
5252
}
5353
echo '</select>';
@@ -61,19 +61,19 @@ public function add_cashier_select( WC_Order $order ): void {
6161
*/
6262
public function save_cashier_select( $post_id ): void {
6363
// Security checks
64-
if ( ! isset($_POST['pos_cashier_select_nonce']) || ! wp_verify_nonce($_POST['pos_cashier_select_nonce'], 'pos_cashier_select_action')) {
64+
if ( ! isset( $_POST['pos_cashier_select_nonce'] ) || ! wp_verify_nonce( $_POST['pos_cashier_select_nonce'], 'pos_cashier_select_action' ) ) {
6565
return;
6666
}
6767

6868
/**
6969
* NOTE: HPOS adds a second arg for WC_Order, but we will make it backwards compatible.
7070
*/
71-
$order = wc_get_order($post_id);
71+
$order = wc_get_order( $post_id );
7272

7373
// Check if $order is instance of WC_Order and $_POST['_pos_user'] is set
74-
if ( $order instanceof WC_Order && isset($_POST['_pos_user']) ) {
75-
$new_pos_cashier = (int) sanitize_text_field($_POST['_pos_user']);
76-
$current_pos_cashier = (int) $order->get_meta('_pos_user');
74+
if ( $order instanceof WC_Order && isset( $_POST['_pos_user'] ) ) {
75+
$new_pos_cashier = (int) sanitize_text_field( $_POST['_pos_user'] );
76+
$current_pos_cashier = (int) $order->get_meta( '_pos_user' );
7777

7878
// Update meta only if _pos_user has changed
7979
if ( $current_pos_cashier !== $new_pos_cashier ) {
@@ -85,9 +85,9 @@ public function save_cashier_select( $post_id ): void {
8585
$new_cashier = get_userdata( $new_pos_cashier );
8686
$note = sprintf(
8787
// translators: 1: old POS cashier, 2: new POS cashier
88-
__('POS cashier changed from %1$s to %2$s.', 'woocommerce-pos'),
89-
$current_cashier ? $current_cashier->display_name : __('Unknown', 'woocommerce-pos'),
90-
$new_cashier ? $new_cashier->display_name : __('Unknown', 'woocommerce-pos')
88+
__( 'POS cashier changed from %1$s to %2$s.', 'woocommerce-pos' ),
89+
$current_cashier ? $current_cashier->display_name : __( 'Unknown', 'woocommerce-pos' ),
90+
$new_cashier ? $new_cashier->display_name : __( 'Unknown', 'woocommerce-pos' )
9191
);
9292
$order->add_order_note( $note );
9393
}

includes/Templates/Frontend.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function head(): void {
8686
public function footer(): void {
8787
$development = isset( $_ENV['DEVELOPMENT'] ) && $_ENV['DEVELOPMENT'];
8888
$user = wp_get_current_user();
89-
$github_url = 'https://cdn.jsdelivr.net/gh/wcpos/web-bundle@1.4/';
89+
$github_url = 'https://cdn.jsdelivr.net/gh/wcpos/web-bundle@latest/';
9090
$auth_service = Auth::instance();
9191
$stores = array_map(
9292
function ( $store ) {
@@ -181,7 +181,7 @@ function getScript(source, callback) {
181181
.then((response) => response.json())
182182
.then((data) => {
183183
var bundle = data.fileMetadata.web.bundle;
184-
var bundleUrl = '{$github_url}' + '/' + bundle;
184+
var bundleUrl = '{$github_url}' + bundle;
185185
getScript(bundleUrl, () => { console.log('done') });
186186
});
187187
</script>" . "\n";

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@wcpos/woocommerce-pos",
3-
"version": "1.4.6",
3+
"version": "1.4.7",
44
"description": "A simple front-end for taking WooCommerce orders at the Point of Sale.",
55
"main": "index.js",
66
"workspaces": {

readme.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: kilbot
33
Tags: cart, e-commerce, ecommerce, inventory, point-of-sale, pos, sales, sell, shop, shopify, store, vend, woocommerce, wordpress-ecommerce
44
Requires at least: 5.6 & WooCommerce 5.3
55
Tested up to: 6.4
6-
Stable tag: 1.4.6
6+
Stable tag: 1.4.7
77
License: GPL-3.0
88
License URI: http://www.gnu.org/licenses/gpl-3.0.html
99

@@ -63,6 +63,11 @@ There is more information on our website at [https://wcpos.com](https://wcpos.co
6363

6464
== Changelog ==
6565

66+
= 1.4.7 - 2024/01/18 =
67+
* Bump: web application to version 1.4.1
68+
* Fix: scroll-to-top issue when scrolling data tables
69+
* Fix: variations not loading after first 10
70+
6671
= 1.4.6 - 2024/01/16 =
6772
* Fix: decimal quantity for orders
6873
* Fix: load translation files

woocommerce-pos.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: WooCommerce POS
44
* Plugin URI: https://wordpress.org/plugins/woocommerce-pos/
55
* Description: A simple front-end for taking WooCommerce orders at the Point of Sale. Requires <a href="http://wordpress.org/plugins/woocommerce/">WooCommerce</a>.
6-
* Version: 1.4.6
6+
* Version: 1.4.7
77
* Author: kilbot
88
* Author URI: http://wcpos.com
99
* Text Domain: woocommerce-pos
@@ -22,7 +22,7 @@
2222
namespace WCPOS\WooCommercePOS;
2323

2424
// Define plugin constants.
25-
const VERSION = '1.4.6';
25+
const VERSION = '1.4.7';
2626
const PLUGIN_NAME = 'woocommerce-pos';
2727
const SHORT_NAME = 'wcpos';
2828
\define( __NAMESPACE__ . '\PLUGIN_FILE', plugin_basename( __FILE__ ) ); // 'woocommerce-pos/woocommerce-pos.php'

0 commit comments

Comments
 (0)