Archived topic
modify the image of the products.
7 replies · Started by Pablo on April 21, 2020
Hello, how are you? Thank you so much for your help.
I need these three things and I can't find them in the paperwork.
https://www.opticaalcudia.com/producto/belt/
1.The image of the product that is rectangular.
2-That it does not increase in size when the mouse passes over it.
3- And that you can't click on the image (otherwise it gets bigger and doesn't work for me)
Thank you very much.
Hi there,
Not too sure what you mean in #1 but this should help for #2 and #3
add_action( 'wp', 'tu_remove_wc_zoom', 20 );
function tu_remove_wc_zoom() {
remove_theme_support( 'wc-product-gallery-zoom' );
remove_theme_support( 'wc-product-gallery-lightbox' );
}
Adding PHP: https://docs.generatepress.com/article/adding-php/
Hello. How are you? Thank you very much.
The zoo doesn't work anymore. Now I need:
1- Modify the size of the image. For example 350 x 200 pixels.
2- I want to remove this: If you put the mouse over the image a name "Hoodie-with-Logo-2.jpg" appears and if you click, the image becomes big. I want to remove these two things from the products.
Thank you
1. The image size is handled by the WooCommerce plugin itself:
https://docs.woocommerce.com/document/fixing-blurry-product-images/
You might also find the Product IMage Area Width option helpful:
https://docs.generatepress.com/article/woocommerce-overview/#single-product
2. Replace the previous snippet with this one:
function remove_image_zoom_support() {
remove_theme_support( 'wc-product-gallery-zoom' );
remove_theme_support( 'wc-product-gallery-lightbox' );
}
add_action( 'wp', 'remove_image_zoom_support', 100 );
That code doesn't work. It doesn't do anything.
A hug.
Try this:
add_filter('woocommerce_single_product_image_thumbnail_html','wc_remove_link_on_thumbnails' );
function wc_remove_link_on_thumbnails( $html ) {
return strip_tags( $html,'<img>' );
}
Hello. How are you?
Still not working. You can still click on the image and your name will also appear if you put the mouse over the image.
Hi there,
I actually try the snippets above:
https://www.screencast.com/t/pJdvQ8MWT
And it's working for me with Prime:
https://wordpress-202309-991531.cloudwaysapps.com/?product=cap
Can you make sure both code are added with the correct methods?
https://docs.generatepress.com/article/adding-php/
your name will also appear if you put the mouse over the image.
I don't believe it's possible to remove that though - this is handled by WooCommerce so you might need to check with their support.