I have successfully added a contact form to a product if it is Out of Stock using
add_action(\'woocommerce_single_product_summary\', \'add_c\', 10, 3 ); function