_Veronika_ Posted July 9, 2024 Share Posted July 9, 2024 Hi everyone I'm trying to make a code modification so that the brand images are also in webp format but I can't get it to work. The products are working fine as I have them configured but I haven't found a way to make it work for brands. Could someone guide me on how to do this? I haven't found an answer to this on the forum yet. Im using PS 8.1.5 Link to comment Share on other sites More sharing options...
Prestashop Addict Posted July 9, 2024 Share Posted July 9, 2024 If you activate webp for all images, it works perfectly. The filename as .jpg extension but if you see its properties in Firefox CRT+i tab Medias you'll see it is in webp format Link to comment Share on other sites More sharing options...
_Veronika_ Posted July 9, 2024 Author Share Posted July 9, 2024 Hi @Prestashop Addict If I open webmasters tools and I change in elements the format of the file .jpg to .webp I can see the logo in the format .webp, but the code of the file is not setted to show the new format webp. I show you the code by default in miniatures/brand.tpl {block name='brand_miniature_item'} <li class="brand"> <div class="brand-img"><a href="{$brand.url}"><img src="{$brand.image}" alt="{$brand.name}" loading="lazy"></a></div> <div class="brand-infos"> <p><a href="{$brand.url}">{$brand.name}</a></p> {$brand.text nofilter} </div> but miniatures/category.tpl show the webp with this code by default {block name='category_miniature_item'} <section class="category-miniature"> <a href="{$category.url}"> <picture> {if !empty($category.image.medium.sources.avif)}<source srcset="{$category.image.medium.sources.avif}" type="image/avif">{/if} {if !empty($category.image.medium.sources.webp)}<source srcset="{$category.image.medium.sources.webp}" type="image/webp">{/if} <img src="{$category.image.medium.url}" alt="{if !empty($category.image.legend)}{$category.image.legend}{else}{$category.name}{/if}" loading="lazy" width="250" height="250" > </picture> </a> this works perfect for the categories but I cant do it work in the brands Link to comment Share on other sites More sharing options...
_Veronika_ Posted July 10, 2024 Author Share Posted July 10, 2024 Im checking in Chrome because I dont use Firefox and in sources tab all images I can see are .jpg (2-small_default.jpg, 3-small_default.jpg...) No .webp for brand logos or in brand pages, Im using Prestashop 8.1.5 and theme Classic 2.1.3 (the last version) Link to comment Share on other sites More sharing options...
Prestashop Addict Posted July 10, 2024 Share Posted July 10, 2024 You can use this extension to image properties in Chrome Link to comment Share on other sites More sharing options...
_Veronika_ Posted July 10, 2024 Author Share Posted July 10, 2024 @Prestashop Addict Thanks for ur help, but still I have .jpg format in logos (checked with your extension). As I said I see the .webp in products and categories (everything fine) but the problem is in brands logos (only in .jpg). I think this will be solved in PS9 but I wish dont have to wait for that. Thanks Link to comment Share on other sites More sharing options...
_Veronika_ Posted July 10, 2024 Author Share Posted July 10, 2024 (edited) Also I checked in my PS 8.1.7 (the last version) and the same, does not work for brand logos in webp Edited July 10, 2024 by _Veronika_ (see edit history) Link to comment Share on other sites More sharing options...
Prestashop Addict Posted July 10, 2024 Share Posted July 10, 2024 As you can see the filename extension is .jpg but the file is in webp format Link to comment Share on other sites More sharing options...
_Veronika_ Posted July 10, 2024 Author Share Posted July 10, 2024 Such a mystery Link to comment Share on other sites More sharing options...
Prestashop Addict Posted July 10, 2024 Share Posted July 10, 2024 In image settings did your force webp or just if source is webp? If no your original file must be in webp. Link to comment Share on other sites More sharing options...
_Veronika_ Posted July 10, 2024 Author Share Posted July 10, 2024 Here my screen is different: Link to comment Share on other sites More sharing options...
Prestashop Addict Posted July 10, 2024 Share Posted July 10, 2024 This is an experimental feature 😞 Don't activate it in production 😉 Link to comment Share on other sites More sharing options...
_Veronika_ Posted July 10, 2024 Author Share Posted July 10, 2024 I know it, but the other option (default setting) dont work to me. I dont have product nor categories in webp if I dont use the experimental Link to comment Share on other sites More sharing options...
_Veronika_ Posted July 10, 2024 Author Share Posted July 10, 2024 Maybe it is the configuration in my server. Do you use some special configuration to show webp? Link to comment Share on other sites More sharing options...
Prestashop Addict Posted July 10, 2024 Share Posted July 10, 2024 (edited) il y a 38 minutes, _Veronika_ a dit : I know it, but the other option (default setting) dont work to me. I dont have product nor categories in webp if I dont use the experimental I dont' really undertand your issue, if you select as I explained Use webp for all images, any format uploaded will be converted to webp 🙂 Edited July 10, 2024 by Prestashop Addict (see edit history) Link to comment Share on other sites More sharing options...
_Veronika_ Posted July 23, 2024 Author Share Posted July 23, 2024 Hello @Prestashop Addict I told my server what is happening because I don't see the .webp format so I thought could be a problem with the configuration in the server. And what I have been told is that feature is not experimental for some versions ago, it is fully integrated as a new feature of Prestashop. And after this answer I looked at it and they are correct, the option I have activated is not experimental anymore. So this issue is resolved. But the main issue for which I opened this topic, how to put the pics of the brands on webp just like the photos of products and categories, is still open. Could anyone give me any idea how to do it? Thanks in advance Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now