Dynamic image dimensions for etheme_products

This topic has 16 replies, 3 voices, and was last updated 5 years, 1 months ago ago by Rose Tyler

  • Avatar: Royalty
    Royalty
    Participant
    May 4, 2018 at 18:36

    Hello,
    I am using the [etheme_products] shortcode for different purposes:
    1. A related product slider, where my images have a size of 420x420px
    2. A related colour slider, where my images have a size of 70x70px

    The slider scales down the images via css but for performance issues I would like to specify the image dimensions directly, so that it loads the 70x70px thumbnail instead of scaling down the bigger version.
    A perfect solution would be if I could enter the image size in the etheme_products settings (I mean the settings popup in Page builder) instead of always taking the same size for all sliders, no matter how many columns etc.

    Could you imagine to add this feature in an upcoming update or give me instructions how to do this now (I guess I have to edit shortcodes.php but have no idea what to do).

    Many thanks in advance!

    15 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 7, 2018 at 10:04

    Hello,

    Image size can be changed via Customize > Wocommerce > Product Images.
    Before 3.3 version WooCommerce had options for every type of image – single product, catalog and gallery image. In version 3.3 WC developers changed options and moved them to the Customizer. In version 3.3.3 they removed image settings at all even from customizer. We keep the previous version of their settings http://prntscr.com/ik093w But 8theme product widgets and gallery images use WP thumbnails size (Settings > Media) because WC customizer does not have the individual settings for this because of 3.3 update. So, if you don’t want to crop thumbnails images disable crop in WP settings and regenerate thumbnails.

    Regards

    Avatar: Royalty
    Royalty
    Participant
    May 7, 2018 at 11:06

    Dear Rose,
    thanks for your answer!
    Now I’m a bit confused. I tought that the 8theme product slider uses the shop catalog image size, as I found this code in content-product-slider.php:
    $thumbnail_image = wp_get_attachment_image_src( get_post_thumbnail_id(), apply_filters( 'single_product_archive_thumbnail_size', 'shop_catalog' ) );

    I have set the thumbnail width in customizer to 420px so that works fine for my shoppage and also for the related products slider. But for my related color slider, I only need the images in 70x70px. As said, the 420px images are scaled down to 70px, so it all looks good, but its not the best solution for performance. Thats why I suggested the possibility to set a custom image size for each slider.

    You have this settings popup:
    http://www.bilder-upload.eu/show.php?file=4a4982-1525687411.jpg

    And it would be great for performance, if there was the possibility to chose a custom image size (e.g. the thumbnail size I set under media > settings), like here in single image settings:
    http://www.bilder-upload.eu/show.php?file=298ae5-1525687629.jpg

    Kind regards!

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 7, 2018 at 13:09

    Dear @Royalty,

    Thanks for the reply. Unfortunately, there is no such possibility in our theme because we inherit the functionality of woocommerce. You may try to achieve the desired result via WC hooks that they offer https://github.com/woocommerce/woocommerce/wiki/Customizing-image-sizes-in-3.3 Please note that such changes are additional customization in source code and it is out of our support scope.

    Regards

    Avatar: Royalty
    Royalty
    Participant
    May 7, 2018 at 13:26

    Thank you, I just dont know how to tell 8theme slider which image size to select because I want to select different image sizes depending on the slider class. The best solution would be if I could use something like:
    “If the slider has the class .small-slider, then it should load the ‘thumbnail’ size and if no class is defined, it should load the ‘shop_catalog’ size”.
    Is this too complicated? Any help would be really appreciated!

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    May 7, 2018 at 14:28

    Hello,

    We can implement this for you by additional customization. Provide us with Dashboard and FTP access to your site.

    Regards

    Avatar: Royalty
    Royalty
    Participant
    May 7, 2018 at 14:45

    Great, thank you so much!!

    Please, contact administrator
    for this information.
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    May 8, 2018 at 16:29

    Hello,

    Check now, please.
    Changes were made in royal/framework/vc.php – http://prntscr.com/jf68we and royal-child/woocommerce/content-product-slider.php – http://prntscr.com/jf69mn
    Keep vc.php file in safe during next theme update.

    Also, regenerate thumbnails once you change the size to apply changes.

    Regards

    Avatar: Royalty
    Royalty
    Participant
    May 8, 2018 at 16:57

    WOW YOU ARE SOOOO GREAT!!!!
    Thank you so much!!!
    Could you imagine to include this for the future? I think it would be a nice feature and a plus for performance!
    Kind regards

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    May 10, 2018 at 11:00

    Hello,

    Can’t promise but we’ll discuss this feature with developers.

    Regards

    Avatar: Royalty
    Royalty
    Participant
    October 31, 2019 at 20:23

    I am trying to adapt this to the current version of Royal, but in the meantime, there were so many changes in code that I can not replicate it.
    Could you please help me? That would be sooooo great.
    Thank you very much and best wishes from Germany!

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    November 2, 2019 at 19:55

    Hello,

    Provide us with Dashboard and FTP access to your site. We’ll try to help you.

    Regards

    Avatar: Royalty
    Royalty
    Participant
    November 6, 2019 at 19:35

    Hi Olga,
    perfect, thank you.
    Please find all information in private content.

    Please contact administrator
    for this information.
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    November 8, 2019 at 08:00

    Hello,

    Please check now.
    Changes were done in 2 files – royal/woocommerce/content-product-slider.php and
    royal-core/inc/shortcodes/etheme_products.php

    Regards

    Avatar: Royalty
    Royalty
    Participant
    November 8, 2019 at 11:51

    THIS IS PERFECT – THANK YOU SO MUCH!!
    It would be even more perfect if you could add this in future updates, I think it would be a good thing for performance purposes.
    Thanks again for your outstanding support!

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    November 8, 2019 at 16:28

    Hello,

    You’re welcome!
    I’ve sent your request to our developers and hope this functionality will be added. But I can’t give a guaranty, unfortunately.

    Regards

  • Viewing 16 results - 1 through 16 (of 16 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.