Display a Search Box on ‘Page Not Found’ page in Zen Cart


It’s important to use the ‘Page Not Found’ page in Zen Cart as another selling page in Zen Cart.  It is much more than just an error message.  A Search Box is another option in your toolkit that can help increase the effectiveness of the ‘Page Not Found’ page.

To add the search box on the ‘Page Not Found’ page:

  1. Open the tpl_page_not_found_default.php file located in the includes/templates/template_default/templates/ directory.
  2. Find the section of code that calls the ‘page not found’ define text:
    <?php
    /**
     * require the html_define for the page_not_found page
     */
     require($define_page); ?>
    </div>
    <?php } ?>
  3. Immediately following, insert this block of code to include the Search box:
    <?php
    /**
    * display the Search Box
    */
    require(DIR_WS_MODULES . 'sideboxes/search_header.php');
    ?>
  4. Save the modified tpl_page_not_found_default.php file to your override folder.  This will be includes/templates/CUSTOM/templates/ where CUSTOM represents the name of your current template folder.

So, instead of this:

Zen Cart 'Page Not Found' page

the Zen Cart ‘Page Not Found’ page now also includes a Search box:

Search box on page not found in Zen Cart

     
   
     

More Zen Cart:

  1. Display Advanced Search on ‘Page Not Found’ page in Zen Cart
  2. Display Featured Products on ‘Page Not Found’ page in Zen Cart
  3. What makes a great ‘Page Not Found’ 404 Error page for Ecommerce stores?
  4. How does Zen Cart handle a ‘Page Not Found’?
  5. Change the Search Header in Zen Cart
  1. No comments yet.
(will not be published)

Notify me of followup comments via e-mail. You can also subscribe without commenting.