• Resolved csespla

    (@csespla)


    I tried to follow your instructions to create a custom field and I managed to make them show in the invoice as follows:

    Empresa: <?php $this->custom_field(‘billing_company’); ?> <br>
    CIF empresa: <?php $this->custom_field(‘billing_company_number’); ?>

    But now I would like that they don’t appear if the user left the fields blank. I tried this:
    <?php $this->custom_field(‘custom_fieldname’, ‘Custom field:’); ?>

    It’s not working for me, what am I doing wrong? “Empresa” and “CIF empresa” are the labels I supose (in Spanish Company and Company number) and the fields are “billing_company” and “billing_company_number”.

    Could you help? Thank you

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

    (@pomegranate)

    Just for clarification, did you try to use this code?

    
    <?php $this->custom_field( 'billing_company', 'Empresa:'); ?><br>
    <?php $this->custom_field( 'billing_company_number', 'CIF empresa:'); ?>
    
    
    Thread Starter csespla

    (@csespla)

    That worked! ??

    Plugin Contributor Ewout

    (@pomegranate)

    Which makes me wonder what didn’t work, but I’m glad your issue is solved ??

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