Repository Forums Support WooCommerce Extended Coupon Features PRO Role Based Auto Coupon when logging in on Cart page

Topic Resolution: Resolved
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1027
    blkpudd
    Participant

    Hi, trying to set this up so that if a user creates a shopping basket, and then logs in on the Checkout page with a specific user role, it then activates an auto coupon (coupon assigned only to this role). This doesn’t seem to work. However, after logging if I then browse and add another product, the auto coupon is then applied to the whole basket.

    Is there any fix for this, or do I have to live with it?

    Cheers

    #1035
    Soft79
    Keymaster

    Could you try that with a default theme (like Storefront 2) ?

    If that doesn’t work, disable plugins one by one and try again to see if one of them is causing a conflict.

    #1043
    blkpudd
    Participant

    Hi,

    Checked with Storefront and it WORKED!, apologies for not doing that first.

    My theme is using Ajax I think, so do you have any tips on how I could integrate this into my theme? Happy to pay for Pro version, or your time to help sort this.

    I can send you the URL via pm, if that’s ok.

    Cheers

    #1044
    blkpudd
    Participant

    Just a quick follow up. It’s my child theme that’s causing the issue, I will have a go at fixing it myself as it’s probably something in functions.php that I’ve put in.

    Will let you know what I find.

    Cheers

    #1045
    blkpudd
    Participant

    Fixed… kinda obvious: I had used the following to hide coupon details on the checkout page. Took this out and it worked fine.

    // hide coupon field on checkout page

    function hide_coupon_field_on_checkout( $enabled ) {
    if ( is_checkout() && current_user_can(‘wholesale’) ) {
    $enabled = false;
    }
    return $enabled;
    }
    add_filter( ‘woocommerce_coupons_enabled’, ‘hide_coupon_field_on_checkout’ );

    #1050
    Soft79
    Keymaster

    Glad that you found it! Thanks for sharing the solution; I have seen that snippet causing issues on more occasions.

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