From 0f5157ea957993095b508dd12a680380c4019b60 Mon Sep 17 00:00:00 2001 From: Paul Kilmurray Date: Wed, 4 Sep 2024 22:10:23 +0100 Subject: [PATCH] Fix: POS Only Products appearing in the web store --- includes/Products.php | 4 ++-- package.json | 2 +- readme.txt | 5 ++++- woocommerce-pos.php | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/includes/Products.php b/includes/Products.php index b96f719..d2546db 100644 --- a/includes/Products.php +++ b/includes/Products.php @@ -77,8 +77,8 @@ public function product_set_stock( WC_Product $product ): void { * @return string */ public function hide_pos_only_products( $query ) { - // Ensure this only runs for the main WooCommerce queries on product-related pages - if ( ! is_admin() && $query->is_main_query() && ( is_shop() || is_product() || is_post_type_archive( 'product' ) || is_product_taxonomy() ) ) { + // Ensure this only runs for the main WooCommerce queries on product-related queries + if ( ! is_admin() && 'product' === $query->get( 'post_type' ) ) { $settings_instance = Settings::instance(); $settings = $settings_instance->get_pos_only_product_visibility_settings(); diff --git a/package.json b/package.json index 3bfea87..d85f34d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@wcpos/woocommerce-pos", - "version": "1.6.4", + "version": "1.6.5", "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 43f3448..21b2679 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: kilbot Tags: ecommerce, point-of-sale, pos, inventory, woocommerce Requires at least: 5.6 Tested up to: 6.5 -Stable tag: 1.6.4 +Stable tag: 1.6.5 License: GPL-3.0 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -80,6 +80,9 @@ There is more information on our website at [https://wcpos.com](https://wcpos.co == Changelog == += 1.6.5 - 2024/09/04 = +* Fix: POS Only Products appearing in the web store + = 1.6.4 - 2024/09/04 = * Fix: POS Only Products appearing in the web store * Fix: Disable wp_footer for POS Order Pay template diff --git a/woocommerce-pos.php b/woocommerce-pos.php index 64b4fd3..d0cb9ac 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.6.4 + * Version: 1.6.5 * Author: kilbot * Author URI: http://wcpos.com * Text Domain: woocommerce-pos @@ -24,7 +24,7 @@ namespace WCPOS\WooCommercePOS; // Define plugin constants. -const VERSION = '1.6.4'; +const VERSION = '1.6.5'; const PLUGIN_NAME = 'woocommerce-pos'; const SHORT_NAME = 'wcpos'; \define( __NAMESPACE__ . '\PLUGIN_FILE', plugin_basename( __FILE__ ) ); // 'woocommerce-pos/woocommerce-pos.php'