Stagecoach North West have trialled manned on street ticket sales, and still use them successfully in the central Lake District. They're just a standard bus ticket machine, mounted on top of a purpose built trolley, containing a 24v battery, change bags, spare ticket rolls etc. Over the Summer months, one can be found at the bus stops at Windermere Railway Station. They've also been in use at Carlisle, and recently in Workington Bus Station to help speed up the boarding process when buses are late running.
Going to online sales, it wouldn't really be any different than buying a single or return ticket off the National Rail website..... It simply works off a database type system, as is used by on-vehicle ticket machines. Select the fare stage you'll be boarding, select the fare stage you'll be alighting the bus, and a price will be brought up from the table, and through means of a "Report" feature as in Microsoft Excel, a relevant ticket can be printed. The fare tables should already be on the operators computer system, to programme up the ticket machines, it would just be a case of linking that data to a web based ticket sales system.
Unmanned on-street sales are still possible, as seen in London, and on Manchester Metrolink tram system. Each machine will be set to a default alighting place, being where the machine is located. The passenger just has to select where they'll be getting off, the price will be shown on the screen, they insert money and their ticket will be printed.