Support » Plugin: PDF Invoices & Packing Slips for WooCommerce » custom message display in invoice

  • Resolved sammzand

    (@sammzand)


    I want to enter below custom message after invoice order total in last line..

    Customer Acknowledgement:
    I [buyer_name]confirm that the said products are being purchased for my internal/personal consumption and not for resale.I
    further understand and agree with [site_name] terms and conditions for sale

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

    (@pomegranate)

    You can do this with the PDF template action hooks.

    Good luck!
    Ewout

    Thread Starter sammzand

    (@sammzand)

    I added this

    add_action( 'wpo_wcpdf_after_order_details', 'wpo_wcpdf_custom_text', 10, 2 );
    function wpo_wcpdf_custom_text ($template_type, $order) {
        if ($template_type == 'invoice') {
        ?>
        <div class="custom-text">
    <p><?php printf( __( '<strong>Customer Acknowledgement:</strong>I %s confirm that the said products are being purchased for my internal/personal consumption and not for resale.I further understand and agree with [site_name] terms and conditions for sale', 'woocommerce' ), $order->billing_first_name . ' ' . $order->billing_last_name ); ?></p>
        </div>
        <?php
        }
    }

    But,it gives me 500 error..

    Plugin Contributor Ewout

    (@pomegranate)

    Works, but you probably already have a function with the same name. Try changing the function name (in both the action and the function itself), wpo_wcpdf_custom_text_2 should work fine.

    Ewout

    Thread Starter sammzand

    (@sammzand)

    Yes,my mistake..

    Fixed!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘custom message display in invoice’ is closed to new replies.