Bu işinizi görebilir.

class Allow_Only_1_Product_Cart_MYK {
    function __construct() {
        add_action( 'woocommerce_before_calculate_totals', array($this,'wcaopc_keep_only_last_cart_item'), 30, 1 );
    }
    function wcaopc_keep_only_last_cart_item( $cart ) {
        if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return;
        if ( did_action( 'woocommerce_before_calculate_totals' ) >= 2 ) return;
        $cart_items = $cart->get_cart();
        if( count($cart_items) > 1 ){
            $cart_item_keys = array_keys( $cart_items );
            $cart->remove_cart_item( reset($cart_item_keys) );
        }
    }
}
$plugin = new Allow_Only_1_Product_Cart_MYK();