Prestashop: If page = home


Conditional simple to use within “.tpl” of our theme to validate whether we are in the index or home page. We use the variable “$page_name” to find out the name of the current page.

Example, in the header.tpl:

 {if $page_name == ‘index’}
<div class=”home”>
{else}
<div>
{/if}

How to remove security reasons Error in Prestashop


For security reasons, you cannot connect to the Back Office until after you have:

– delete the /install folder
– renamed the /admin folder (eg. /admin318)

Yes, you read it right, just after you successfully installed Prestashop 1.4.3 and when you try logging into your admin panel to do some, well administrative tasks for your e-store, it will present you the following error message:

“For security reasons, you cannot connect to the Back Office until after you have:
– deleted the /install folder
– renamed the /admin folder (eg. /admin302)
Please then access this page by the new url (eg. http://www.domain.tld/admin302)”

First, we will delete the “install” folder just what the message told us.

Next on the renaming folder, what i did is a different route. Open the file /admin/login.php where is the full path where you installed prestashop.

At around line 147, look for the code :

if(file_exists(PS_ADMIN_DIR.’/../install’)) OR file_exists(PS_ADMIN_DIR.’/../admin’))

and replace it with

if(file_exists(PS_ADMIN_DIR.’/../install’))

then you can updated file and refesh admin
Thanks