mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-05-01 11:52:25 +08:00
https://stackoverflow.com/questions/75637079/conditionally-hiding-the-place-order-button-in-woocommerce
7 lines
266 B
Text
7 lines
266 B
Text
add_filter( 'woocommerce_order_button_html', 'remove_place_order_button' );
|
|
function remove_place_order_button( $button_html ) {
|
|
if ( ! WC()->cart->needs_shipping() || ! WC()->cart->needs_payment() ) {
|
|
$button_html = '';
|
|
}
|
|
return $button_html;
|
|
}
|