• Hi,
    I need to add some extra fields to the invoice.
    I sow into another comment that you gave a code:
    `add_filter( ‘wcdn_order_info_fields’, ‘wcdn_order_info_fields_function’, 10, 2 );
    public static function wcdn_order_info_fields_function( $fields, $order ) {
    $new_fields = array();

    $locations_label = “Your Custom label”;
    $output = “Your custom data which you want to output”;
    $new_fields[ $locations_label ] = array(
    ‘label’ => $locations_label,
    ‘value’ => $output
    );

    return array_merge( $fields, $new_fields );
    }

    But it did not work. The site crashed.
    Can you help me?
    This is the website:https://etupperware.ro/
    And the fields I need to add are above “Recomandat de” : “Nume” and “oras”

Viewing 1 replies (of 1 total)
  • Plugin Support Upendra Kapse

    (@wpupen)

    Hello @anadavosagency,

    Apologies for the delay in getting back to you on this.

    This was an example code snippet that will require changes in it based on which custom field you want to add to the Invoice. Did you make the relevant changes in the above example code snippet to fetch your custom field?

    If yes, can you please share the code snippet that you have added and also share the error you get when the site crashes? You will be able to find the error in the error log file on your server or you may have received an email on your admin email address too which will have the exact fatal error due to which the site got crashed. I am guessing there could be some syntax error in your custom function.

    Kind Regards,
    Upendra.

Viewing 1 replies (of 1 total)
  • The topic ‘Add extra fields’ is closed to new replies.