All the thumbnails in the cart are run through the following woocommerce_cart_item_thumbnail filter:
$thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key );
Any idea how to add a custom class to the <img>
tag of the thumbnail through a function in the functions.php file of my child theme?
2
Answers
you can simply find and replace the class
You can specify class in attr argument of get_image function like this
get_image function accepts 3 arguments
In second $attr argument you can specify img tag attributes including class, if you defined your own custom thumbnail size, instead of passing null in first argument you can pass it, like this