Can I take a shopping cart like say this one and safely attach it to a bike? I'd like to also take it into the store with me as well.
I think you would be much better off converting an old kids trailer.
They can be found pretty cheap on Craigslist.
There are trailers in a similar form factor, like the Burley Travoy (no recommendation, just the first I found), that are made for the purpose. These will be a lot more stable than any home made conversion of something that was never designed to go faster than slow walking pace.
For my daily commute and for moderate sized weekly grocery trips I use two waste baskets, permanently mounted, each with 6 gallon capacity. They serve as waterproof hard shells into which I can insert any bags, backpacks, clothes etc, that I want.
I go grocery shopping with my bike all the time, I put groceries in touring panniers mounted on a rear rack. They are a little cumbersome to load but I can fit a lot of stuff. You can't fit a week's worth of groceries for a family of 5, though, so it depends on your situation.
For a solution more elegant for shopping, you can buy square-shaped shopping panniers which will more easily allow you to carry canvas shopping bags full of groceries. These are very popular in Holland where bikes are a primary mode of transit. (http://dutchbikeshop.ie/wp-content/uploads/wp-checkout/images/fastrider-pannier-cargo-1423825156.jpg) One word of caution for most bikes in the US-- you'll have to watch out for heel clearance with a square bag like this.
If you're serious about hauling a lot of stuff then you should get a cargo bike, like the Surly Big Dummy or something with a frame-mounted front rack (Workcycles).
There are several manufacturers who offer rod supported quick connect pannier bags which you can easily detach from your bikes rear rack, shop and load them, then rehook to the bike and ride home. They work great and are inexpensive. One such company is Performance Bicycle.
I agree with Blams comment, I don't think you would want to pull that cart behind a bike. Since you still want to take it into the store, maybe use that cart & mount it on a flatbed trailer with bungee cords. Something like this maybe: http://www.burley.com/page_453/flatbedsuptmsup
Many grocery stores do deliveries. There's also taxis. Living without a car and having to get groceries for my family has taught me that bicycles aren't always the best solution. About once a month plan a big trip and get a list of all the heavy, non-perishables items you will need. This will include canned goods, frozen meats and vegetables, dried goods like pasta or rice, and other non food items like laundry soap. The other stuff you need to bet fresh doesn't weigh that much. Exceptions are things like milk, but sometimes I make a special trip just for that. It's an excuse to ride my bike more, and I just go to the corner store because it's only a short trip, and it's the same price everywhere. Also, learn to shop light. Don't buy liquids like pop or juice. Water is healthier anyway and comes right out of a pipe fed into your house. If you want juice, try frozen concentrate. You'll spend money on deliveries, about $8 a shot here, but you won't have to buy a trailer, and surely your bike will appreciate not having to tow heavy loads.