Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1011134
    tahaabbasi
    Participant

    Hello,

    I am having a problem trying to change the crop ratio of product thumbnail images. I have used this code:

    add_action( 'init', 'x_image_set_settings', 99 );
    function x_image_set_settings () {
    remove_filter( 'woocommerce_product_settings', 'x_woocommerce_remove_plugin_settings', 10 );
    }

    To enable the image crop settings in WooCommerce, over there I have changed the image ratio for Product Thumbnails to 0.78 as my images are not square.

    http://imgur.com/Na2cimP

    After this I regenerated the images for one product to test:

    http://imgur.com/6fDbjxQ

    but As you can see here on my product page, the thumbnail images are still square and are still cropped. Any suggestions on how to fix this? I need my thumbnails to be 0.78 ratio not 1:1

    #1011290
    Rupok
    Member

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #1011703
    tahaabbasi
    Participant
    This reply has been marked as private.
    #1012221
    Rue Nel
    Moderator

    Hello there,

    By default in X, the product image displaying as thumbnail is not the thumbnail sizes which you have set in the WooCommerce. So that the thumbnail images size will display, you must add this custom function code in your child theme’s functions.php file

    
    add_filter('single_product_small_thumbnail_size', function() { return 'shop_thumbnail_image_size'; }, 100 );

    Please make sure that you already set the image dimension of the thumbnails and that you already have regenerated the thumbnails. And Since you have installed a caching plugin SG CachePress and WordFence, please clear your plugin cache before testing your site. This can cause the changes to not take place on the front end. It will eventually show up when the cache regenerates, but it’s not ideal if you’re looking to see your changes immediately. Caching plugins are best to turn on only when you’ve finished building the site.

    Please let us know how it goes.

    #1012273
    tahaabbasi
    Participant

    It worked! thank you so much!

    #1012364
    Prasant Rai
    Moderator

    You are most welcome. 🙂

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