Display product featured image in cart instead of variation thumbnail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add this to your child theme's functions.php file | |
function wc_custom_cart_thumb( $thumb, $cart_item ) { | |
return get_the_post_thumbnail( $cart_item['product_id'], 'shop_thumbnail' ); | |
} | |
add_filter( 'woocommerce_cart_item_thumbnail', 'wc_custom_cart_thumb', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment