If a coupon is being used, and the “place order” button is pressed, woocommerce will check the status of coupon first and returns any errors (e.g check if the coupon has any usage limit).

How can I make the following action be the FIRST script to run (before any other checks (such as the coupon check mentioned above) are done)?

woocommerce_registration_error_email_exists', __( 'An account is already registered with your email address. Please log in.', 'woocommerce' ), $email ) );

It's not clear what you're asking for here, but I read your question as 'How can I can I require registration/login before checkout?'

This is actually a simple setting in the WooCommerce administration area. Simply go to WooCommerce => Settings, select the 'Accounts & Privacy' tab and uncheck the 'Allow customer to place orders without an account'

This option requires that a user either has an account and is logged in or creates an account during the checkout.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.