How to add your product images to the checkout page order review table in WooCommerce

You can use the following code snippet to show your product images in the order review table in the checkout page. The output would look like this:

function rs_woo_cart_attributes($cart_item, $cart_item_key) {
    global $product; 
    if (is_cart()){ 
        echo "<style>#checkout_thumbnail{visibility:hidden;}</style>"; 
    $item_data = $cart_item_key['data']; 
    $post = get_post($item_data->get_id()); 
    $thumb = get_the_post_thumbnail($item_data->get_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', 'rs_woo_cart_attributes', 10, 2);

This code can be added following the instructions here:

How to add custom code to your WooCommerce/WordPress site the right way

Have any feedback? Be sure to let me know here: Contact me

Share your thoughts

Your email address will not be published. Required fields are marked *