'WooCommerce product images in other plugin
I'm trying to get product thumbnail images into a PDF packing slip template on a WooCommerce site, but as a beginner can't really figure out how to call the product thumbnail.
I'm using the "free version of the plugin WooCommerce PDF Invoices & Packing Slips.
A snippet from the template file where I figured I should write any needed code:
<table class="order-details">
<thead>
<tr>
<th class="image"><?php _e( 'Afbeelding', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
<th class="product"><?php _e( 'Product', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
<th class="quantity"><?php _e( 'Aantal', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ( $this->get_order_items() as $item_id => $item ) : ?>
<tr class="<?php echo apply_filters( 'wpo_wcpdf_item_row_class', 'item-'.$item_id, $this->get_type(), $this->order, $item_id ); ?>">
<td class="image" style="width: 20%">
<img src="<?php woocommerce_get_product_thumbnail(); ?>">
</td>
<td class="product">
<?php $description_label = __( 'Description', 'woocommerce-pdf-invoices-packing-slips' ); // registering alternate label translation ?>
<span class="item-name"><?php echo $item['name']; ?></span>
<?php do_action( 'wpo_wcpdf_before_item_meta', $this->get_type(), $item, $this->order ); ?>
<span class="item-meta"><?php echo $item['meta']; ?></span>
<dl class="meta">
<?php $description_label = __( 'SKU', 'woocommerce-pdf-invoices-packing-slips' ); // registering alternate label translation ?>
<?php if ( ! empty( $item['sku'] ) ) : ?><dt class="sku"><?php _e( 'SKU:', 'woocommerce-pdf-invoices-packing-slips' ); ?></dt><dd class="sku"><?php echo $item['sku']; ?></dd><?php endif; ?>
<?php if ( ! empty( $item['weight'] ) ) : ?><dt class="weight"><?php _e( 'Weight:', 'woocommerce-pdf-invoices-packing-slips' ); ?></dt><dd class="weight"><?php echo $item['weight']; ?><?php echo get_option( 'woocommerce_weight_unit' ); ?></dd><?php endif; ?>
</dl>
<?php do_action( 'wpo_wcpdf_after_item_meta', $this->get_type(), $item, $this->order ); ?>
</td>
<td class="quantity"><?php echo $item['quantity']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
It's about the first column cell in the -section. Is what I'm trying to achieve possible? If so, how would I get it to work?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|