Title: code for thumbnail print
Last modified: April 23, 2017

---

# code for thumbnail print

 *  Resolved [mahi38](https://wordpress.org/support/users/mahi38/)
 * (@mahi38)
 * [9 years ago](https://wordpress.org/support/topic/code-for-thumbnail-print/)
 * Hi,
 * I made a customized template.
    After upgrading WooCommerce PDF Invoices & Packing
   Slips to 1.6.5 and WooCommerce to 3.0.4 I have a line code that makes the PDF
   generation crash. The code should print the thumbnail of a product.
 *     ```
       <td class="thumbnail">
       <?php
          $_product = $wpo_wcpdf->export->order->get_product_from_item( $item );
          if ($item['product_id'] > 0) {
             echo $_product->get_image( array(30, 50) ) . "<br>"; // does not work anymore
          }
       ?>
       </td>
       ```
   
 * I substitute **$wpo_wcpdf->export** with **WPO_WCPDF()->export** but it does 
   not solve the issue.
 * What do I miss ?
 * thanks

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [boutzamat](https://wordpress.org/support/users/boutzamat/)
 * (@boutzamat)
 * [9 years ago](https://wordpress.org/support/topic/code-for-thumbnail-print/#post-9087913)
 * Something went wrong during one of the last updates.
    I always had Thumbnail 
   showing in WC PDF but its gone after latest update.
 * Im setting back the previous version (working).
    Tell me if you want the previous
   version where the thumbnail is actually working.
 *  Thread Starter [mahi38](https://wordpress.org/support/users/mahi38/)
 * (@mahi38)
 * [9 years ago](https://wordpress.org/support/topic/code-for-thumbnail-print/#post-9101528)
 * Yes please, send me an update
 * thanks a lot
 *  [boutzamat](https://wordpress.org/support/users/boutzamat/)
 * (@boutzamat)
 * [9 years ago](https://wordpress.org/support/topic/code-for-thumbnail-print/#post-9103905)
 * It is not a Upgrade, its a Downgrade.
    The Downgrade will allow you to use image
   thumbnails in the PDF.
 * Place “custompdf” folder in “/wp-content/themes/your-child-theme/woocommerce/
   pdf/”
 * Then, replace the folder “/wp-content/plugins/woocommerce-pdf-invoices-packing-
   slips” with the folder “woocommerce-pdf-invoices-packing-slips”.
 * [https://mega.nz/#!RB5nWLZQ!fCFVoA00o47q0_jwElOsgbpJIxDMZaPZYjOLqo6p9XI](https://mega.nz/#!RB5nWLZQ!fCFVoA00o47q0_jwElOsgbpJIxDMZaPZYjOLqo6p9XI)
    -  This reply was modified 9 years ago by [boutzamat](https://wordpress.org/support/users/boutzamat/).
      Reason: Forgot the URL to the plugin :P
 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [9 years ago](https://wordpress.org/support/topic/code-for-thumbnail-print/#post-9108709)
 * I would certainly not recommend that. You don’t need to use any custom code for
   this. First of all it’s important to note that `$item` is not the WooCommerce
   item but the PDF item. The WooCommerce item is under `$item['item']`. The product
   object is already loaded under `$item['product']` and the thumbnail (img tag)
   as `$item['thumnail']`.
 * Hope that helps! If you want to avoid things like this, the [Premium Templates](https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-premium-templates/)
   come with a customizer that will let you add any columns (including the thumbnail)
   with a simple drag & drop interface, no coding required.
 * Hope that helps!
    Ewout

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘code for thumbnail print’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-pdf-invoices-packing-slips/assets/icon-256x256.
   png?rev=2189942)
 * [PDF Invoices & Packing Slips for WooCommerce](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Ewout](https://wordpress.org/support/users/pomegranate/)
 * Last activity: [9 years ago](https://wordpress.org/support/topic/code-for-thumbnail-print/#post-9108709)
 * Status: resolved