Skip to content

Instantly share code, notes, and snippets.

@Sirvijver
Created July 12, 2021 13:09
Show Gist options
  • Select an option

  • Save Sirvijver/51639c36e220e631c96464a0e2ecb380 to your computer and use it in GitHub Desktop.

Select an option

Save Sirvijver/51639c36e220e631c96464a0e2ecb380 to your computer and use it in GitHub Desktop.
Remove WooCommerce "Place Order" button
add_filter('woocommerce_order_button_html', 'remove_order_button_html' );
function remove_order_button_html( $button ) {
class
foreach( WC()->cart->get_cart() as $cart_item ) {
if( $cart_item['data']-> {
$found = true;
break; // We stop the loop
}
}
if( $found )
$button = '';
return $button;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment