Tiago Posted September 28, 2018 Share Posted September 28, 2018 Olá Pessoal! Tenho uma imagem de sub-categoria com as dimensões de 870x194px, para aparecer no topo quando entro em uma sub-categoria: http://prntscr.com/kzu143 Quando insiro esta imagem, cria automaticamente a miniatura de categoria, redimensionando a imagem de 870x194px para 125x125px. Mas eu não quero que seja adicionada automaticamente, e acabo por selecionar a imagem que quero com 125x125px, para a miniatura de categoria, como está neste exemplo: http://prntscr.com/kzu2pm A questão é que no FrontEnd, quando vou aceder ás categorias, a imagem de miniatura que é carregada é a "medium_default" (que tem a imagem 870x194px redimensionada) e não a "Thumb" (imagem correcta com 125x125px). Como posso definir para chamar a imagem "thumb" e não a imagem "medium_default"? Já tentei altera o ficheiro category.tpl, colocando: <div class="subcategory-image"> <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}" title="{$subcategory.name|escape:'html':'UTF-8'}" class="img"> {if $subcategory.id_image} <img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, '_thumb')|escape:'html':'UTF-8'}" alt="{$subcategory.name|escape:'html':'UTF-8'}" /> {else} <img class="replace-2x" src="{$img_cat_dir}{$lang_iso}-default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {/if} </a> </div> Mas o link que retorna ao carregar as categorias é: https://site.pt/c/563-_thumb/xpto.jpg - e deveria ser: https://site.pt/img/c/563_thumb.jpg Será que alguém me consegue dar uma ajuda a resolver esta situação? Link to comment Share on other sites More sharing options...
Daniel - PrestaBR Posted October 4, 2018 Share Posted October 4, 2018 Presumindo que esteja utilizando o PrestaShop 1.6.x, normalmente o caminho é esse mesmo: Criar um novo tamanho de imagens na opção Preferências > Imagens e vinculá-lo às categorias. Em seguida trocar de um padrão existente no PrestaShop ('medium-default','125x125px') no arquivo correto do seu tema, por exemplo: {if $subcategory.id_image} <img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html':'UTF-8'}" alt="{$subcategory.name|escape:'html':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {else} <img class="replace-2x" src="{$img_cat_dir}{$lang_iso}-default-medium_default.jpg" alt="{$subcategory.name|escape:'html':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {/if} Para um padrão que você criou ou editou no PrestaShop ('thumb', '870x194px'): {if $subcategory.id_image} <img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'thumb')|escape:'html':'UTF-8'}" alt="{$subcategory.name|escape:'html':'UTF-8'}" width="870" height="194" /> {else} <img class="replace-2x" src="{$img_cat_dir}{$lang_iso}-default-thumb.jpg" alt="{$subcategory.name|escape:'html':'UTF-8'}" width="870" height="194" /> {/if} 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