My PHP code is:
<ul class="minicart-content">
<?php foreach($woocommerce->cart->cart_contents as $cart_item_key => $cart_item): ?>
<li>
<a href="<?php echo get_permalink($cart_item['product_id']); ?>" class="product-image">
<?php $thumbnail_id = ($cart_item['variation_id']) ? $cart_item['variation_id'] : $cart_item['product_id']; ?>
<?php echo get_the_post_thumbnail($thumbnail_id, 'shop_thumbnail'); ?>
</a>
<div class="detail-item">
<div class="product-details">
<?php echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf( '<a href="%s" class="btn-remove" title="%s"><span></span></a>', esc_url( $woocommerce->cart->get_remove_url( $cart_item_key ) ), __( 'Remove this item', 'shoppystore' ) ), $cart_item_key ); ?>
<a class="btn-edit" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php esc_attr_e('View your shopping cart', 'shoppystore'); ?>"><span></span></a>
<p class="product-name">
<a href="<?php echo get_permalink($cart_item['product_id']); ?>"><?php echo esc_html( $cart_item['data']->post->post_title ); ?></a>
</p>
<div class="qty-number"><span><?php esc_html_e('Quantity: ', 'shoppystore'); ?> </span><?php echo esc_html( $cart_item['quantity'] ); ?></div>
</div>
<div class="product-details-bottom">
<span class="price"><?php echo $woocommerce->cart->get_product_subtotal($cart_item['data'], 1); ?></span>
</div>
</div>
</li>
<?php endforeach; ?>
</ul>
I am getting img with that code:
<img height="50px" width="50px" src="<?php
echo $cart_item['product_id']; $feat_image = wp_get_attachment_url( get_post_thumbnail_id($cart_item['product_id']) );
echo $feat_image;
?>">
I also try to hard code img for testing
<img height="50px" width="50px" src="http://www.toys4all.pk/wp-content/uploads/2016/07/ttoys498_01_1600x1200QecQ.jpg" alt="message">
But it not showing the img or alt string.