Merge pull request #29151 from woocommerce/hide_coupon_on_incomplete_checkout
Prevent displaying coupon form on checkout requiring login
This commit is contained in:
commit
d8735d7225
|
@ -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(),
|
||||||
);
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue