Add Product | Downloadable File

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 3 reply threads
  • Author
    Posts
    • #26922
      Jay
      Guest

      Hi,

      If you check ‘downloadable’ in ‘Add Product’, it requires ‘Downloadable File’ to publish the product.
      But I would like to leave it empty when publishing, as PDF Voucher does not require it and automatically make downloadable files.

      Could you provide code snippet to make ‘Downloadable File’ not mandatory?

      Thanks in advance,
      /Jay

    • #26979
      WCFM Forum
      Member

      Hi,

      We will remove this validation check in next update.

      Thank You

    • #28535
      Jay
      Guest

      Hello Team,

      I believe this fix was implemented in 4.2.2 version.

      But now in 4.2.3 it is made back to mandatory field as someone requested it:
      https://wclovers.com/forums/topic/add-product-downloadable/

      I understand in general case this is supposed to be required field.
      So would you be able to provide me code snippet to turn off required check for “Downloadable Name/File”?

      Thanks in advance,
      Jay

    • #28664
      WCFM Forum
      Member

      Hi,

      Yeah right, people want to make those required otherwise “Downloadable Products” useless.

      PDF Voucher is an exceptional case.

      Kindly add this code to your site –

      function wcfm_product_fields_custom_downloadable( $downloadable_fields, $product_id, $product_type ) {
      	if( isset( $downloadable_fields['downloadable_files'] ) && isset( $downloadable_fields['downloadable_files']['options'] ) && isset( $downloadable_fields['downloadable_files']['options']['file'] ) ) {
      		unset( $downloadable_fields['downloadable_files']['options']['file']['custom_attributes'] );
      		unset( $downloadable_fields['downloadable_files']['options']['name']['custom_attributes'] );
      	}
      	
      	return $downloadable_fields;
      }
      add_filter( 'wcfm_product_fields_downloadable', 'wcfm_product_fields_custom_downloadable', 20, 3 );

      Thank You

Viewing 3 reply threads
  • The topic ‘Add Product | Downloadable File’ is closed to new replies.