Clean the cart when going directly to the <checkout>, perfect when only the purchase of a single product is required by the user.
In functions.php
add_action( 'init', 'woocommerce_clear_cart_url' );
function woocommerce_clear_cart_url() {
if ( isset( $_GET['clear-cart'] ) && isset( $_GET['product'] ) ) {
global $woocommerce;