Created
January 13, 2021 10:32
-
-
Save tharsheblows/a1b9a83a8646d41ee7f9866bee2ad4f9 to your computer and use it in GitHub Desktop.
This patch is for WooCommerce Subscriptions 3.0.11 and in the WCS_Limiter:: order_awaiting_payment_for_product method. The check to make sure the order includes the product is incorrect.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/includes/class-wcs-limiter.php b/includes/class-wcs-limiter.php | |
index d030723..4fa1e8d 100644 | |
--- a/includes/class-wcs-limiter.php | |
+++ b/includes/class-wcs-limiter.php | |
@@ -253,7 +253,7 @@ class WCS_Limiter { | |
foreach ( $order->get_items() as $item ) { | |
// If this order contains the product we're interested in, continue finding a related subscription. | |
- if ( $item['product_id'] == $product_id && $item['variation_id'] == $product_id ) { | |
+ if ( $item['product_id'] == $product_id || $item['variation_id'] == $product_id ) { | |
$subscriptions = wcs_get_subscriptions( | |
array( | |
'order_id' => $order->get_id(), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment