• Resolved fredperes

    (@fredperes)


    I’m using a plugin called “Brazilian Market for Woocommerce”, to customize the checkout experience.

    The plugin inserts a news field “billing_number”. It’s the number of the buyer’s house.

    How can I insert it in my custom template? It should be displayed right after the address.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hello @fredperes

    Please read this documentation page: Displaying a custom field in a custom template

    Hope that helps!

    Thread Starter fredperes

    (@fredperes)

    I’ve tried this:

    $this->billing_number('billing_number', 'Billing number:')

    Got this error:

    Fatal error: Call to undefined method WPO\WC\PDF_Invoices\Documents\Invoice::billing_number()
    #0 /app/public/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(742): include()
    #1 /app/public/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(646): WPO\WC\PDF_Invoices\Documents\Order_Document->render_template('/app/public/wp-...', Array)
    #2 /app/public/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(671): WPO\WC\PDF_Invoices\Documents\Order_Document->get_html()
    #3 /app/public/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/class-wcpdf-main.php(329): WPO\WC\PDF_Invoices\Documents\Order_Document->output_html()
    #4 /app/public/wp-includes/class-wp-hook.php(287): WPO\WC\PDF_Invoices\Main->generate_pdf_ajax('')
    #5 /app/public/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array)
    #6 /app/public/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #7 /app/public/wp-admin/admin-ajax.php(175): do_action('wp_ajax_generat...')
    #8 {main}

    Thie field is:
    <input type=”text” class=”input-text form-control” name=”billing_number” id=”billing_number” placeholder=”” value=””>

    Any clues? Thanks!

    Plugin Contributor alexmigf

    (@alexmigf)

    Hello @fredperes

    Try instead this: <?php $this->custom_field('billing_number', 'Billing number:'); ?>

    Thread Starter fredperes

    (@fredperes)

    The error is gone. But it’s not displaying the value.

    Plugin Contributor alexmigf

    (@alexmigf)

    Hi @fredperes

    Probably because billing_number is not the correct custom field name. Please read our documentation page: Finding WooCommerce custom fields

    Thread Starter fredperes

    (@fredperes)

    Problem solved!

    The field is “_billing_number”.

    Thanks a lot for your help!

    Plugin Contributor alexmigf

    (@alexmigf)

    You’re welcome ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Insert field “billing_number”’ is closed to new replies.