On my Wordpress website, using WooCommerce, on the Checkout page, I am seeing the photos appear above the list of products at Checkout. How do I make them appear IN the list of products, as shown?
This is what I have at the moment:
add_action('woocommerce_checkout_before_order_review', 'displays_cart_products_feature_image');
function displays_cart_products_feature_image() {
foreach ( WC()->cart->get_cart() as $cart_item ) {
$item = $cart_item['data'];
if(!empty($item)){
$product = new WC_product($item->id);
// $image = wp_get_attachment_image_src( get_post_thumbnail_id( $product->ID ), 'single-post-thumbnail' );
echo $product->get_image();
// to display only the first product image uncomment the line bellow
// break;
}
}
}
This is related to Get Cart products id on checkout WooCommerce page, to display product images.
Thanks!