Merge pull request #29151 from woocommerce/hide_coupon_on_incomplete_checkout

Prevent displaying coupon form on checkout requiring login
This commit is contained in:
Claudio Sanches 2021-03-03 17:05:53 -03:00 committed by GitHub
commit d8735d7225
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 6 deletions

View File

@ -2298,6 +2298,7 @@ if ( ! function_exists( 'woocommerce_checkout_coupon_form' ) ) {
* Output the Coupon form for the checkout.
*/
function woocommerce_checkout_coupon_form() {
if ( is_user_logged_in() || WC()->checkout()->is_registration_enabled() || ! WC()->checkout()->is_registration_required() ) {
wc_get_template(
'checkout/form-coupon.php',
array(
@ -2305,6 +2306,7 @@ if ( ! function_exists( 'woocommerce_checkout_coupon_form' ) ) {
)
);
}
}
}
if ( ! function_exists( 'woocommerce_products_will_display' ) ) {