How to enable metafields only for specific products

Don’t know if you are still looking for an answer. But here is what I’ve done. when I ran into a similar situation

GitHub