Zen Cart Logo
Forums / General Questions / Redirect discontinued items

Redirect discontinued items

Views: 4,926

Results 21 to 34 of 34
27 Dec 2013, 7:06 PM
#21
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Redirect discontinued items

You're welcome.

I agree it is a nice car, that's why I bought one in the summer :)

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

28 Dec 2013, 3:44 PM
#22
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Redirect discontinued items

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:
Attachment 13604
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.

I like this.. much more intuitive for site visitors than the lone "product not found" message.. Couple of additional things I am going to do for my clients is to add a nice image to this page and possibly a list of the product categories too (like from the stock Zen Cart sitemap).. For my clients who use the cross sell module, I'm gonna see if I can get the cross sell code to display as well..

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.

28 Dec 2013, 4:33 PM
#23
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Redirect discontinued items

It's relatively easy to add the cross sell code block here and ensure all it's variable wants and needs are met... or the default zen new products, featured products etc.

There really should be some sort of eye candy from a marketing point as the customer's feeling of loss should be addressed here.

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

28 Dec 2013, 4:52 PM
#24
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Redirect discontinued items

twitchtoo:

It's relatively easy to add the cross sell code block here and ensure all it's variable wants and needs are met... or the default zen new products, featured products etc.The new, specials and featured products appear to already be included on this page which is what made me think to include cross sell..

twitchtoo:

There really should be some sort of eye candy from a marketing point as the customer's feeling of loss should be addressed here.I agree.. This post has inspired me.. Gonna be working on this for my clients..

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.

28 Dec 2013, 4:59 PM
#25
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Redirect discontinued items

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.

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

28 Dec 2013, 5:20 PM
#26
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Redirect discontinued items

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.

I do understand that.. my point was that there is code available for the new, specials, and featured products.. 'tis all :smile:

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.

28 Dec 2013, 5:35 PM
#27
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Redirect discontinued items

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:

I do understand that.. my point was that there is code available for the new, specials, and featured products.. 'tis all :smile:

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....

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.

28 Dec 2013, 5:48 PM
#28
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Re: Redirect discontinued items

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

It doesn't appear to be working though.. (just tried turning it on on my test site..) Hmmmmmmm....

It doesn't function for me either.

Using Zen Cart 1.5.1

28 Dec 2013, 5:49 PM
#29
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Redirect discontinued items

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

It doesn't appear to be working though.. (just tried turning it on on my test site..) Hmmmmmmm....

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.

28 Dec 2013, 5:58 PM
#30
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Re: Redirect discontinued items

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 } ?>

Nice DivaVocals.  Perfect.

Using Zen Cart 1.5.1

28 Dec 2013, 6:10 PM
#31
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Redirect discontinued items

Kevin205:

Nice DivaVocals. Perfect.

Ha! Thanks..:laugh: it looks like this is a pretty old Zen Cart page that hasn't been updated in sometime.. Gonna report this one as a bug to the Zen Cart admins..

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.

28 Dec 2013, 6:16 PM
#32
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Re: Redirect discontinued items

DivaVocals:

Ha! Thanks..:laugh: it looks like this is a pretty old Zen Cart page that hasn't been updated in sometime.. Gonna report this one as a bug to the Zen Cart admins..

Thank you.

Using Zen Cart 1.5.1

28 Dec 2013, 6:19 PM
#33
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Redirect discontinued items

Kevin205:

Thank you.

Bug report done..

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.

28 Dec 2013, 9:53 PM
#34
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Redirect discontinued items

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.

  1. Missing echo that causes the "Continue" button not to be displayed.
  2. 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:
Attachment 13604
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.