302 redirects are the proper redirects for the shopping cart to use. 301 redirects mean that the useragent/client should forget about the original URL and only use the new URL in the future. This would not be desirable for the shopping cart, since it is the original URL that generally contains the information about the product that was added to the cart, etc.
The reason that Google doesn't like the 302 redirects is not because of the redirects themselves or legitimate uses of it like shopping carts, etc, it is because of domain spamming, basically since domains are cheap these days people will buy up domain names with their keywords in them and have them redirect via 302 to their website so that it will look like a whole bunch of different websites that have high keywork rankings for certain keywords. These sites don't use a 301 because that would tell Google to forget about the old domain name and only use the new one from now on.
So using a 301 redirect instead of a 302 redirect would be appropriate if you just wanted to make sure your site was always showing the URL of
www.domain.com instead of just domain.com (or vice versa), but it doesn't necessarily apply to a dynamic application where the original URL has specific information that dictates what the new URL/page looks like.