Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,478
    Plugin Contributions
    88

    Default Product not found (tpl_product_info_noproduct.php) a

    Running "vanilla" v1.3.9f, installed with the demo products. I clicked on a product to bring up a product_info page and then modified the url so that the product_id was 1111 (an invalid id) and pressed Enter.

    That brought up a page that read "Sorry, the product was not found." ... no button, no other stuff.

    Looking through the tpl_product_info_noproduct.php file (and the demo database), the above text "should" have been followed by a Continue button, and new/featured/upcoming/specials listings, but that was not the case.

    This is also the case with the 8/2 1.5.0 Beta.

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,478
    Plugin Contributions
    88

    Default Re: Product not found (tpl_product_info_noproduct.php) anomaly?

    OK, it looks like the culprit is /includes/templates/template_default/templates/tpl_product_info_noproduct.php. Here's an updated version that properly shows the new/featured/specials/upcoming if enabled:

    Code:
    <?php
    /**
     * Page Template
     *
     * Displays simple "product not found" message if the selected product's details cannot be located in the database
     *
     * @package templateSystem
     * @copyright Copyright 2003-2005 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: tpl_product_info_noproduct.php 2578 2005-12-15 19:31:34Z drbyte $
     */
    ?>
    <div class="centerColumn" id="productInfoNoProduct">
    
    <div id="productInfoNoProductMainContent" class="content"><?php echo TEXT_PRODUCT_NOT_FOUND; ?></div>
    
    <div class="buttonRow back"><?php zen_back_link() . zen_image_button(BUTTON_IMAGE_CONTINUE, BUTTON_CONTINUE_ALT) . '</a>'; ?></div>
    
    <?php
    //// bof: missing
    $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_MISSING);
    
    while (!$show_display_category->EOF) {
    ?>
    
    <?php
      if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MISSING_FEATURED_PRODUCTS') {
    /**
     * display the featured product center box
     */
    //    include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_FEATURED_PRODUCTS_MODULE));
        require($template->get_template_dir('tpl_modules_featured_products.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_featured_products.php');
      }
    ?>
    
    <?php
      if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MISSING_SPECIALS_PRODUCTS') {
    /**
     * display the special product center box
     */
    //    include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_SPECIALS_INDEX));
        require($template->get_template_dir('tpl_modules_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_specials_default.php');
      }
    ?>
    
    <?php
      if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MISSING_NEW_PRODUCTS') {
    /**
     * display the new product center box
     */
    //    include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_NEW_PRODUCTS));
        require($template->get_template_dir('tpl_modules_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_whats_new.php');
      }
    ?>
    
    <?php
      if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MISSING_UPCOMING') {
    /**
     * display the upcoming product center box
     */
        include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS));
      }
    ?>
    <?php
      $show_display_category->MoveNext();
    } //// eof: missing
    ?>
    </div>
    The issue was that the modules for the four keyed items don't all behave in a similar manner. The "upcoming" products module finishes by calling its associated template while the template for the other three items calls its associated module.

    Anyway, the fix was to load the template-module files for new, featured and specials to cause them to be viewed.

 

 

Similar Threads

  1. Replies: 2
    Last Post: 22 Apr 2013, 08:56 AM
  2. Replies: 3
    Last Post: 25 Nov 2012, 04:53 PM
  3. css sheet for tpl_product_info_noproduct.php
    By Andy_GS in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 22 Oct 2009, 09:27 PM
  4. admin/product.php not found
    By RobbieB in forum Installing on a Linux/Unix Server
    Replies: 9
    Last Post: 5 Aug 2008, 12:43 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR