Display products images on the checkout page in WooCommerce

Display products images on the checkout page in WooCommerce on child sites.

Snippet Type

Execute on Child Sites

Snippet

add_filter( 'woocommerce_cart_item_name', 'wc_product_image_review_order_checkout', 9999, 3 );
  
function wc_product_image_review_order_checkout( $name, $cart_item, $cart_item_key ) {
    if ( ! is_checkout() ) return $name;
    $product = $cart_item['data'];
    $thumbnail = $product->get_image( array( '50', '50' ), array( 'class' => 'alignleft' ) );
    return $thumbnail . $name;
}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.