• hi thanks for creating this very useful plugin
    but i have some problems
    1. How to Eliminate Virtual Options on Variable Products?
    I used the code below, but it didn’t turn off the virtual option on the product variable

    function disable_virtual_downloadable_support( $general_fields ) {
        if ( isset( $general_fields['is_virtual'] ) )
            unset( $general_fields['is_virtual'] );
        if ( isset( $general_fields['is_downloadable'] ) )
            unset( $general_fields['is_downloadable'] );
        return $general_fields;
    }
    
    add_filter( 'wcfm_product_manage_fields_general', 'disable_virtual_downloadable_support' );
    add_filter('wcfmu_is_allow_downloadable','__return_false');

    2. How To Enable Set Stock By Default With Quantity 1, Hide Option Set Stock (Keep Showing Stock Amount), Turn Off And Hide BackOrder Option.
    Btw I use the following code, but it doesn’t work for variable product

    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;
    		}
    	}
    	$stock_fields = wcfm_hide_field( 'manage_stock', $stock_fields );
    	$stock_fields = wcfm_hide_field( 'backorders', $stock_fields );
    	$stock_fields = wcfm_hide_field( 'sold_individually', $stock_fields );
    	$stock_fields = wcfm_hide_field( 'stock_status', $stock_fields );
      return $stock_fields;
    }, 50, 3 );

    thank you again, your help means a lot to me

Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to Enable Manage Stock By Default And Some Other Problems’ is closed to new replies.