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,12 +2298,14 @@ if ( ! function_exists( 'woocommerce_checkout_coupon_form' ) ) {
* Output the Coupon form for the checkout. * Output the Coupon form for the checkout.
*/ */
function woocommerce_checkout_coupon_form() { function woocommerce_checkout_coupon_form() {
wc_get_template( if ( is_user_logged_in() || WC()->checkout()->is_registration_enabled() || ! WC()->checkout()->is_registration_required() ) {
'checkout/form-coupon.php', wc_get_template(
array( 'checkout/form-coupon.php',
'checkout' => WC()->checkout(), array(
) 'checkout' => WC()->checkout(),
); )
);
}
} }
} }