Shops in civilized countries factor sales tax into the advertised price instead of springing it on the customer at the last second.
Uh, dunno if you're implying US isn't "civilized" but the reason it's done at the end is because US sales tax varies by state and varies on what items are applicable or not. It's not realistically possible for the vendors who have stores across MULTIPLE states to coordinate and advertise with sales tax.