Repository Forums Support WooCommerce Extended Coupon Features PRO Woocommerce subscriptions don't auto apply coupon

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #758
    hegerp
    Participant

    Hello,

    I’m using WooCommerce Extended Coupon Features together with Subscriptions and other products.

    I’ve used the included code (commented out by default) to update the cart whenever the user changes the shipping method.

    I have a couple of auto coupons that I set up with only BACS payments. They all work as expected for normal products, but with subscription products, although they scroll up to the message “Coupon applied: name of my coupon”, they don’t add the coupont item with the negative number to the cart.

    Is there a way I can get around this?

    #763
    Soft79
    Keymaster

    Please send me a link and instrucions on how to reproduce the issue.

    #782
    hegerp
    Participant

    Here is my example site:
    http://arpad.kdspeed.co.uk/

    Here is what I did in steps (so you can reproduce the issue)

    • Installed woocommerce, WooCommerce Extended Coupon Features, and Subscriptions
    • Installed a free theme, but tried it with others as well, the issue remains the same (current theme is Storefront from WP registry)
    • Created a simple product (t-shirt), a Subscription product (subscription)
    • Created an auto coupon that gets applied when the Check paymants are selected
    • Setup subscriptions to manual mode
    • Added your snippet at the end of woocommerce-jos-autocoupon.php to update the checkout cart once there is a change in payment methods

    WHEN IT WORKS

    • with tshirt
    • When you add the subscription product to your basket and the system has saved that your default payment method is check payment
      • HOWEVER: If you go to the checkout and change payment method to something else and then back to check payments, it stops applying the coupon

    Thank you very much for the help. I’m trying to fix this for days now.

    #783
    Soft79
    Keymaster

    It looks like the subscription plugin does something to the cart cookie in a way that is not compatible with my plugin. Probably has something to do with the order in which actions/filters are handled.

    Would you mind hacking my plugin a bit? Find this line in wjecf-autocoupon.php (line 28):

    add_action( 'woocommerce_after_calculate_totals', array( &$this, 'update_matched_autocoupons' ) );

    replace with:

    add_action( 'woocommerce_after_calculate_totals', array( &$this, 'update_matched_autocoupons' ), 1 );

    or with:

    add_action( 'woocommerce_after_calculate_totals', array( &$this, 'update_matched_autocoupons' ), 999 );

    Let me know if it helps?

    If not, I will need to take a look and need ftp and admin access. You can send it to me through the contact page.

    PS: The snippet you uncommented should be placed in functions.php of your child theme to make it update safe.

    #785
    hegerp
    Participant

    Neither of the hacks worked. Thanks for the PS by the way. However this is just an example site I’ve set up for asking help ;P

    I’m sending you the details via the contact page.

    Again, thanks for the help.

    #804
    hegerp
    Participant

    Is there a chance you might have another look at it? I’ve emailed you FTP details now as well. Thanks a lot.

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