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 has 3 replies, 3 voices, and was last updated 4 years, 11 months ago by Sushobhan.
- AuthorPosts
- January 9, 2020 at 3:54 am #101416bolon_campanaParticipant
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 requiredThis 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.
- January 9, 2020 at 7:07 pm #101485bolon_campanaParticipant
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.
- January 16, 2020 at 8:43 pm #102324vanilladev89Participant
Hello
Would putting a low or no data limit fix help?
cheers
- January 20, 2020 at 4:17 pm #102848SushobhanKeymaster
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.
- AuthorPosts
- You must be logged in to reply to this topic.