Skip to content

Commit

Permalink
fix woocommerce_order_needs_payment non-boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
kilbot committed Jan 15, 2024
1 parent d328301 commit 1135e85
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion includes/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions woocommerce-pos.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href="http://wordpress.org/plugins/woocommerce/">WooCommerce</a>.
* Version: 1.4.5
* Version: 1.4.5.1
* Author: kilbot
* Author URI: http://wcpos.com
* Text Domain: woocommerce-pos
Expand All @@ -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'
Expand Down

0 comments on commit 1135e85

Please sign in to comment.