Usman Wali
Usman Wali

Reputation: 397

wooCommerce how to add featured image in ORDER DETAILS table

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

Answers (2)

Agnes
Agnes

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

Delete
Delete

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

Related Questions