• Hey Scott,
    Thx for this good work.
    I wonder how we can exclude product subscriptions from subscriber discounts. I reviewed the code of your plugin but didn’t find an approach to create a filter.
    Any hints?
    Thx in advance,
    Joe

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Scott DeLuzio

    (@scottdeluzio)

    Hi Joe,
    As far as I know WooCommerce coupons doesn’t allow for a wholesale exclusion of subscription products. It is possible to exclude specific products, which could be a list of all of your subscription products.
    To do this, you’re right, I’d need to add a filter or some additional settings to the plugin.
    I’m going to push out an update with a new filter that will let you modify the existing parameters that are passed to the function that creates the discount code. Then, I think you should be able to just add a exclude_product_ids array in your own function. Something like this:

    add_filter( 'sdwoo_discount_args', 'your_function' );
    function your_function( $discount_args ){
        $discount_args['exclude_product_ids'] = array( 1, 2, 3, 4, 5 );
        return $discount_args;
    }

    Replace the 1, 2, 3, 4, 5 with a comma separated list of your subscription product IDs and that should do what you’re looking for.
    Version 1.3 should be out shortly. Let me know if you need anything else.

    Thread Starter ginjoewp

    (@ginjoewp)

    Hey Scott,

    Thank you very much for your fast reply.
    The filter works in calculating the correct price. But the error message doesn’t appear. So the customer sees the discount of e.g. 5€, and the real price without discount at the bottom of the checkout.

    Your snippet looks as if it has to work, but maybe sth went wrong with product variations combined with the subscriptions. We already have had issues with WooCommerce subscriptions, so I should come back to you when that task is resolved.

    Thanks,
    Joe

    Plugin Author Scott DeLuzio

    (@scottdeluzio)

    Can you check the coupon that was created to see if the products were excluded correctly?
    See the Exclude Products section here.
    If the correct product(s) are in the coupon settings, then there might be a conflict with another plugin. You can try manually creating a coupon with the same settings as the one this plugin created to see if there is any difference in the behavior at checkout.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to exclude subscriptions’ is closed to new replies.