Celebrating 20K+ active installs! Enjoy upto35% off on our addons!

CLAIM OFFER
01Day 16Hour 11Min 03Sec

Error when adding new (non-downloadable) product. "File: This field is required.

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM – Marketplace (WooCommerce Multivendor Marketplace) Error when adding new (non-downloadable) product. "File: This field is required.

This topic contains 3 replies, has 3 voices, and was last updated by Avatar Sushobhan 2 months, 2 weeks ago.

  • Author
    Posts
  • #101416
    Avatar
    bolon_campana
    Participant

    When we try to add a product, we are getting these errors (equivalent to this and this).

    File: This field is required
    Name: This field is required

    This error happens since we unsetted the capability to create downloadable products. We tried these two methods:

    1) Directly unsetting the capability:

    //Disabling virtual and downloadable from the product settings
    add_filter( 'wcfm_product_manage_fields_general', function($general_fields){
    	unset( $general_fields['is_virtual'] );
    	unset( $general_fields['is_downloadable'] );
    	return $general_fields;
    } ,501);

    2) Changing capability option rules array so wcfmcap_is_allow_fields_general() unsets the field by itself:

    //Disabling virtual and downloadable from the product settings
    add_filter( 'wcfm_capability_options_rules', function($wcfm_capability_options ){
    	$wcfm_capability_options['downloadable'] = 'yes';
    	return $wcfm_capability_options;
    } ,11);

    I tend to think this may be in fact a bug on your plugin, but I can’t be sure before asking.

  • #101485
    Avatar
    bolon_campana
    Participant

    Right now the only solution I could find was hiding those options through CSS, but still that allows that someone tech savvy enough can upload files to the server without our consent with no too much difficulty.

  • #102324
    Avatar
    vanilladev89
    Participant

    Hello

    Would putting a low or no data limit fix help?

    cheers

  • #102848
    Avatar
    Sushobhan
    Keymaster

    Hello,
    Thank you for contacting and sorry for any inconvenience that might have been caused. If I have understood correctly, you want to remove capability to add virtual or downloadable products. There is a settings to do so without any code customization. From your admin account go to WCFM Frontend dashboad >> Capability, under “Types” disable both Virtual and Downloadable option.
    Let me know how this goes.

You must be logged in to reply to this topic.