late to the party, multiple solutions have been found already, but im tossing another hat into the ring here because why not. We love options.
you could write Object.values($gameParty._items) into a variable before the shopping trip, and then compare Object.values($gameParty._items) afterwards to that variable you wrote to earlier. itll keep track of all the items you have and their counts, but it wont be able to differentiate whether or not the player bought/sold nothing, or if the player bought and then sold the same item though
you could write Object.values($gameParty._items) into a variable before the shopping trip, and then compare Object.values($gameParty._items) afterwards to that variable you wrote to earlier. itll keep track of all the items you have and their counts, but it wont be able to differentiate whether or not the player bought/sold nothing, or if the player bought and then sold the same item though