1) Amazon, Newegg, etc come out and say "we love local businesses" - because honestly, who doesn't have their favorite local shops, knowledgable people who know you is great. They admit they have been hurting local businesses, and that they have an unfair advantage because of this show-rooming behaviour by consumers.
2) They roll out a "showroom affiliate" program. Businesses can sell the products, but they also can have a QR code or similar, with a "or get it on amazon!". This provides a commission to the store, recognizing that they played a part in the sale.
3) the show-rooming is not as harmful to the stores, the online retailer doesn't lose sales, and everyone can settle to a new balance.
This also gets the online retailers good press and warm glowies.