It appears that the changes suggested by both Twitch and myself are not necessary. The issues with /includes/templates/template_default/templates/tpl_product_info_noproduct.php have already been reported as a bug and addressed in v1.5.2 (thanks lat9!)
For folks following THIS discussion, you can refer to this thread for the proper corrections:
http://www.zen-cart.com/showthread.php?205859-*-Done-v1-6-0-Missing-echo-in-tpl_product_info_noproduct-php..
This thread addresses the two issues with the /includes/templates/template_default/templates/tpl_product_info_noproduct.php file.
- Missing echo that causes the "Continue" button not to be displayed.
- For each of the new/featured/special products modules, it's calling the module instead of the template so that nothing is ever output to the screen
=============================================
twitchtoo:
Here's what's happening...
Client:
Finds product T, likes product T, bookmarks product T
Admin:
No longer offers product T.
Client:
Wants to buy product T cause now they have the money!
If Admin 'disables' the product and has changed the noproduct.php to the index_categories.php...
It will revert back to the index or category landing page the product used to be in.
If Admin 'deletes' the product from the database...
Everything fails.
So, I put the noproduct.php back in and found that the message 'Sorry, the product was not found' will display properly. However the 'back' or 'continue' button does not display.
<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>
Meaning it's not coded correctly or it's not getting any data to 'go back' or 'continue' to which makes sense.
So, the alternate solution here would be to leave the message on the noproducts.php and add the code needed to go somewhere.
It would be clean, fast and prevent any future problems if any of the files involved were to be changed. It would also be consistent, regardless of a 'disabled' or 'deleted' product the redirect would return to a controlled location.
in includes/templates/YOUR_TEMPLATE/templates/tpl_product_info_noproduct.php
replace line 18:
<div class="buttonRow back"><?php zen_back_link() . zen_image_button(BUTTON_IMAGE_CONTINUE, BUTTON_CONTINUE_ALT) . '</a>'; ?></div>
with this:
<?php // Twitch No Product Continue to Index ?>
<div class="buttonRow back"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo zen_image_button(BUTTON_IMAGE_CONTINUE);?></a></div>
<!-- <div class="buttonRow back"><?php //zen_back_link() . zen_image_button(BUTTON_IMAGE_CONTINUE, BUTTON_CONTINUE_ALT) . '</a>'; ?></div>-->
it will look like this:

and clicking the continue button will take you home. The customer can read the message, understand why they can't see what they want and decide to move on or perhaps select a new category in the category sidebox.
twitchtoo:
DivaVocals, many shops shut those features off globally... perhaps it's time to create a master admin table for page by page inclusion of the various marketing tools.
DivaVocals:
It looks like there are admin configuration settings which allows one to turn this on/off specifically on the tpl_product_info_noproduct.php page
Index Listing > Show New Products on Main Page - Errors and Missing Product
Index Listing > Show Featured Products on Main Page - Errors and Missing Product
Index Listing > Show Featured Products on Main Page - Errors and Missing Product
Index Listing > Show Special Products on Main Page - Errors and Missing Product
Index Listing > Show Upcoming Products on Main Page - Errors and Missing Product
It doesn't appear to be working though.. (just tried turning it on on my test site..) Hmmmmmmm....
DivaVocals:
Now it works.. replaced lines 27-61 of the tpl_product_info_noproduct.php file with this code:
<?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MISSING_FEATURED_PRODUCTS') { ?>
<?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'); ?>
<?php } ?>
<?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MISSING_SPECIALS_PRODUCTS') { ?>
<?php
/**
* display the Special Products Center Box
*/
?>
<?php require($template->get_template_dir('tpl_modules_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_specials_default.php'); ?>
<?php } ?>
<?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MISSING_NEW_PRODUCTS') { ?>
<?php
/**
* display the New Products Center Box
*/
?>
<?php require($template->get_template_dir('tpl_modules_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_whats_new.php'); ?>
<?php } ?>
<?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MISSING_UPCOMING') { ?>
<?php
/**
* display the Upcoming Products Center Box
*/
?>
<?php include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS)); ?><?php } ?>
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.