Support » Plugin: WordPress File Upload » Enable upload bo for specific variation or product

  • Resolved ofirkif

    (@ofirkif)


    Hi,
    I have a question, can I choose to enable the upload box according to specific products or variations?
    I mean I need to show the upload option only if certain products are in the cart, otherwise I don’t want to show the option, as not all the items in my shop require upload feature.
    In the admin panel I couldn’t find it.
    Thanks.
    Ofir

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

    (@nickboss)

    Hi, there is a filter that runs before the upload form is rendered. In that filter you can put custom checks. Here is the template:

    if (!function_exists('wfu_file_upload_output_handler')) {
    	function wfu_file_upload_output_handler($output, $params) {
    		$show_upload_form = true;
    		// perform custom checks below and set $show_upload_form to true or false
    		//
    		// custom checks...
    		//
    		// if $show_upload_form is false then the upload form will not be shown
    		if ( !$show_upload_form ) $output = '';
    		return $output;
    	}
    	add_filter('_wfu_file_upload_output', 'wfu_file_upload_output_handler', 10, 2);
    }

    You need to put this code at the end of functions.php file of your theme.

    Regards

    Nickolas

    ofirkif

    (@ofirkif)

    Thanks Nickolas I’ll try it!

    Best regards,
    Ofir

    Plugin Author nickboss

    (@nickboss)

    ok let me know if you have any problems

    Nickolas

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Enable upload bo for specific variation or product’ is closed to new replies.