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

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

Comments

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

  1. bonus Avatar
    bonus

    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.

  2. Ajay Malhotra Avatar

    Thank you for the comment.

  3. Michael Avatar
    Michael

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

  4. patrick Avatar
    patrick

    Thanks buddy that helps alot

  5. Leong Avatar
    Leong

    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?

  6. Karen Avatar
    Karen

    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

  7. Ajay Malhotra Avatar

    This will be customizable. This will need custom code.

    Thanks

  8. harry Avatar
    harry

    it’s very useful thanks

  9. Sunny Avatar
    Sunny

    Thanks. code works correctly