Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • Leland Zaremba
    Participant
    add_filter( 'woocommerce_coupon_is_valid_for_product', 'wc_apfs_disable_coupons', 10, 4 );
    function wc_apfs_disable_coupons( $is_valid,  $product,  $instance,  $values ) {
    
      if ( in_array( $instance->get_code(), array( 'retail50', 'fourth', 'FOURTH','regimentier10', 'regimentier20', 'regimentier30' ) ) ) {
        if ( ! empty( $values[ 'wcsatt_data'][ 'active_subscription_scheme' ] ) ) {
          $is_valid = false;
        }
      }
    
      return $is_valid;
    }

    This code is designed to disable coupons for products that have subscription options. This needs to override any other coupon rule. These subscription products are created using the official “woocommerce all products for subscriptions” WC plugin.

    in reply to: Pricing tiers for % discount cart subtotal help #16445
    Leland Zaremba
    Participant

    This solved it.

    in reply to: Pricing tiers for % discount cart subtotal help #16341
    Leland Zaremba
    Participant

    Updated plugin to latest version. Removed % symbols. What I see now:

    Customer adds $65 to cart. Tier 2 20% discount applied
    Customer adds another $65 to cart. Tier 3 25% discount applied (previous discount removed)
    so far so good…
    Customer removes $65 from cart. Tier 3 removed. Tier 2 not applied. Cart forced update (change shipping selector, etc). Tier 2 discount applied.

    I’m seeing that only 1 action happens per cart update. Either it automatically adds the matching price range coupon or it removes a coupon but then requires another cart update to activate the coupon that matches the applicable price range.

    in reply to: Pricing tiers for % discount cart subtotal help #16338
    Leland Zaremba
    Participant

    Oh great! Will do that now.

    in reply to: Pricing tiers for % discount cart subtotal help #16336
    Leland Zaremba
    Participant

    No problem: https://hushandhush.com

    1. Go to shop and add any product. Then add another product. That will trigger the auto coupon discounts correctly.

    2. Remove a product from the cart. That will correctly remove disqualified coupon BUT it will not re-add the lower tier discount.

Viewing 5 posts - 1 through 5 (of 5 total)