Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.
http://69.89.31.200/~horologi/shop/

I'm working on the site above and the client has requested that on the shop page, all the product information is displayed on that page, including all product thumbnails. I have copied the WooCommerce template files into my theme directory so I can modify them, and have been messing around with the loop-shop.php file. What I tried first was simply adding the following code into the product page loop:

<div class="images">

<?php if ( has_post_thumbnail() ) : ?>

    <a itemprop="image" href="<?php echo wp_get_attachment_url( get_post_thumbnail_id() ); ?>" class="zoom" rel="thumbnails" title="<?php echo get_the_title( get_post_thumbnail_id() ); ?>"><?php echo get_the_post_thumbnail( $post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ) ) ?></a>

<?php else : ?>

    <img src="<?php echo woocommerce_placeholder_img_src(); ?>" alt="Placeholder" />

<?php endif; ?>

<?php do_action('woocommerce_product_thumbnails'); ?>

I pulled that code from the product-image.php file. Unfortunately it outputs the thumbnails full-size. I wasn't sure of the 'best practice' way of doing this. Any help is greatly appreciated. Thank you!

share|improve this question
    
Have you tried woocommerce support? –  Tom J Nowell Sep 14 '12 at 9:44
add comment

2 Answers

up vote 0 down vote accepted

The second parameter on get_the_post_thumbnail takes the size of the image you want. You're currently passing in:

apply_filters( 'single_product_large_thumbnail_size', 'shop_single' )

but change that to

apply_filters( 'single_product_small_thumbnail_size', 'shop_thumbnail' )

And you'll have the smaller image size. You can also pass in "thumbnail" or any of the custom sizes you have in that spot without the apply_filter function.

share|improve this answer
add comment

Instead of using shop_thumbnail or shop_single, you can try array(width, height).

Just replace this line of your code

apply_filters( 'single_product_large_thumbnail_size', 'shop_single' )

with

apply_filters( 'single_product_large_thumbnail_size', array(300, 300) )
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.