• Resolved tanjadjon

    (@tanjadjon)


    I am using the free version, and I followed the steps in the forum to create a custom template, but the additional code is not showing up in my invoices.

    First, i created the path: …/themes/DiviChild/woocommerce/pdf/yourtemplate

    here I copied the files from the plugin directory ( invoice.php, style.css… )

    I uploaded the image sign_invoice_mk.jpg to the same folder.

    I added this code in the invoice.php ( with no additional css)

    <?php do_action( 'wpo_wcpdf_after_order_details', $this->get_type(), $this->order ); ?>

    <img src="<?php echo $this->get_template_path(); ?>/sign_invoice_mk.jpg"/> /* this is my code */


    <div class="bottom-spacer"></div>

    <?php if ( $this->get_footer() ) : ?>


    I tried to disable and reenable the plugin, clear cache, but still the image does not show up in the invoice. I also make some changes to the css file, but those are not rendering also.

    What am I doing wrong, am I missing something ?

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

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

    (@yordansoares)

    Hi @tanjadjon,

    Did you select your custom PDF template in WooCommerce?> PDF?Invoices?> General?> Choose?a?template?

    That said, if you only want to add an image after the order details table, I would recommend using our default “Simple” template in combination with a code snippet hooked to our PDF templates action hooks, like this:

    /**
    * PDF Invoices & Packing Slips for WooCommerce:
    * Add an image after the order details table
    */
    add_action( 'wpo_wcpdf_after_order_details', function( $document_type, $order ) {
    if ( 'invoice' === $document_type && $order ) {
    $image_src = 'https://img.logoipsum.com/288.svg';
    echo "<img src='{$image_src}' />";
    }
    }, 10, 2 );

    This way, you would not need to worry about keep your PDF template updated or losing your customizations somehow.

    If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide:?How to use code snippets

    Thread Starter tanjadjon

    (@tanjadjon)

    Thanks so much ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.