• Resolved Qilin

    (@qilin2000)


    Hello there,

    I’m building a woocommerce website, this plugin helps me a lot, even the free version is quite powerful, only one problem that bothers me, how to make the file upload field mandatory when it is embedded in the woocommerce checkout page? It’s originally optional and there’s no settings to turn it into required. Are there any action and filter hooks I should use?

    I’m not very proficient in PHP, any advice would be appreciated.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author nickboss

    (@nickboss)

    Hi, I think you should look for hooks or filters of the Woocommerce checkout page that run before proceeding to the next step.

    However again, I am not sure this would work without some kind of integration of WFU with Woocommerce.

    Can you send me a screenshot how have you added the upload form in the checkout page at nickboss@iptanus.com?

    Regards

    Nickolas

    Thread Starter Qilin

    (@qilin2000)

    Hi Nickolas,

    Thanks for your kind reply, it’s hard for me to make file upload field mandatory, lots of coding work needed, but I found a easier way to partially solve the problem, that’s adding a checkbox to conditionally show or hide upload field, not perfect, better than nothing though.

    Cheers,
    Qilin

    Plugin Author nickboss

    (@nickboss)

    Hi Qilin, the fields of the upload form can be configured to be mandatory easily. There is an option for this in the visual editor of the upload form. Have you found it?

    Nickolas

    Thread Starter Qilin

    (@qilin2000)

    Hi Nickolas,

    I haven’t found any option that can make the field mandatory yet, can you tell me? By the way, I don’t use visual editor to set up the field, I use shortcode composer instead, as I have to embed it in the woocommerce checkout page, like that,
    echo do_shortcode('[wordpress_file_upload uploadid="1" singlebutton="true"]');

    Qilin

    Plugin Author nickboss

    (@nickboss)

    Sorry for the delayed response. One easy way to do it is to create another upload form on a normal page (not Woocommerce) so that you can edit it with the visual editor.

    Make any changes so that your form looks the way you want in the Woocommerce checkout page.

    Then copy the shortcode and paste it in do_shortcode function. It will work just fine 🙂

    Nickolas

    Thread Starter Qilin

    (@qilin2000)

    Thanks for the reply. Actually, I did created another upload and edited it with the visual editor before, but I cannot find an option that can make the upload field mandatory, can you tell me which option it is?

    Qilin

    Plugin Author nickboss

    (@nickboss)

    Sure, open the visual editor of the shortcode and go to Additional Fields where you can configure the userdata fields. You will see on the right side the properties for each field. There is a Required property, to make the field required.

    Nickolas

    Thread Starter Qilin

    (@qilin2000)

    Hmmm, I think you may not understand my problem, what I want is make the upload field itself mandatory, if it works, the label would be ‘Upload file (required)’, not any other additional fields. Of course you can make any additional fields mandatory, there is a property as you mentioned, but this doesn’t seem to be related to my problem.

    Qilin

    Plugin Author nickboss

    (@nickboss)

    Ok so you want the user to upload a file before leaving the checkout page.

    This requires some kind of integration with Woocommerce. I can check it. Can you send me a screenshot of how the upload form looks like in checkout page? Me email is nickboss@iptanus.com.

    Nickolas

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘how to make file upload field mandatory (required)?’ is closed to new replies.