Hi,
Please add this code to your site for the purpose-
add_filter( 'wcfm_product_fields_stock', function( $stock_fields, $product_id, $product_type ) {
if( !$product_id ) {
if( isset( $stock_fields['manage_stock'] ) ) {
$stock_fields['manage_stock']['dfvalue'] = 'enable';
}
if( isset( $stock_fields['stock_qty'] ) ) {
$stock_fields['stock_qty']['value'] = rand(10,100);
}
}
return $stock_fields;
}, 50, 3 );
Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/
Thank You