Okay
  Public Ticket #703623
Different logo depending on page
Closed

Comments

  •  1
    Justin started the conversation

    Hi. 


    I want to have a different logo regarding the page I'm displaying.
    Basically, I need to have a blue logo on homepage and a white one on the other. 
    Is there an easy way to do that?

    Many thanks.

  •  1,593
    Criss replied

    Hi Justin,

    We're sorry but prestashop can't do it. you have to custom it by edit in hearder.tpl or find a module.

    Best Regards,
    Criss - FieldThemes

  •  1
    Justin replied

    I found out eventually. 
    I post the solution here if someone has the same concern. 

    If you want a different logo for your homepage :

    1- upload file in /img/  (logo-hp.png)

    2- Go to MySQL, in ps_configuration, copy PS_LOGO field, change PS_LOGO to PS_LOGO_HP and name of the logo by your new one.

    3- Go to classes/controller/FrontController.php.
       Copy the whole page then go to override/classes/controller and create a FrontController.php and paste everything.

    4- Go to line #1619 and add :

    $logo_hp = $this->context->link->getMediaLink (_PS_IMG_.Configuration::get('PS_LOGO_HP'));
    

    5- Below, you should see 

    'logo_url'          => $logo
    

    Change to 

    'logo_url'          => $logo,
    'logo_hp_url'       => $logo_hp
    

    6- Finally, go to /themes/newyork/header.tpl, line 114 and change 

    src="{logo_url}" 

    with :

    src="{if $page_name=="index"}{$logo_hp_url}{else}{$logo_url}{/if}"
    

    Hope it'll help someone.