Disable Add to Cart button based on metafield value.

Hello,

I have a boolean variant metafield which when set to “True” on a variant, and this variant is selected, changes the price element to a placeholder text showing “POA”. I would also like the “Add to Cart” button to be disabled when this happens too, but that part I am struggling with. I have managed to achieve this when the page loads to the variant with the metafield set to true, but not when its selected after the page load and I guess that is where Javascript comes in. I am fairly comfortable with liquid/html coding but not Javascript. I have amended some to get the price to change. It’s a 2.0 theme from the Shopify store called “Stockmart”. Can anyone assist with this for me?

Below shows variant with metafield set to “false” or left blank:

Below shows variant with metafield set to true:

In both examples, the “Add to Cart” button is still active.

Thank you.