The Dead Man
The Dead Man

Reputation: 5576

How to remove header and footer from specific pages?

I have a prestashop website where I have header for whole page

I want header or footer to be hidden in a specific page eg shopping-cart

Here is my shopping cart page link http://localhost:8080/index.php?controller=order-opc#box-order-one

Here is how I tried to hide header inside shopping-cart.tpl

{if $page_name != 'box-order-one'}<div class="nav-tabs"></div>{/if}

But this does not work, what do I need to do to get what I want?

Upvotes: 0

Views: 2257

Answers (2)

Alexander Grosul
Alexander Grosul

Reputation: 1814

You can wrap your content which you want to exclude into the condition

{if isset($page_name) && !$page_name|in_array:['order', 'authentication', 'address']}
    // the code you want to exclude
{/if}

inside in_array function list all pages on which the code will be excluded. Be sure that you use the correct name of pages, you can check it out within dev tools. Look what id a page has on a current page and use it.

Upvotes: 1

Rolige
Rolige

Reputation: 948

The easy and fast way is through CSS.

For PS 1.6 (default theme):

body#order .header-container,
body#order .footer-container,
body#order-opc .header-container,
body#order-opc .footer-container {
  display: none !important;
}

For PS 1.7 (default theme):

body#checkout #header,
body#checkout #footer {
  display: none !important;
}

Upvotes: 1

Related Questions