For you to run an effective WooCommerce store, it would help if you add product images. Product images are important in any online store because they create an impression on the buyer. Moreover, a product image enhances the product description, which makes it appealing for the visitors.
Additionally, a product image helps the customer to visualize the product before making a purchase. They help customers to have an idea of how it would suit their utility.
Moreover, I highly recommend that you add at least four or five angular pictures that are of good quality. If upload low-quality images, customers will not be able to zoom into the pictures. Preferably, all your product images should have plain white backgrounds.
WooCommerce Hide Product Image on Cart Page
There are certain pages where you might want to hide or remove the images. For example, to optimize the cart page, you might want to remove the images. This will ensure that customers on your store can proceed to the checkout quickly. This is because the customer has already seen the image on the shop and product page.
In this post, you will see how it is very easy to hide images on the cart page. By default, the WooCommerce cart page includes product images and links to the product page for each item in the cart, as shown below:
However, WooCommerce is flexible to customization. This means you can customize this page with a couple of handy filters to change the cart elements.
Steps to Hide Product Images on the Cart Page
Here are the steps that you need to follow:
- Log into your WordPress site and access the Dashboard as the admin user.
- From the Dashboard menu, click on Appearance Menu > Theme Editor Menu. When the Theme Editor page is opened, look for the theme functions file to hide product images and links on the cart page.
- Add the following code to the functions.php file:
add_filter( 'woocommerce_cart_item_thumbnail', '__return_false' ); function njengah_remove_cart_product_link( $product_link, $cart_item, $cart_item_key ) { $product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key ); return $product->get_title(); } add_filter( 'woocommerce_cart_item_name', 'njengah_remove_cart_product_link', 10, 3 );
How the Code Works
In the code snippet above, hides WooCommerce product images from the cart easily using the woocommerce_cart_item_thumbnail
filter, by setting it to return a false.
To remove the links to WooCommerce product pages in the cart requires a slightly longer snippet. I have used the woocommerce_cart_item_name
filter. Typically, this uses something like <a href="product_url">product_name</a>
, but I forced it to return the product name instead.
Conclusion
Product images are the primary tools for convincing customers on your store. However, they might not be needed on the cart page depending on your design. Moreover, I have highlighted that images on your store need to be of good quality. This post aims to teach you how to hide the product images and links on the cart page. However, if you need some help, please consider hiring a qualified WordPress developer, so that you do not break down your site.
Similar Articles
- How to Simplify Checkout Free Items Storefront Theme
- How to Add Search Box on Top of Page Storefront Theme
- Move Price WooCommerce Storefront Hooks
- How to Remove Zoom Effect on WooCommerce Product Image
- How to Change Add to Cart Button Text In WooCommerce Shop Page
- How to Fix Uncaught Type Error: wp.template is not a function
- How to Redirect to Cart after Login in WooCommerce
- How to Add WooCommerce Storefront Product Pagination
- How to Hide Tax Label In WooCommerce
- How to Hide Quantity In Stock In WooCommerce
- How to Add WooCommerce Storefront Hero Image
- How to Set WooCommerce Storefront Thumbnail Sizes
- How to Hide Update Cart Button WooCommerce Cart Page
- How to Resize WooCommerce Product Images
- How to Hide Best Sellers WooCommerce Storefront FrontPage
- How to Customize Storefront Theme Using Customizer
- How to Display WooCommerce Storefront Blog Excerpt
- How Add Text Before the Price in WooCommerce » Add Text Before Price
- How to Hide the WooCommerce Coupon Code Field
- How to Hide Shipping Rates if Free Shipping Available WooCommerce