Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Display product featured image in cart instead of variation thumbnail
// 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