Last active
September 27, 2015 13:44
-
-
Save MindyPostoff/1d3384c6bf787345bbdd to your computer and use it in GitHub Desktop.
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