function custom_checkout_button_action(){
global $woocommerce;
$items = $woocommerce->cart->get_cart();
$total = 0;
foreach($items as $item => $values) {
$total = $values['quantity'];
}
if($total>=2){
?>
<a href="//your check out URL" onclick="return false"><?php _e( 'Check On Out', 'woocommerce' ); ?></a>
<?php
}
else{
?>
<a href="//your check out URL"><?php _e( 'Check On Out', 'woocommerce' ); ?></a>
<?php
}
}
add_action('woocommerce_proceed_to_checkout', 'custom_checkout_button_action');
, HTML, , .