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!
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.
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:
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:
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.
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!
We can implement this for you by additional customization. Provide us with Dashboard and FTP access to your site.
Great, thank you so much!!
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.
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!
Can’t promise but we’ll discuss this feature with developers.
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!
Provide us with Dashboard and FTP access to your site. We’ll try to help you.
perfect, thank you.
Please find all information in private content.
Please check now.
Changes were done in 2 files – royal/woocommerce/content-product-slider.php and
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!
I’ve sent your request to our developers and hope this functionality will be added. But I can’t give a guaranty, unfortunately.
You must be logged in to reply to this topic.Log in/Sign up
One standard license is valid only for 1 project. Running multiple projects on a single license is a copyright violation.
The message was successfully sent
Your shopping cart is empty