Hi
Please add this snippet to your active theme’s/child theme’s functions.php file:
add_filter( 'woocommerce_cart_item_name', 'ywp_product_image_on_checkout', 10, 3 );
function ywp_product_image_on_checkout( $name, $cart_item, $cart_item_key ) {
if ( ! is_checkout() )
return $name;
$_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
$thumbnail = $_product->get_image();
$image = '<div class="ywp-product-image" style="width: 52px; height: 45px; display: inline-block; padding-right: 7px; vertical-align: middle;">'
. $thumbnail .
'</div>';
return $image . $name;
}
Good luck
Hello! Thanks for your help.
I want to tell you that I have added the code and it works, the product image is shown at checkout.
Now, a problem arises.
The product title is not displayed correctly.
To explain myself better, here I show you the screenshots.
Mobile: https://mega.nz/#!W0FikCJL!ww1Z8noIv60v3H5QOX29fEtxBuF6k_-kDE1UxqkU_f8
Desktop: https://mega.nz/#!W5MATQqD!hkRbRRCv2Hs9GAvNDWj8S90g4nQRkFPOkvVN9dEYPWo
Do you know what I can do to fix this?
Hi
Sorry this issue is not related to the Woocommrce core and refers to the knowledge of css
Good luck