Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1119365
    iRocketdesign
    Participant

    Hello,

    My site is http://www.stillwelljacks.com

    I found this older thread and added to my child theme functions.php exactly what you said to regain the Product Image sizing portion of woocommerce and it is not working as the typical woocommerce product image sizing selections are still not available…

    thanks!

    Old thread…

    The image sizes are generated dynamically according to the layout you are using. For example, your stack, boxed layout, site max width, sidebar enabled or disabled and et cetera. Changing it requires custom development. While that is outside the scope of support, I could point you in the right direction with the understanding that it would ultimately be your responsibility to take it from here.

    Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    After that, add following code in your child theme’s functions.php file:

    // =============================================================================
    // WooCommerce Short Thumbnail size change
    // =============================================================================

    function x_woocommerce_shop_thumbnail2() {

    GLOBAL $product;

    $stack = x_get_stack();
    $stack_thumb = ‘shop_catalog’;
    $stack_shop_thumb = $stack_thumb;
    $id = get_the_ID();
    $rating = $product->get_rating_html();

    woocommerce_show_product_sale_flash();
    echo ‘<div class=”entry-featured”>’;
    echo ‘‘;
    echo get_the_post_thumbnail( $id , $stack_shop_thumb );
    if ( ! empty( $rating ) ) {
    echo ‘<div class=”star-rating-container aggregate “>’ . $rating . ‘</div>’;
    }
    echo ‘
    ‘;
    echo “</div>”;

    }

    add_filter(‘init’, function() {

    remove_action( ‘woocommerce_before_shop_loop_item_title’, ‘x_woocommerce_shop_thumbnail’, 10 );

    });

    add_action( ‘woocommerce_before_shop_loop_item_title’, ‘x_woocommerce_shop_thumbnail2’, 10 );

    // Woocommerce Product Images = Show all thumbnails sizes under its settings
    // =============================================================================

    function remove_product_settings_filter() {
    remove_filter( ‘woocommerce_product_settings’, ‘x_woocommerce_remove_plugin_settings’ );
    }

    add_filter(‘init’, ‘remove_product_settings_filter’);
    After that, the WooCommerce image sizes option should be visible for you under WooCommerce settings. You can change the Catalog image size. Make sure to regenerate thumbnails after that.

    Cheers!

    #1119856
    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in! All the codes were correct. Regretfully it is not working because you have inserted in the child theme’s style.css which you are not suppose to. You need to insert the codes in your child theme’s functions.php file.

    Please also check out this topic:
    https://community.theme.co/forums/topic/product-images-woocommerce/#post-224057

    Hope this helps.

    #1120368
    iRocketdesign
    Participant

    Ahhh, thanks!

    #1120740
    Christopher
    Moderator

    You’re welcome.

  • <script> jQuery(function($){ $("#no-reply-1119365 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>