Forum Replies Created
- AuthorPosts
- Jose GomezParticipant
I received support via email and this code resolved it by adding it via snippet plugin:
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’] = 1;
}
if( isset( $stock_fields[‘sold_individually’] ) ) {
$stock_fields[‘sold_individually’][‘dfvalue’] = ‘enable’;
}
}
$stock_fields = wcfm_hide_field( ‘manage_stock’, $stock_fields );
$stock_fields = wcfm_hide_field( ‘stock_status’, $stock_fields );
$stock_fields = wcfm_hide_field( ‘stock_qty’, $stock_fields );
$stock_fields = wcfm_hide_field( ‘backorders’, $stock_fields );
$stock_fields = wcfm_hide_field( ‘sold_individually’, $stock_fields );
return $stock_fields;
}, 50, 3 ); - AuthorPosts