I use a trailer that was for moving one or two small children. As such it came with a third front wheel, and the drawbar folds underneath.
Not mine, but similar design.
So you could ride to the shop, park and lock your bike in the stand, fit the trailer's front wheel to make it a triangle, and fold up the towbar if required. Now its a Pram/Pushchair/Stroller
Then do your shop, and after checkout put your stuff back in your stroller. When you get to your bike, store the front wheel and deploy the towbar. Hitch to your bike then ride off home.
The only gotcha for me is that stowing the drawbar requires tipping the trailer back a long way, so to deploy the towbar, the groceries have to be well-packed.
Also, the stroller is a little wider than a shopping cart/trolley. It can store about the same amount. Mine's got a slab of customwood as a floor. Its possible the market may object to a non-shop trolley, but that's a remote chance.