Why don't you try tying a bit of string/twine/whatever to the rack for whenever you need it. For the groceries, just loop the string through the bag loops and tie the string to the rack. At home, you just untie the string. I'd suggest not using a thin string or you'll end up having to cut the string.
If the bags hang too low, just tie the string to the opposite side of the rack so that the bag's loops lay across the rack. I suppose for added bit of security, you could clamp the loops on the rack too. Not sure if any of this would work though. I'm also thinking the bags might want to slip to the other side with the latter method in which case, you might want to tie the loops to both sides of the rack. Does any of this make sense? Mind you I've never tried this. =)