Adds upload field on Woocommerce checkout

0

I need to put a field for file upload in the checkout of Woocommerce, I can insert the fields, but I can not retrieve the values entered, I get all the other fields except the upload, I'm trying with var_dump, follow the simplified code :

add_action ('woocommerce_after_order_notes', 'add_field_checkout_farma');

    function add_field_checkout_farma() {     

        ?>

        <div class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
            <label for="account_last_name"><?php esc_html_e( 'Receita Médica', 'woocommerce' ); ?></label>
            <input type="file" class="woocommerce-Input woocommerce-Input--text input-text" name="receita_medica" id="receita_medica" autocomplete="wk_rg" multiple="false" />
        </div>
        <?php
    }

I try to get the results this way:

   add_action('woocommerce_checkout_update_order_meta','my_custom_checkout_field_update_order_meta');

    function my_custom_checkout_field_update_order_meta($order_id) {

        var_dump($_FILES);
        die;
    
asked by anonymous 01.10.2018 / 15:57

0 answers