Viewing 25 posts - 1 through 25 (of 25 total)
  • Author
    Posts
  • #1098028

    Hi Ismael,
    this is the requested new topic based on #1097928.
    I added the code you sent yesterday and it broke my site. I put in the complete child theme functions.php in the private area below. It was impossible to add to add the concerning snippet
    add_filter( 'wp_calculate_image_srcset', 'av_disable_srcset' );
    function av_disable_srcset( $sources ) {
    return false;
    }
    via the WP-Backend, so I had to use FTP. After saving the file the site broke.

    Earlier in march / april someone recommended:
    add_filter( ‘avf_modify_thumb_size’, ‘enfold_customization_modify_thumb_size’, 10, 1 );
    function enfold_customization_modify_thumb_size( $size ) {
    $size[‘shop_catalog’] = array(‘width’=>200, ‘height’=>300);
    return $size;
    }
    but it failed as well.

    We also tried CSS in the quick css-container of enfold-child:
    $avia_config[‘imgSize’][‘shop_catalog’] = array(‘width’=>200, ‘height’=>300);
    Failed.

    I use to regenerate thumbnails each time after editing.

    Best regards, Joerg

    #1098774

    Hey brandgeist17,

    Thank you for creating another thread.

    What is the generated error when you add the code? It doesn’t create an error on our installation. Please copy that code directly from the forum and not from your email.

    Best regards,
    Ismael

    #1098803

    Hi Ismael,
    please see below in privat area the error by adding the code in the child theme functions.php via WP-Backend. By adding the same via FTP, the code is being accepted, but site and WP-Login brakes, white screen. The code is taken directly from Forum.
    Example product thumbnail regenerated: https://test.brandgeister.de/shop/luchs-harzer-kaffee-liqueur/
    best regards, joerg

    #1099600

    Hi,

    Can you please paste the code in a service like pastebin – this will help us see why the results are wrong.

    Best regards,
    Basilis

    #1099725

    Hi Basilius,
    here you are: https://pastebin.com/sUSVkWmS

    #1100010

    Hi again,
    I just had the same issue with another change of code in the functios-php. Seems as if any change to the file lets the site brake. Any idea, why?
    best regards, Joerg

    #1100136

    Hi,

    Thanks for the update.

    Can we access the file server? We would like to edit the file. Please post the WP and FTP details in the private field.

    Best regards,
    Ismael

    #1100177

    please see below

    #1100509

    Hi!

    Thanks for the update.

    We found the issue. Looks like woocommerce automatically switch the thumbnail to “woocommerce_thumbnail” instead of the thumbnail set in the template, which is “portfolio_small”. We have added this code in the functions.php file to adjust the size of the default thumbnail in the catalog page.

    add_filter( 'woocommerce_get_image_size_thumbnail', function( $size ) {
        return array(
            'width'  => 200,
            'height' => 300,
            'crop'   => 0,
        );
    } );
    

    We also created a new product just to confirm if it’s actually working. (see private field)

    IMPORTANT: You have to regenerate the thumbnails if you want all of your products to have the new thumbnail size.

    Regards,
    Ismael

    #1100590

    Hi,
    glad to hear that you found the reason and a way to repair this issue.
    Before implementing this in the Live-Page let me ask you, if it is normal resp. unavoidable that any thumbnail format is being affected by tis hook. The quality of catalogue-, product- and original pic (used for magnifying glass) got worse. Please see private data.
    best reagrds,
    Joerg

    #1100789

    Hey!

    Thanks for the update.

    The lost of image quality is expected because we are using a much smaller thumbnail. You have to increase the thumbnail size if you want to make the images sharper when resized.

    Best regards,
    Ismael

    #1102435

    Hi,
    but this defeats the purpose! Only the shop / catalogue thumb should be resized, not every picture, less than ever the product full sized picture.
    best regards,
    Joerg

    #1102878

    Hi brandgeist17,

    Please have a look at this thread if you want to disable image size generation
    https://kriesi.at/support/topic/how-to-disable-enfold-creating-media-image-sizes/

    Best regards,
    Victoria

    #1103016

    Hi Victoria,
    thank you for this info. I am not sure, if this is really similar to my problem. But, as I did not find the ‘shop_catalog’ thumbnail listed in what Enfold is adding to the hole thumbnail portfolio of woocommerce, I searched for it and found it in some woocommerce config.php
    For example:
    //product thumbnails
    $avia_config[‘imgSize’][‘shop_thumbnail’] = array(‘width’=>120, ‘height’=>120);
    $avia_config[‘imgSize’][‘shop_catalog’] = array(‘width’=>450, ‘height’=>450);
    $avia_config[‘imgSize’][‘shop_single’] = array(‘width’=>450, ‘height’=>999, ‘crop’ => false);

    To my mind, as a coding amateur, it would be logical to change this size into:
    $avia_config[‘imgSize’][‘shop_catalog’] = array(‘width’=>200, ‘height’=>300);

    How could one achieve this with a child theme?
    best regards,
    Joerg

    #1104269

    Hi,

    For easier solution, install a plugin called ” Simple Image Sizes ” and this will short your problems than waste time with code.

    Best regards,
    Basilis

    #1104291

    Hi,
    you are kidding, are you? One of the reasons for this thread lasting for weeks now is the fact that Simple Image size does not do what it should. Example from firefox inspector below.
    Regards, joerg

    #1104730

    Hi,

    Sorry for the confusion.

    Try to add a conditional function to the “woocommerce_get_image_size_thumbnail” filter.

    add_filter( 'woocommerce_get_image_size_thumbnail', function( $size ) {
        if( ! is_singular('product') ) {
            return array(
                'width'  => 200,
                'height' => 300,
                'crop'   => 0,
            );
        }
    
        return $size;
    } );

    This should only set the width to 200px on catalogue or product archive pages.

    Best regards,
    Ismael

    #1104777

    Hi Ismail,
    sounds good, but where should I add this? Put in the Child theme functions.php lets the site crash. Please see below.

    #1105432

    Hi,

    Thanks for the update.

    We added the code in the functions.php file and it seems to be working properly. The size of the product thumbnail in the catalogue page is 200x300px while retaining the actual thumbnail size in the single product pages.

    Best regards,
    Ismael

    #1110309

    Hi Ismael,
    sorry, but obviously not. Please see private.
    best regards jf

    #1112784

    Hi,

    You have to upload the product image again or regenerate the existing thumbnails. The product in the screenshot already exists before we did the modification. Did you check the dummy product that we added?

    Thank you for the update.

    Best regards,
    Ismael

    #1113619

    Hi,
    I cheked everything again and again. It’s true: the single product thumb now is not affected anymore and the shop thumb is. In this respect, the code seems to work. But not only the shop thumb format is smaller, the picture quality is worse, too. It seems to me if the picture’s width and height is not being scaled only, but same time the resolution is being reduced strongly. Kind of double effect. Maybe EWWW Optimizer interferes or strikes back. I don’t know.
    If this effect cannot be avoided, I will leave everything as it is.
    regards, joerg

    #1114798

    Hi,

    But not only the shop thumb format is smaller, the picture quality is worse

    Have you tried adjusting the width and height value inside the filter? That should improve the image quality. It might be actually good to double the size of the images (400x600px), so they still look good on screens with higher dpi, e.g devices with retina displays.

    Best regards,
    Ismael

    #1115251

    Hi, which of the 3 filter do you mean?

    add_filter( ‘wp_calculate_image_srcset’, ‘av_disable_srcset’ );
    function av_disable_srcset( $sources ) {
    return false;
    }

    add_filter( ‘avf_modify_thumb_size’, ‘enfold_customization_modify_thumb_size’, 10, 1 );
    function enfold_customization_modify_thumb_size( $size ) {
    $size[‘portfolio_small’] = array(‘width’=>200, ‘height’=>300);
    $size[‘shop_catalog’] = array(‘width’=>200, ‘height’=>300);
    return $size;
    }

    add_filter( ‘woocommerce_get_image_size_thumbnail’, function( $size ) {
    return array(
    ‘width’ => 200,
    ‘height’ => 300,
    ‘crop’ => 0,
    );
    } );

    #1115814

    Hi,

    I mean the filter named “woocommerce_get_image_size_thumbnail” or the last one.

    Best regards,
    Ismael

Viewing 25 posts - 1 through 25 (of 25 total)
  • You must be logged in to reply to this topic.