1
votes

i have a woocommerce website, on the category page its show list of product, but the product image on the category page is thumbnail. i want to show full image of products in category page, please help me from where in the code i changed that?

Thanks

2

2 Answers

0
votes

This doesn't require coding (assuming your theme hasn't changed Woocommerce's default behaviour.)

You can change the image sizes in the Woocommerce settings -> Products->Product images, in admin.

For the categories pages, you want the 'Catalogue Images'.

You then need to regenerate thumbnails to apply the change to all existing images. You can use this plugin for that - https://wordpress.org/plugins/regenerate-thumbnails/

If you do want/need to go down the coding route, then you need to override the relevant Woocommerce template file, in your own theme. Or, maybe just override an action (remove Woocommerce's one and add your own).

I can't tell you exaclty what you need to do, based on the info in your question, but you need to either copy a template file into your theme, or add your own function to hook into the relevant template.

And then, it will be a matter of changing the image size string in the function that produces the image. For the full image, you want this image size:

'full'

(there is no 'shop_full', so you just use the native full size that WordPress provides)

0
votes

Use below code:

remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 );

add_action( 'woocommerce_before_shop_loop_item_title',
function() {
    echo woocommerce_get_product_thumbnail( 'product-category', 294, 294 );},10);