Prevent displaying coupon form on checkout requiring login

This commit is contained in:
James Allan 2021-02-17 11:42:30 +10:00
parent 32b502dcd2
commit 264bccf505
1 changed files with 8 additions and 6 deletions

View File

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