This mod decreases shop prices by 5% if a pet lives within 25 tiles of a NPCs house. Note that the price multiplier has a cap.
Both the shop price multiplier and the pet detection range are configurable.
This mod is open source on Github and licensed under GNU GPLv3. If you use any code from this mod you have to open source it under the same license and give credit in your mod's description.