Repository Forums Support WooCommerce Extended Coupon Features PRO WooCommerce Subscriptions not auto-applying recurring % discount

Topic Resolution: Resolved
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #3367
    jerry
    Participant

    Hello,
    I’m using the pro version of your plugin with Woo Subscriptions. My goal is to give subscribers a discount upon signup and then a separate discount each month based on user role (manually set).

    It seems that the Recurring Product % Discount is not being applied when subscription auto-renews in recurring orders (purchase 2, 3, … etc.). I have a Customer Restriction set in your plugin as “Allowed User Roles” with the scenario “if a user is a Tier 1 user, they should get a certain % discount each month their subscription renews.”

    Any insight on this? Thank you!

    #3377
    Soft79
    Keymaster

    I’m not sure. I don’t have the subscriptions plugin. Can you please temporarily enable debug mode (Settings > WooCommerce Extended Coupon Features > Debug Mode) and send me the coupon data as json (See miscellaneous tab while debug mode is enabled)?

    #3390
    jerry
    Participant

    Hello and thanks for the reply.
    Again, my scenario is that I have a “Percentage Discount” automatic coupon that gives customers 10% off any purchase of an “Autoship” category product (which is a subscription product). This is working well. When a customer purchases the subscription, their user role automatically changes to a “Tier 1” user.

    I then have another “Recurring Product % Discount” automatic coupon that is supposed to apply to all orders of an “Autoship” category product with another restriction of “Allowed User Roles” = Tier 1 user. My problem is the system doesn’t automatically apply the coupon to the first auto-shipment for the Tier 1 customer. That is, it doesn’t apply the coupon to the subscription. Not sure if there’s an error or my setup is incorrect.

    I’m using your priority feature since these are both “Individual Use Only” coupons, the first has priority 1 and the second has priority 4.

    Here’s the debug data: Thank you!

    {“result”:”ok”,”coupons”:{“coupon_id”:1084,”coupon_code”:”dsc-autoship-tier1″,”meta”:{“_edit_last”:””,”_edit_lock”:””,”_used_by”:””,”_wjecf_allow_cart_excluded”:”no”,”_wjecf_allow_enqueue”:”yes”,”_wjecf_apply_discount_to”:”all”,”_wjecf_apply_silently”:”no”,”_wjecf_bogo_matching_products”:”no”,”_wjecf_categories_and”:”no”,”_wjecf_coupon_priority”:”4″,”_wjecf_custom_fields_and”:”no”,”_wjecf_customer_roles”:[“autoship_member_tier_1″],”_wjecf_first_purchase_only”:”no”,”_wjecf_is_auto_coupon”:”yes”,”_wjecf_multiply_free_products”:”no”,”_wjecf_must_select_free_product”:”no”,”_wjecf_products_and”:”no”,”_wjecf_select_free_product_message”:”Please choose your free gift:”,”coupon_amount”:””,”css_selector_at_pages_selected”:””,”customer_email”:””,”date_expires”:null,”discount_type”:”recurring_percent”,”exclude_product_categories”:””,”exclude_product_ids”:””,”exclude_sale_items”:false,”expiry_date”:””,”free_shipping”:false,”individual_use”:true,”limit_usage_to_x_items”:null,”maximum_amount”:””,”minimum_amount”:””,”overlay_automatictrigger_disablemobile”:”0″,”post_do_customizeclosebtn”:”0″,”post_do_hideclosebtn”:”0″,”post_do_preventscroll”:”0″,”post_enableurltrigger”:”0″,”product_categories”:[131],”product_ids”:[],”usage_count”:2,”usage_limit”:0,”usage_limit_per_user”:0}}}

    #3391
    Soft79
    Keymaster

    I think it’s because the Subscriptions-plugin defines it’s own discount type (recurring_percent) which our plugin doesn’t know.

    Try this snippet in your functions.php:

    add_filter( 'wjecf_coupon_has_a_value', function() { return true; } );

    #3393
    jerry
    Participant

    Ok, I’ll try that code and thank you.
    Also, when I go to manually add a coupon to a subscription I get a dialog box error that says “Sorry, it seems the coupon “dsc-autoship-tier1″ is not yours.” when it is definitely a coupon under “Mine” at the top of the coupons page.

    Any chance that’s related to your plugin or is that Woo?

    Thanks again,

    #3394
    Soft79
    Keymaster

    Do you have the role ‘autoship_member_tier_1’ ?

    #3395
    jerry
    Participant

    I’m an Administrator, do I need to add that role ‘autoship_member_tier_1’?

    #3396
    jerry
    Participant

    I tried adding that additional role to myself and it did work. Seems unnecessary but it worked.

    #3397
    Soft79
    Keymaster

    The coupon is limited to that role, so it makes sense that it’s required.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.