From 69412773479770cdef02d7be320632f5fb253fdd Mon Sep 17 00:00:00 2001 From: Joe Dolson Date: Sun, 6 Oct 2024 15:19:05 -0500 Subject: [PATCH] Explanatory comment I always struggle with this in my head, so some docs won't hurt. --- src/mt-add-to-cart.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mt-add-to-cart.php b/src/mt-add-to-cart.php index 5a57bbd..d6f367d 100644 --- a/src/mt-add-to-cart.php +++ b/src/mt-add-to-cart.php @@ -782,6 +782,7 @@ function mt_hide_remaining( $tickets_remaining ) { // If hide remaining is enabled, set as hidden. $remaining_limit = isset( $options['mt_hide_remaining_limit'] ) ? absint( $options['mt_hide_remaining_limit'] ) : 0; $hide_remaining = ( isset( $options['mt_hide_remaining'] ) && 'true' === $options['mt_hide_remaining'] ) ? true : false; + // Hide this if 1) tickets remaining is hidden & limit is 0 or 2) tickets remaining is hidden and there are more tickets left than the limit. $hidden_class = ( ( $hide_remaining && ! $remaining_limit ) || ( $hide_remaining && $tickets_remaining > $remaining_limit ) ) ? ' hiding' : ''; return $hidden_class;