• Resolved codefixing

    (@codefixing)


    Hey the custom conditional checkout field is not showing on pdf invoices. I have added the code as well but its not work.

    add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_billing_delivery_window_2', 10, 2 );
    function wpo_wcpdf_billing_delivery_window_2 ($template_type, $order) {
        //if ($template_type == 'packing-slip') {
            ?>
            <tr class="form-row">
                <th>Delivery Window:</th>
                <td><?php echo $order->get_meta('_billing_delivery_window_2'); ?></td>
            </tr>
            <?php
        //}
    }

    this is the code I have added

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hello @codefixing,

    Did you try removing the underscore (_) from your custom field?

    Let’s try adding this code snippet instead:

    add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_billing_delivery_window_2', 10, 2 );
    function wpo_wcpdf_billing_delivery_window_2 ($template_type, $order) {
        if ($template_type == 'packing-slip') {
            ?>
            <tr class="form-row">
                <th>Delivery Window:</th>
                <td><?php echo $order->get_meta('billing_delivery_window_2'); ?></td>
            </tr>
            <?php
        }
    }

    If we’re lucky, you’ll see the data on your packing slips.

    Let me know if it works!

    Thread Starter codefixing

    (@codefixing)

    After removing the “_” the field is not showing.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hello @codefixing,

    Maybe you’re using a wrong name for your custom field.

    Please read this guide to learn more: Finding WooCommerce custom fields

    Best regards,
    Yordan.

    Thread Starter codefixing

    (@codefixing)

    I think the field is showing but it’s show the AM and PM text not with the time. Like if the option have 5PM-6PM in the invoice the PM text will show not the 5-6 number. Let me know thanks.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Could you please send a screenshot of the fields displayed by the WooCommerce Store Toolkit plugin within an order at the bottom?

    It should look like this:

    Example of WooCommerce fields displayed by WooCommerce Store Toolkit

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hello @codefixing ,

    Since we haven’t heard back from you in the last two weeks, we’re assuming you found a fix, so I’ll go ahead and mark this ticket as Resolved.

    Feel free to open a new topic if you have any more questions!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Show custom radio field on pdf’ is closed to new replies.