• Resolved leborgne23

    (@leborgne23)


    Hi,
    I’m running into an issue with the auto-coupon feature combined with email restriction : The auto-coupon remains active even if the email restriction is no longer met at checkout. On the contrary, when the registered customer’s email is not eligible for a coupon but he changes it at checkout then the coupon is triggered.
    Am I missing something because in the documentation it clearly says that the coupon is cancelled if conditions are non longer met (and that’s exactly what I want.)
    Thanks in advance guys

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Soft79

    (@josk79)

    Hi, can you send an url to your checkout page please, and send me a (dummy) email address that would trigger the coupon.

    Thread Starter leborgne23

    (@leborgne23)

    Hi and thanks for the quick reply !
    I created an admin user account for you :
    User : Soft79 / Password : Soft79 / email address : [email protected]
    I also created an auto coupon called “Soft79” triggered by this email address.
    The site being under construction, please go directly to this product, (you’ll have to login ) add it to the cart with the “ajouter” button and check the orders here.
    You should see what I saw.
    Thanks in advance.
    Fabrice

    Plugin Author Soft79

    (@josk79)

    Try this please:

    Q: Why is the cart not updated after changing the billing email address?
    A: By default WooCommerce doesn’t refresh the cart when changing the billing email address. If you have a coupon that is restricted by email address, you could paste this snippet in your theme’s functions.php:

    //Update the cart preview when the billing email is changed by the customer
    add_filter( 'woocommerce_checkout_fields', function( $checkout_fields ) {
    $checkout_fields['billing']['billing_email']['class'][] = 'update_totals_on_change';
    return $checkout_fields;
    } );

    Please note, that if the set email address of the logged in user (see https://config-portail.darbon.com/wp-admin/users.php) is valid, the coupon will also apply.

    Thread Starter leborgne23

    (@leborgne23)

    Thanks for this, it takes me closer to my goal.
    It makes me wonder what is the point of email restriction if the registered email address overrules the billing one ? It’s the same as restricting the coupon for a specific user as offered in the coupon settings. So I guess the only solution would be to put in dummy email addresses for all my customers so that the coupon is not triggered upfront but only when they type the correct email address at checkout.
    Is there any way to make the email restriction focus only on the billing email address entered, thus ignoring the registered one ?
    Thanks again for your knowledge.
    Fabrice

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘auto-coupon / email restriction’ is closed to new replies.