Why isn’t this variable raising when a function is executed?

So I’m making an idle game and I want when you buy a ‘carrot patch’ in this example, the price of said ‘carrot patch’ will raise by 50%. However this doesn’t happen.

Here’s my code:

var patchPrice = 10;

function buyPatch() {
   if (affordable = true) {
      var patchPrice = patchPrice * 1.5;
   }
}