From 1135e859fe39649af0e3be4485fae1f5038e1ca8 Mon Sep 17 00:00:00 2001 From: Paul Kilmurray Date: Mon, 15 Jan 2024 12:32:32 +0100 Subject: [PATCH] fix woocommerce_order_needs_payment non-boolean --- includes/Orders.php | 4 +++- package.json | 2 +- readme.txt | 5 ++++- woocommerce-pos.php | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/includes/Orders.php b/includes/Orders.php index e00f93a..d0679cd 100644 --- a/includes/Orders.php +++ b/includes/Orders.php @@ -63,13 +63,15 @@ public function wc_order_statuses( array $order_statuses ): array { /** * WooCommerce order-pay form won't allow processing of orders with total = 0. * + * NOTE: $needs_payment is meant to be a boolean, but I have seen it as null. + * * @param bool $needs_payment * @param WC_Order $order * @param array $valid_order_statuses * * @return bool */ - public function order_needs_payment( bool $needs_payment, WC_Order $order, array $valid_order_statuses ): bool { + public function order_needs_payment( $needs_payment, WC_Order $order, array $valid_order_statuses ) { // If the order total is zero and status is a POS status, then allow payment to be taken, ie: Gift Card if ( 0 == $order->get_total() && \in_array( $order->get_status(), array( 'pos-open', 'pos-partial' ), true ) ) { return true; diff --git a/package.json b/package.json index e6f4c89..98d44cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@wcpos/woocommerce-pos", - "version": "1.4.4", + "version": "1.4.6", "description": "A simple front-end for taking WooCommerce orders at the Point of Sale.", "main": "index.js", "workspaces": { diff --git a/readme.txt b/readme.txt index adf22ed..185562e 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: kilbot Tags: cart, e-commerce, ecommerce, inventory, point-of-sale, pos, sales, sell, shop, shopify, store, vend, woocommerce, wordpress-ecommerce Requires at least: 5.6 & WooCommerce 5.3 Tested up to: 6.4 -Stable tag: 1.4.5 +Stable tag: 1.4.5.1 License: GPL-3.0 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -63,6 +63,9 @@ There is more information on our website at [https://wcpos.com](https://wcpos.co == Changelog == += 1.4.6 - 2024/01/XX = +* Fix: load translation files + = 1.4.5 - 2024/01/14 = * Add: show change in checkout modal and receipt for the Cash gateway * Add: use 'medium' sized product image instead of 'thumbnail' diff --git a/woocommerce-pos.php b/woocommerce-pos.php index 631723a..771d34f 100644 --- a/woocommerce-pos.php +++ b/woocommerce-pos.php @@ -3,7 +3,7 @@ * Plugin Name: WooCommerce POS * Plugin URI: https://wordpress.org/plugins/woocommerce-pos/ * Description: A simple front-end for taking WooCommerce orders at the Point of Sale. Requires WooCommerce. - * Version: 1.4.5 + * Version: 1.4.5.1 * Author: kilbot * Author URI: http://wcpos.com * Text Domain: woocommerce-pos @@ -22,7 +22,7 @@ namespace WCPOS\WooCommercePOS; // Define plugin constants. -const VERSION = '1.4.5'; +const VERSION = '1.4.5.1'; const PLUGIN_NAME = 'woocommerce-pos'; const SHORT_NAME = 'wcpos'; \define( __NAMESPACE__ . '\PLUGIN_FILE', plugin_basename( __FILE__ ) ); // 'woocommerce-pos/woocommerce-pos.php'