metta Posted February 1, 2010 Share Posted February 1, 2010 I want to use two headers. I use the following codes in the header.php just before the smart assign: if ($_GET['id_category'] == 13 OR $_GET['id_category'] == 14 $smarty->display(_PS_THEME_DIR_.'header-gproduct.tpl'); else It works perfectly. How can I add if it is gshipping.php it will use the header.gproduct.tpl?I used f ($_GET['id_category'] == 13 OR $_GET['id_category'] == 14 OR $page_name == 'gshipping.php' $smarty->display(_PS_THEME_DIR_.'header-gproduct.tpl'); else It doesn't work. Can someone check my codes see if there is a problem? Thank you very much. Link to comment Share on other sites More sharing options...
Burhan BVK Posted February 1, 2010 Share Posted February 1, 2010 Try using strpos. if ($_GET['id_category'] == 13 OR $_GET['id_category'] == 14 OR strpos($page_name, 'gshipping.php') $smarty->display(_PS_THEME_DIR_.'header-gproduct.tpl'); else This should work as long as 'gshipping.php' is in the page_name, with extra characters like '/', '?' etc. Link to comment Share on other sites More sharing options...
metta Posted February 1, 2010 Author Share Posted February 1, 2010 Try using strpos. if ($_GET['id_category'] == 13 OR $_GET['id_category'] == 14 OR strpos($page_name, 'gshipping.php') $smarty->display(_PS_THEME_DIR_.'header-gproduct.tpl'); else This should work as long as 'gshipping.php' is in the page_name, with extra characters like '/', '?' etc. Sorry, it doesn't work. My gshipping.php is in the root. It is not a cms page, it is a page that I made. After I used the codes your provided, it is still capture the default header. :red: Link to comment Share on other sites More sharing options...
Burhan BVK Posted February 1, 2010 Share Posted February 1, 2010 Instead of 'gshipping.php', you should use 'gshipping' only.Another way is to define a variable in your gshipping.php file and check for that variable instead of the page_name. Link to comment Share on other sites More sharing options...
metta Posted February 1, 2010 Author Share Posted February 1, 2010 I used the following and it works f ($_GET['id_category'] == 13 OR $_GET['id_category'] == 14 OR $page_name == 'gshipping' $smarty->display(_PS_THEME_DIR_.'header-gproduct.tpl'); else Thanks Link to comment Share on other sites More sharing options...
Recommended Posts