Home Woocommerce Hooks How to add product thumbnail to review order table on checkout page with woocommerce add filter hook?

How to add product thumbnail to review order table on checkout page with woocommerce add filter hook?

by therichpost
Published: Updated: 13 comments
woocommerce

Hello, welcome to therichpost.com. In this post, I will tell you How to add product thumbnail to review order table on checkout page with woocommerce add filter hook? WordPress is the best cms and Woocommerce is the best Ecommerce plugin. WordPress hooks(add_action, add_filter) give us the power to edit or change the code without interruption into the files and this is the best thing about wordpress. Now I am going to tell you how the hooks work. Here is the first image of review order table on checkout page without applying woocommerce hook: Here is the first image of product thumbnail to review order table on checkout page after applying woocommerce hook: And Now Final, here is the woocommerce hook to show product thumbnail to review order table on checkout page and you need to add this hook into your wordpress theme’s functions.php file:

function isa_woo_cart_attributes($cart_item, $cart_item_key){ 
global $product; 
if (is_cart()){ echo "<style>#checkout_thumbnail{display:none;}</style>"; } 
$item_data = $cart_item_key['data']; 
$post = get_post($item_data->id); 
$thumb = get_the_post_thumbnail($item_data->id, array( 32, 50)); 
echo '<div id="checkout_thumbnail" style="float: left; padding-right: 8px">' . $thumb . '</div> ' . $post->post_title; } add_filter('woocommerce_cart_item_name', isa_woo_cart_attributes, 10, 2);

 

There are so many hooks in wordpress and i will let you know all. Please do comment if you any query related to this post. Thank you. Therichpost.com

You may also like

13 comments

bonus September 29, 2018 - 1:09 am

I am not sure where youu are gettinng your information, but
good topic. I needs to spend some time learning much more or understanding more.

Thanks for great information I wass looking for this info for my mission.

Reply
Ajay Malhotra September 29, 2018 - 7:33 am

Thank you for the comment.

Reply
Michael November 6, 2019 - 6:50 pm

Thanks 🙂 but how would it look like to display product variation thumbnail?

Reply
patrick November 26, 2019 - 12:49 am

Thanks buddy that helps alot

Reply
Ajay Malhotra November 27, 2019 - 4:03 pm

Thank you

Reply
Leong December 16, 2019 - 11:04 pm

Hi buddy,
I had used the same function to implement for my review order section and it works but I found out somehow my mini-cart gets affected with multiple images and is outside my tag which is a disaster for displaying my product in mini-cart. Can you send me your email so I can send you how does the interface look like at the moment?

Reply
Ajay Malhotra December 17, 2019 - 3:51 pm Reply
Karen March 12, 2020 - 11:00 am

Hi

I tried to look at your post about adding the order thumbnail to checkout, but I want to add the thumbnail to the order table (which I show in my customized My Account page).

Do you know how to achieve this? any help would be appreciated!

Thanks
Karen

Reply
Ajay Malhotra March 12, 2020 - 11:04 am

This will be customizable. This will need custom code.

Thanks

Reply
harry July 15, 2020 - 12:20 pm

it’s very useful thanks

Reply
Ajay Malhotra July 15, 2020 - 12:23 pm

Thank you

Reply
Sunny January 22, 2021 - 10:16 am

Thanks. code works correctly

Reply
Ajay Malhotra January 22, 2021 - 10:17 am

Great :).

Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.