PluginProbe
Tiered Pricing Table for WooCommerce / 8.0.2
Tiered Pricing Table for WooCommerce v8.0.2
8.0.2 7.1.7 7.1.5 7.1.4 7.1.1 6.5.0 6.4.0 6.1.0 trunk 1.0 1.1 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0 2.3.1 2.3.2 2.3.3 All 91 releases
← All changes | src/Addons/AdvancedQuantityOptions/QuantityManager.php +5 -1 6.5.0 → 8.0.2 View file →
@@ -76,9 +76,13 @@
76 76 $groupOf = $pricingRule->data['group_of_quantity'] ?? null;
77 77
78 78 if ( $max ) {
79 79
80 - if ( ! is_cart() && ! is_checkout() ) {
80 + // Subtract what is already in the cart ONLY for the classic product-page input, where
81 + // the field means "how many more can be added". The Store API reads this filter's
82 + // max_value as the ABSOLUTE cart maximum (QuantityLimits::get_add_to_cart_limits), so
83 + // subtracting there double-counts the cart and caps customers at half the real limit.
84 + if ( ! is_cart() && ! is_checkout() && ! WC()->is_rest_api_request() ) {
81 85 $max = max( 1, $max - $this->getProductCartQuantity( $product->get_id() ) );
82 86 }
83 87
84 88 $max = max( $groupOf, $max );