By this stage of dementia, don’t allow the person to carry more than a modest amount of money in his or her wallet. Carrying some cash can enhance self-esteem for some people.
Remove credit cards (and other key documents) from wallet.
Don’t let the person shop unattended.
Step in casually: “It’s on me, Mom.” “Here, let me pay for it”.
Use humor to divert attention: “I know you like that toothpaste so much you’d pay a hundred dollars for it, Dad. But don’t you think a five is enough?” (and take the five).
Use flattery to deflect the awkwardness of the situation: “You’re so generous you’d give away all your money if you could, wouldn’t you? But maybe not today”.