Display Featured Products on ‘Page Not Found’ page in Zen Cart


Showcasing a representation of your store’s products on the ‘Page Not Found’ page can save a visitor from doing a quick u-turn away from your site, instead inviting them into your store to explore further.

To display your featured products 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:
    <div id="pageNotFoundMainContent">
    <?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 call the Featured Products Center Box:
    <?php
    /**
     * display the Featured Products Center Box
     */
    ?>
    <?php require($template->get_template_dir('tpl_modules_featured_products.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_featured_products.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 the Featured Products center box:

Zen Cart Page Not Found page with product display

     
   
     

More Zen Cart:

  1. Display a Search Box on ‘Page Not Found’ page in Zen Cart
  2. Display Advanced Search on ‘Page Not Found’ page in Zen Cart
  3. Change the number of products displayed in the Featured Products centerbox in Zen Cart
  4. Set a sort order for the Featured Products Centerbox on Zen Cart Home Page
  5. What makes a great ‘Page Not Found’ 404 Error page for Ecommerce stores?
  1. No comments yet.
(will not be published)

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