Okay
  Public Ticket #3505666
Upload file label in Registration form
Closed

Comments

  •  2
    Niko started the conversation

    Hi, is it possible ti limit users to upload only image documents (not .txt nor .doc files) upon registration. We need to request photograph of the license, so no txt is allowed. Or at least to modify this label prompting to select files under the field.

  •  2,218
    WebWizards replied

    Hi Niko,

    You can remove .txt and .doc there, and only allow images and PDFs by adding this PHP code snippet to your site:

    add_filter('b2bking_allowed_file_types_text', function($text){
        $text = 'jpg, jpeg, png, pdf';
        return $text;
    }, 10, 1);
    add_filter('b2bking_allowed_file_types', function($types){
        $types = array( "image/jpeg", "image/jpg", "image/png", "application/pdf" );
        return $types;
    }, 10, 1);
    

    The first part of the snippet controls the text shown, whereas the second part contains the actual types allowed. 


    Let me know if I can help with anything, or if you have any questions,

    Kind regards,

    Stefan


  •  2,218
    WebWizards replied

    That PHP snippet can be added to functions.php, or by following our guide here: https://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/

  •  2
    Niko replied

    Thank you very much. It was very useful and clear! =)

  •   WebWizards replied privately
  •  2
    Niko replied

    Off course. I value your work and help, let me know where else I can leave a feedback