Actually, if your answer to your scary occurrence is sitting on your dogs leash, you learned NOTHING. Your pet needs to be belted in safely and securely. If you have seat belts, you can find a great answer to this problem from Amazon:
Vastar 2 Packs Adjustable Pet Dog Cat Car Seat Belt Safety Leads Vehicle Seatbelt Harness, Made from Nylon Fabric
Amazon.com : Vastar 2 Packs Adjustable Pet Dog Cat Car Seat Belt Safety Leads Vehicle Seatbelt Harness, Made from Nylon Fabric : Pet Supplies
If you don't have seat belts in your cart, you need to install a short leash of some kind that is bolted to the cart.
Just saying....