I am trying to change the availability status of the configurable product depends on child products.
I found the following function