• Resolved juanbro

    (@juanbro)


    Hello,

    I would like to change the default size of ‘Related Products’ images on the Storefront product page, (but still have them dynamic/responsive). Below is what I’ve tried but it is not working.

    Here’s what I did:
    I added the related.php template file to my child theme:
    wp-content/themes/storefront-child-theme-master/woocommerce/single-product/related.php

    I added the code below in related.php after:
    <?php woocommerce_product_loop_start(); ?>

    
    <?php
    add_filter( 'woocommerce_get_image_size_thumbnail', function( $size ) {
    return array(
    'width' => 150,
    'height' => 150,
    'crop' => 0,
    );
    } ); ?>
    

    What am I missing?

    btw – I’m working from these documents:
    https://docs.woocommerce.com/document/image-sizes-theme-developers/
    https://docs.woocommerce.com/document/template-structure/

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi there,

    I would like to change the default size of ‘Related Products’ images on the Storefront product page, (but still have them dynamic/responsive).

    Looks like your code does not contain anything specific to related products. You can check this link:

    http://www.remicorson.com/woocommerce-change-related-products-image-size/

    for how to add the related products item to your template file.

    Job a11n

    (@jobthomas)

    Automattic Happiness Engineer

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Changing image size of Related Products not working’ is closed to new replies.