Hi,
I tried a solution from:
https://stackoverflow.com/questions/52009122/displaying-product-thumbnail-and-attribute-in-woocommerce-cart-and-checkout
This worked fine when running the Storefront theme at least:
// Product thumbnail in checkout
add_filter( 'woocommerce_cart_item_name', 'product_thumbnail_in_checkout', 20, 3 );
function product_thumbnail_in_checkout( $product_name, $cart_item, $cart_item_key ){
if ( is_checkout() ) {
$thumbnail = $cart_item['data']->get_image(array( 70, 70));
$image_html = '<div class="product-item-thumbnail">'.$thumbnail.'</div> ';
$product_name = $image_html . $product_name;
}
return $product_name;
}
Then you will need to style it to.
Code goes in functions.php file of your active child theme (or active theme).
Make sure you test this in a test environment before you apply it to your Live site and always keep backups on your files and database.
Hi,
This really worked fine, but in my own case, how can I display full product or featured image using a shortcode?
-
This reply was modified 6 years, 9 months ago by
sdgraphx.
Hi @sdgraphx
We don’t have a shortcode available I’m afraid but if you need more info on how you can modify the checkout you can read more about it in our docs: https://docs.krokedil.com/article/143-klarna-checkout-hooks-action-filter
/Andreas