Maria: Look at these adorable puppies my friend posted on facebook. They're looking for homes. Maybe we should adopt one?
Neil: We don't need a dog.
Maria: Why not? They're so adorable, and they need homes. And I have been thinking a pet could be fun.
Neil: I don't know.
Maria: Oh, have a heart. At least go look at them with me and think about it. They need homes, and we have one.
Neil: OK, we can go see the puppies tomorrow, but I'm not promising anything.
Meaning: The expression "have a heart" means to be compassionate, generous or forgiving. In the example above, Maria tells Neil to "have a heart" when he initially rejects her suggestion that they adopt a puppy. This imperative usage (telling someone to do something) is one of the most common ways to use this idiom. When a person rejects something that is compassionate, generous or forgiving, someone else might say "have a heart;" this suggests that the person should reconsider.
In addition to the imperative usage above, the idiom is also often used with the word "if," as in the following example:
Christine: I know you're still mad at Daniel for scratching your car, but he apologized and offered to pay for it.
Thomas: I know, but it was really irresponsible of him.
Christine: If you had a heart, you would just forgive Daniel and move on.
Meaning: In this case, saying "if you had a heart" is almost a challenge, telling someone that they need to be more compassionate, generous or forgiving (as in this specific example).