Shop kepper diolog

Hey i'm looking for the easyest way to have shop keepers just say 'thanks' if you buy something but say 'bye' if you don't.
I feel like i'm over complicating it in my head.

Any ideas?
Store the amount of gold the party has when you first talk to the shop keeper and then check it to see if it's the same value when they leave. If the player buys or sells anything, the shop keeper can say thanks. Only in rare occasions will this total be the same when the player buys and sells stuff but I highly doubt anyone would ever notice.
@Frogboy its round about but simpler then my current thought process, I have split the transactions into buying and selling being separate so will work pretty conclusively. Still feel like a simple trigger is out there but thanks again, I will be using this meathod for now!

Original thread: https://forums.rpgmakerweb.com/threads/shop-kepper-diolog.87328/