Reputation: 397
Anyone knows how to customize wooCommerce
ORDER DETAILS table and add product (featured) image in it?
I tried to use:
$img = wp_get_attachment_image_src( $item['product_id'] );
<img src="' . img[0] . '">'
In woocommerce/templates/single-product/order-details.php
but its not working.
Upvotes: 1
Views: 4227
Reputation: 1
The order-details.php is in the /wp-content/plugins/woocommerce/templates/order folder. You will have to copy it to wp-content/themes/your-theme/woocommerce/order folder.
Than add the following line: echo $thumbnail = apply_filters( 'woocommerce_in_cart_product_thumbnail', $_product->get_image() );
before the lines containing this text: echo apply_filters( 'woocommerce_order_item_name'
Well done!
Upvotes: 0
Reputation: 429
within your order-details.php add the following, I hope this works for you aswell.
echo get_the_post_thumbnail( $item['product_id'], 'full' );
Upvotes: 4