Vinibch Posted December 6, 2020 Share Posted December 6, 2020 (edited) Hello, I am in the process of integrating webp everywhere on my prestashop from a personalized folder. However, I have a problem with a variable. Access folder : webp / sc / ($subcategory.id or $subcategory.id_category)_cover.webp. Example file name: 1_cover.webp) Access to the image is denied. the loaded image is always in jpg format. {if $subcategory.image} {assign var="webp" value="webp/sc/{$subcategory.id_category}_cover.webp"} {if file_exists($webp)} <img data-src="{$urls.base_url}webp/sc/{$subcategory.id_category}_cover.webp" alt="{if !empty($subcategory.image.legend)}{$subcategory.image.legend}{else} {$subcategory.name}{/if}" type="image/webp" class="lazyload" > {else} <img data-src="{$subcategory.image.bySize.subcategory_product.url}" alt="{if !empty($subcategory.image.legend)}{$subcategory.image.legend}{else} {$subcategory.name}{/if}" class="lazyload"> {/if} {else} <img class="lazyload" src="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="> {/if} Edited December 6, 2020 by [email protected] (see edit history) 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