Add custom header for checkout page in opencart

I want to add a custom header for my checkout page on opencart store. I have a website in an opencart store and I don't want to show the categories and search button on my checkout page as the user is already ready for the store, now they don't need the categories and the search button. So I think I can do this by making a copy of the header.tpl file and renaming it, and calling the variable on the checkout page as the previous php echo $ header with the new renamed file. but it shows an error if you tell me how to add a custom header for the checkout page.

+3


source to share


2 answers


Do not make any changes to the header.tpl file. Instead, write your own code to the checkout.tpl file in the template / checkout folder. Replace the $ header with your code.



+1


source


You are missing some steps, if you are doing how to make copies of header files then you need to make copies of all header related files.

Make a copy of header.tpl and make it headercopy.tpl, then make a copy of the /common/header.php controller in headercopy.php.

then change line 2 in headercopy.php

Controllercommonheader 

      

from



Controllercommonheadercopy

      

then call in checkout.php the following array

    $this->children = array( 'common/column_left', 
'common/column_right', 
'common/content_top', 
'common/content_bottom', 
'common/footer', 
'common/headercopy' );

      

and then in the call to the checkout.tpl file

<?php echo $headercopy; ?>

      

+1


source







All Articles