WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
How to pass a bigger thumbnail image to cart (5 posts)

  1. luvs
    Member
    Posted 1 year ago #

    Im trying to make the product thumbnail in the cart bigger.

    I managed to do that by altering the css, but as the image passed is only 90*90 it will get all blurry.

    So I went into my woocommerce template files and found cart.php and the following line:

    <td class="product-thumbnail">
    <?php
    $thumbnail = apply_filters( 'woocommerce_in_cart_product_thumbnail', $_product->get_image(), $values, $cart_item_key );
    printf('%s', esc_url( get_permalink( apply_filters('woocommerce_in_cart_product_id', $values['product_id'] ) ) ), $thumbnail );
    ?>
    </td>

    But I cant figure out how that translates to the 90*90 picture? Any tips on how I can pass a bigger picture?

    http://wordpress.org/extend/plugins/woocommerce/

  2. stef415
    Member
    Posted 1 year ago #

    I have the same question. The cart uses the thumbnail sizes from Settings > Catalog > Image Options > Product Thumbnails, but I want the cart thumbnails to appear larger than the thumbnails on the product page. How can the catalog image be used instead?

  3. stef415
    Member
    Posted 1 year ago #

    I ended up changing the Product Thumbnails dimensions to the size I want them to appear in the cart -- under WooCommerce > Settings > Catalog > Image Options > Product Thumbnails -- and setting the product page thumbnails to a smaller size with CSS.

  4. PearlsInternational
    Member
    Posted 1 year ago #

    Stef415 (or anyone else), could you be a bit more specific on the process for this? For some reason this didn't change the size of my cart images (I also regenerated my thumbnails to the new size). Surely there's a way to designate cart thumbnail size through the cart.php?

    Thanks!

  5. Shieeet
    Member
    Posted 7 months ago #

    The following should work (I omitted the filter):

    <?php echo get_the_post_thumbnail( $_product->id, $size, $attr ); ?>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic