• Resolved swissspaceboy

    (@swissspaceboy)


    Hello,

    I have virtual products that have no product image. In the cart and checkout pages, I see the column “product-thumbnail” to display the product image, that is empty of course (or it displays a small gif called “placeholder.png”).

    How come that WC doesn’t check not to display the column if there is no product image thumbnail ?

    Can I change some code to have this done ? Meaning, do not display the product image column (thumbnail) if there is no product image to display ? Is there a hook for this ?

    Thanks.

    Didier.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Luminus Alabi

    (@luminus)

    Automattic Happiness Engineer

    @swissspaceboy,

    eCommerce is generally very visual since you’re not in a physical store where you can look at the product, images are a big deal. As such, what you’re looking for here is custom code since what you’re doing is the exception rather than the rule.

    You can override the template responsible for displaying the cart table from within your theme and make it behave however you wish. This document covers where to find the templates and how to override them within your theme – https://docs.woocommerce.com/document/template-structure/

    Thread Starter swissspaceboy

    (@swissspaceboy)

    Hello,

    Fixed it with some extra code. For those interested to drop the product thumbnail in the cart (image + header) :

    functions.php : add_filter( ‘woocommerce_cart_item_thumbnail’, ‘__return_false’ );
    style.css : .woocommerce table.cart .product-thumbnail { display:none; }

    Adapt according to your setup of child theme etc.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Don’t display empty product images in cart and checkout’ is closed to new replies.