• Resolved 2CAN

    (@2can)


    Hi, i added a custom field with WooCommerce Checkout Manager
    The field label is “P.IVA / Codice Fiscale” and abbreviation is “myfield5”.

    I need to add this field into invoice.php

    i added

    <?php $wpo_wcpdf->custom_field(‘P.IVA / Codice Fiscale’, ‘P.IVA/Codice Fiscale:’, true); ?>

    This code display the label but not the value.
    i tried to use “myfield5” or “billing_myfield5” instead “P.IVA / Codice Fiscale” but the value is not showed (the custom field is filled).

    can you help me? Thank’s

    https://www.ads-software.com/plugins/woocommerce-pdf-invoices-packing-slips/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! According to their FAQ, it should be:

    <?php $wpo_wcpdf->custom_field('myfield5', 'P.IVA / Codice Fiscale'); ?>

    Hope that helps!
    Ewout

    Thread Starter 2CAN

    (@2can)

    I had already tried but it does not work.
    I tried also “billing_myfield5” that is the id of field. does not work.

    any suggestion?
    Thank you

    Plugin Contributor Ewout

    (@pomegranate)

    That’s strange! You could try ‘_billing_myfield5’ or ‘_myfield5’ if the field is hidden. Or install the WooCommerce Store Toolkit which will list all the custom fields at the bottom of the order page (the meta key is printed in bold there)

    Let me know what you find!

    Thread Starter 2CAN

    (@2can)

    great! it’s work with _billing_myfield5

    i dont’ know why, it is not an hidden field.

    anyway, thankyou

    Plugin Contributor Ewout

    (@pomegranate)

    any field in WordPress that has a leading underscore is hidden by default in the ‘Custom Fields’ Meta Box. This allows plugins to present it under a different name than the meta key (so P.IVA / Codice Fiscale instead of _billing_myfield5 in your case), which is probably why it’s not hidden for you.

    Glad to hear it’s resolved ??

    Good morning, please Could you tell me which file should add the code:
    <? Php $ wpo_wcpdf-> custom_field (‘myfld1’, ‘NIF’); ?>
    for my custom field appears on the pdf invoice?

    Thank you very much.

    Plugin Contributor Ewout

    (@pomegranate)

    Hi! You insert that in the template you want this to appear in, either invoice.php or packing-slip.php. Before you do this, you have to copy these files to your child theme (instructions here). However, I recommend using action hooks in combination with Code Snippets instead, as this is less work:
    Displaying a custom field.

    Hope that helps!
    Ewout

    Thank you very much for your help Ewout.
    A greeting.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Custom field’ is closed to new replies.