Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1286309
    argonstudios
    Participant

    Hello,

    I have been searching through your forums to find a way to clean up the image sizes that X looks to skew a bit. My site product images were perfect with our last theme (themify) but we need to clean up other aspects of the site which X has done beautifully with the exception of the Woocommerce side of things.

    Since the forum post I am listing below is over a year old and you have applied updates to the theme, can you confirm and/or update the code that I need to use to fix my Woocommerce image issue please?

    Your forum post that I am referencing is here:
    https://community.theme.co/forums/topic/woocommerce-product-sizes-in-x-theme/

    Thank you!

    #1286461
    Nabeel A
    Moderator

    Hi there,

    Thanks for writing in! You can try adding the following code in your child theme’s functions.php file:

    add_action('init', 'default_woocommerce_thumbnails', 99 );
    
    function default_woocommerce_thumbnails() {
    remove_action( 'woocommerce_before_shop_loop_item_title', 'x_woocommerce_shop_product_thumbnails', 10 );  
    add_action( 'woocommerce_before_shop_loop_item_title', 'x_woocommerce_shop_thumbnail_v2', 99 );
    }
    
    function x_woocommerce_shop_thumbnail_v2() {
    
      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 '<a href="' . get_the_permalink() . '">';
          echo get_the_post_thumbnail( $id , $stack_shop_thumb );
          if ( ! empty( $rating ) ) {
            echo '<div class="star-rating-container aggregate">' . $rating . '</div>';
          }
        echo '</a>';
      echo "</div>";
    
    }

    Let us know how this goes!

    #1287836
    argonstudios
    Participant

    The code looks like it made the images consistent across the site, but they looked like the category images which are vertical and I need them to be like the sub-category is formatted now like this page so that the images are not cutoff:
    http://www.economycandy.com/product-category/candy/candy-bars-candy/

    Can we adjust that code to accomplish this?

    Thank you.

    #1288107
    Rue Nel
    Moderator

    Hello There,

    Thanks for updating in and for the clarifications. To have a better control of the product images and make sure that you use the default WooCommerce product sizes, please check out this thread: https://community.theme.co/forums/topic/product-images-woocommerce/#post-224057

    Please let us know how it goes.

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