From c7fccfd26447f2adaf0f90c9af332a8153ffa0d1 Mon Sep 17 00:00:00 2001 From: issanyo Date: Thu, 12 Jan 2023 22:08:46 +0100 Subject: [PATCH 1/2] Fix typo stock quantity check There is a typo in `COALESCE (` which is causing an error when this function is called. The error is present on the checkout page when clicking on payment. --- .../includes/data-stores/class-wc-product-data-store-cpt.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php b/plugins/woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php index 6e780300bd4..a2bfd05d530 100644 --- a/plugins/woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php +++ b/plugins/woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php @@ -2120,7 +2120,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da global $wpdb; return $wpdb->prepare( " - SELECT COALESCE ( MAX( meta_value ), 0 ) FROM $wpdb->postmeta as meta_table + SELECT COALESCE( MAX( meta_value ), 0 ) FROM $wpdb->postmeta as meta_table WHERE meta_table.meta_key = '_stock' AND meta_table.post_id = %d ", From ac06a00f8a82eb3cfe1a0cb9b12263aa678fe158 Mon Sep 17 00:00:00 2001 From: Corey McKrill <916023+coreymckrill@users.noreply.github.com> Date: Wed, 30 Aug 2023 16:25:09 -0700 Subject: [PATCH 2/2] Add changelog file --- plugins/woocommerce/changelog/pr-36402 | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 plugins/woocommerce/changelog/pr-36402 diff --git a/plugins/woocommerce/changelog/pr-36402 b/plugins/woocommerce/changelog/pr-36402 new file mode 100644 index 00000000000..40606ee41ea --- /dev/null +++ b/plugins/woocommerce/changelog/pr-36402 @@ -0,0 +1,4 @@ +Significance: patch +Type: tweak + +Fix a minor code typo, no change in functionality \ No newline at end of file