swifftyb Posted April 29, 2012 Share Posted April 29, 2012 Hi all. Can anyone point me in the right direction as to how i can change my logo from a .jpg image to a .png image. I have already uploaded a png version but i cant locate the file where i need to change the code?? My website is: http://www.thekingsunit.co.uk Thanks! Link to comment Share on other sites More sharing options...
hxd Posted April 29, 2012 Share Posted April 29, 2012 Well, it seems an easier solution just to rename your image from logo.png to logo.jpg for example, but if you want to change the code you can do it by modifying the header.tpl file of the theme that you use. The path to the file would be root/themes/mobile_evolution/header.tpl. Then in that file find the following code: <a id="header_logo" href="{$link->getPageLink('index.php')}" title="{$shop_name|escape:'htmlall':'UTF-8'}"> <img class="logo" src="{$img_ps_dir}logo.jpg?{$img_update_time}" alt="{$shop_name|escape:'htmlall':'UTF-8'}" {if $logo_image_width}width="{$logo_image_width}"{/if} {if $logo_image_height}height="{$logo_image_height}" {/if} /> </a> and change logo.jpg with logo.png. When you edit template files, in order to be able to see the change on the frontend, you have to enable the Force Compile option. You can do this from the back office>Preferences tab>Performance sub-tab. After you're done disable it because otherwise it will slow down your site considerably. Hope this helps. 1 Link to comment Share on other sites More sharing options...
Bill Dalton Posted April 29, 2012 Share Posted April 29, 2012 You can enable PNG in Admin > Preferences > Images Link to comment Share on other sites More sharing options...
deroxonweb Posted September 12, 2012 Share Posted September 12, 2012 I changed the jpg to png in the header.tpl file, but the logo becomes disappeared. Nothing is showing at the website. Please give me a hand. Thank you very much. I am using PS1.4.8.3. Link to comment Share on other sites More sharing options...
hxd Posted September 12, 2012 Share Posted September 12, 2012 Check the file on your account and make sure its name is logo.png and not logo.jpg. Link to comment Share on other sites More sharing options...
NichoTL Posted November 26, 2012 Share Posted November 26, 2012 There is no need to go and change the .tpl file. Once you have enabled in the prefs that .png can be used (middle option: use PNG only if etc... ), just go to the first tab in the prefs and upload your png. The thing is, even when you have done this, the html generated will still refer to a JPG. Strange eh? The fact is, it doesn't matter. If you check with FTP in the img folder on the server, you will see that the logo.jpg was recently updated. Prestashop uploaded the png and renamed it logo.jpg. The extension of the file itself doesn't matter. Just clear the cache in your browser and it should work! Link to comment Share on other sites More sharing options...
Zulian Posted November 29, 2012 Share Posted November 29, 2012 (edited) Hello, I worked on this problem : Prestashop doesn't allow to upload png files for logos, even if you enable png in "preferences -> images". So i made an override to cross over this limit. I propose it to you. Enjoy ! AdminThemesController.php Edited November 29, 2012 by Zulian (see edit history) Link to comment Share on other sites More sharing options...
NichoTL Posted November 29, 2012 Share Posted November 29, 2012 (edited) I haven't checked your php, but you misunderstood me: if you check on the server with a ftp client the logo.jpg file before and after you upload the .png via the admin control panel, you will see that instead of having the filesize of the .jpg you had before, you will get the filesize of the .png. What I am saying is that it is still a file called logo.jpg, but it actually CONTAINS a .png. And I can assure you that it is rendered as .png (with transparency!!!) on Prestashop. So yes, the feature works. Edited November 29, 2012 by NichoTL (see edit history) Link to comment Share on other sites More sharing options...
Zulian Posted November 29, 2012 Share Posted November 29, 2012 When you save the logo.png, the AdminThemeController change the extension to .jpg. My override allow the png... For me it's running fine. I reupload the file, because I add a modification. Link to comment Share on other sites More sharing options...
NichoTL Posted November 29, 2012 Share Posted November 29, 2012 You are right. And I haven't checked your php but I am convinced that it does what you say it does. BUT you are not listening! It is not needed! Just because it changes the extension from logo.png to logo.jpg, it doesn't mean that the file becomes a PNG. It's just an file extension! The file is still a PNG. And is still displayed as a PNG even if its name is .jpg. The file logo.jpg on the server is just a container that can hold a JPG AS WELL AS a PNG. And a PNG contained in logo.jpg will be rendered as a PNG, not a JPG. With transparency. Link to comment Share on other sites More sharing options...
Zulian Posted November 29, 2012 Share Posted November 29, 2012 O my god, shit, you 're right, i loosed my time X) My code will be cool for people who prefer see png, when it is a png ^^ Link to comment Share on other sites More sharing options...
NichoTL Posted November 29, 2012 Share Posted November 29, 2012 You didn't lose your time: see it as php-language practice. Can't be bad, can it? Link to comment Share on other sites More sharing options...
Zulian Posted November 29, 2012 Share Posted November 29, 2012 Sure, but is'nt very hard code Link to comment Share on other sites More sharing options...
Recommended Posts