Skip to content

Instantly share code, notes, and snippets.

@tharsheblows
Created January 13, 2021 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tharsheblows/a1b9a83a8646d41ee7f9866bee2ad4f9 to your computer and use it in GitHub Desktop.
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.
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