Manage Stock

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Viewing 1 reply thread
  • Author
    Posts
    • #53832
      Alexandru
      Guest

      Please help me to have default activated the Manage Stock option – in vendor view, when he want’s to create a product he can check this option – Manage Stock.

    • #53961
      WCFM Forum
      Member

      Hi,

      Please use this code snippet –

      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;
      		}
      	}
        return $stock_fields;
      }, 50, 3 );

      Thank You

Viewing 1 reply thread
  • The topic ‘Manage Stock’ is closed to new replies.