In WooCommerce with Contact Form 7 plugin, I have added a form to my out of stock simple products, on single product pages, using the following code:
add_action( 'woocommerce_single_product_summary', 'add_contact_form', 30, 2 );
function add_contact_form() {
global $product;
if( ! $product->is_in_stock( ) && ! $product->is_type('variable') ) {
echo do_shortcode('[contact-form-7 id="14880" title="Fiyat Sorunuz"]');
}
}
This "out of stock" form works just well for simple products:
But doesn't work on "out of stock" product variations for variable products:
How can I display this form for selected product variation that are out of stock?
Any help is appreciated.

