• Resolved eyeink

    (@eyeink)


    I am using the “Print Invoice & Delivery Notes for WooCommerce” and the “Product Input Fields for WooCommerce”. I am trying to get the data from my one input field to show on my printed invoice.

    Looking at the data I want it is stored in the DB at woocommerce_order_itemmeta -> _alg_wc_pif_local ->

    a:1:{i:0;a:33:{s:7:”enabled”;s:3:”yes”;s:4:”type”;s:8:”textarea”;s:8:”required”;s:2:”no”;s:5:”title”;s:25:”Special notes or comments”;s:11:”placeholder”;s:21:”Type your notes here.”;s:13:”default_value”;s:0:””;s:5:”class”;s:0:””;s:5:”style”;s:0:””;s:16:”required_message”;s:28:”Field “%title%” is required!”;s:22:”input_restrictions_min”;s:0:””;s:22:”input_restrictions_max”;s:0:””;s:23:”input_restrictions_step”;s:0:””;s:28:”input_restrictions_maxlength”;s:0:””;s:26:”input_restrictions_pattern”;s:0:””;s:17:”type_checkbox_yes”;s:3:”Yes”;s:16:”type_checkbox_no”;s:2:”No”;s:16:”type_file_accept”;s:15:”.jpg,.jpeg,.png”;s:24:”type_file_wrong_type_msg”;s:16:”Wrong file type!”;s:18:”type_file_max_size”;s:1:”0″;s:22:”type_file_max_size_msg”;s:16:”File is too big!”;s:22:”type_datepicker_format”;s:0:””;s:23:”type_datepicker_mindate”;s:4:”-365″;s:23:”type_datepicker_maxdate”;s:3:”365″;s:23:”type_datepicker_addyear”;s:2:”no”;s:25:”type_datepicker_yearrange”;s:9:”c-10:c+10″;s:24:”type_datepicker_firstday”;s:1:”0″;s:22:”type_timepicker_format”;s:7:”hh:mm p”;s:24:”type_timepicker_interval”;s:2:”15″;s:23:”type_color_allow_typing”;s:0:””;s:19:”type_select_options”;s:0:””;s:15:”_plugin_version”;s:5:”1.2.6″;s:9:”_field_nr”;i:1;s:6:”_value”;s:19:”Happy Birthday Oma!”;}}

    The data from the customer’s input that I want to show in my product info is “Happy Birthday Oma!”

    I had added some other data to my printout by using this code, but it did not work for this custom input field. Here is the code i tried in functions.php:

     if( get_post_meta( $order->id, '_alg_wc_pif_global', true ) ) {
            $new_fields['_alg_wc_pif_global'] = array( 
                'label' => 'Special Customer Note',
                'value' => get_post_meta( $order->id, '_alg_wc_pif_global', true )
            );
        }

    Please let me know the correct code to get the data from your input fields plugin.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter eyeink

    (@eyeink)

    @kenil802 I was told you could help with this. Thanks!

    Plugin Support kenil802

    (@kenil802)

    Hi @eyeink,

    Yes, sure. I will help you with this. I have passed your query to the developer so I will get back to you with I hear from them.

    Regards,
    Kenil Shah

    Thread Starter eyeink

    (@eyeink)

    @kenil802 Thank you for replying! I look forward to hearing back.

    Plugin Support kenil802

    (@kenil802)

    Hi @eyeink,

    We have checked the code and found that you have used _alg_wc_pif_global but you have mentioned _alg_wc_pif_local as meta field. So, can you please correct this using the local instead of global and try whether it is working fine or not?

    Please let us know how it goes.

    Regards,
    Kenil Shah

    Thread Starter eyeink

    (@eyeink)

    @kenil802 This is not working. Here is my full code in my functions.php to add the couple fields to the print invoice, but _alg_wc_pif_local is the only thing not working:

    //Add delivery time & date to Print Order invoice
    
    function example_custom_order_fields( $fields, $order ) {
        $new_fields = array();
    
        if( get_post_meta( $order->id, 'xm_date_time_pi_delivery_time_delivery_date', true ) ) {
            $new_fields['xm_date_time_pi_delivery_time_delivery_date'] = array( 
                'label' => 'Delivery Date',
                'value' => get_post_meta( $order->id, 'xm_date_time_pi_delivery_time_delivery_date', true )
            );
        }
    
        if( get_post_meta( $order->id, 'xm_date_time_pi_delivery_time_delivery_time', true ) ) {
            $new_fields['xm_date_time_pi_delivery_time_delivery_time'] = array( 
                'label' => 'Delivery Time',
                'value' => get_post_meta( $order->id, 'xm_date_time_pi_delivery_time_delivery_time', true )
            );
        }
    
        if( get_post_meta( $order->id, '_alg_wc_pif_local', true ) ) {
            $new_fields['_alg_wc_pif_local'] = array( 
                'label' => 'Special Order Notes',
                'value' => get_post_meta( $order->id, '_alg_wc_pif_local', true )
            );
        }	
    	
        return array_merge( $fields, $new_fields );
    }
    add_filter( 'wcdn_order_info_fields', 'example_custom_order_fields', 10, 2 );

    Is it because _alg_wc_pif_local is a serialized array and I need to get more specific into it?

    • This reply was modified 4 years, 6 months ago by eyeink.
    • This reply was modified 4 years, 6 months ago by eyeink.
    Plugin Support kenil802

    (@kenil802)

    Hi @eyeink,

    Sorry for the delay in response.

    Can you please inform us which input type are you using for this so that we can try to replicate your issue on our site by doing the same.

    Please do the needful.

    Regards,
    Kenil Shah

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Getting Product Input Fields data with Print Invoice & Delivery Notes Plugin’ is closed to new replies.