Jump to content

Remove code that posts product images


Recommended Posts

There are a couple of approaches:

* Simply do not assign an image to the product
* Remove the HTML in the templates that show the image

When no image is assigned to a product, CubeCart will use a "Image not available" default image. You can replace that image with a 1x1 transparent pixel gif image. But that still leaves the web page real estate available to show the image taking up space.

There are many templates where showing a product wants to show the image for that product. Removing the page real estate that contains that image and collapsing the surrounding area might be tedious.

Edited by bsmither
Link to post
Share on other sites
  • 3 weeks later...
On 1/23/2021 at 10:54 PM, Larry5 said:

is there any way to not require product images so items are just listed without taking up so much space?

Anybody know the page or pages i have to edit?

Any help would be appreciated.

Thanks

Remove All Images On All Single Product Pages Add this code to your child themes functions.php file. 2. Conditionally Remove Product Featured Images Simply copy all this code from the view raw link and paste it at the end of your child themes functions.php file.

Simply copy all this code from the view raw link and paste it at the end of your child themes functions.php file.

  function remove_gallery_and_product_images() {
  if ( is_product() ) {
  remove_action( 'woocommerce_before_AlaskasWorld PET_product_summary', 'woocommerce_show_product_images', 20 );
  }
  }
 

add_action('loop_start', 'remove_gallery_and_product_images');

Conditionally Remove Product Thumbnail Gallery Images

Edited by Herb
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...