• Resolved dsirka

    (@dsirka)


    Is there a way to print the PO number on the PDF form? It can be printed anywhere on the form.
    It would be great to replace “Payment method” with “Purchase Order” or “PO” followed by the purchase order number.

    Thank you so much with your help.

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

    (@pomegranate)

    Hi!
    I am assuming the PO number is collected with a custom checkout field, you can follow instructions from the documentation: Displaying a custom field.
    You can hide the payment method with CSS:

    
    .payment-method { display: none; }
    

    Or if you have created a custom template you can simply remove it there directly.

    Hope that helps!
    Ewout

    Thread Starter dsirka

    (@dsirka)

    I’m using Woocommerce extension at checkout. WooCommerce Purchase Order Gateway
    Could you help me figure out the hook name and any other code I need to replace to have PO number show on the invoice and packaging slip?

    Plugin Contributor Ewout

    (@pomegranate)

    Hi! All you need to know is the field name for the PO Number. From a quick Google search it looks like this is _po_number, so you could try that first following that first documentation link in my previous post.
    If that doesn’t work, you can follow this guide: Finding WooCommerce Custom Fields

    Hope that helps!
    Ewout

    Thread Starter dsirka

    (@dsirka)

    Thank you. Somehow I worked it out.
    If you want to take a look at this code and see if I should make any other change?

    add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_delivery_date', 10, 2 );
    function wpo_wcpdf_delivery_date ($template_type, $order) {
            $document = wcpdf_get_document( $template_type, $order );
            ?>
            <tr class="purchase-order-number">
                <th>PO # :</th>
                <td><?php $document->custom_field('_po_number'); ?></td>
            </tr>
            <?php
        }

    Thank you for your help

    • This reply was modified 6 years, 8 months ago by dsirka.
    • This reply was modified 6 years, 8 months ago by dsirka.
    Plugin Contributor kluver

    (@kluver)

    Hi @dsirka,

    Looks great. ??
    If you don’t get any syntax errors or errors in your debug log you should be good to go!

    With kind regards,

    Michael

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Print PO number’ is closed to new replies.