Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34
  1. #1
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Redirect discontinued items

    How do redirect discontinued items/products to a the domain index page? Or to make it display the products main category?
    Using Zen Cart 1.5.1

  2. #2
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: Redirect discontinued items

    Quote Originally Posted by Kevin205 View Post
    How do redirect discontinued items/products to a the domain index page? Or to make it display the products main category?
    I haven't gone through all the necessary (potentially necessary) settings, but in the admin panel, configuration, my store, missing page check. If you set it to on, then pages that do not exist will redirect to the main page.

    I thought there was something/somewhere else to also check, but that should get you started.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Redirect discontinued items

    Quote Originally Posted by mc12345678 View Post
    I haven't gone through all the necessary (potentially necessary) settings, but in the admin panel, configuration, my store, missing page check. If you set it to on, then pages that do not exist will redirect to the main page.

    I thought there was something/somewhere else to also check, but that should get you started.
    Thanks for the reply.

    I never knew that option existed!

    For testing purposes when I set the Products Status: to Out of Stock, regardless of what I choose, On, Off or Page Not Found option from Admin>Configuration>My Store
    Default=On
    On = Send missing pages to 'index'
    Off = Don't check for missing pages
    Page Not Found = display the Page-Not-Found page

    It displays the Home>Category>Sub-Category breadcrumb navigation, up to the sub-category where the product was.
    and it displays the following right after the breadcrumb (on the next line)
    Sorry, the product was not found.

    Any ideas why it's not being re-directed to the index page?
    Using Zen Cart 1.5.1

  4. #4
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Redirect discontinued items

    I'm not sure if it's exactly your problem, but I don't believe that setting the product status to Out Of Stock (or setting the product quantity to 0) removes the remaining products from stock. I think the only way to remove the last one of a product from inventory is to have it go through the checkout process.

  5. #5
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Redirect discontinued items

    You're merging two separate code issues here

    1 - missing 'pages'

    2 - missing 'products'

    What you want is to return to the index when the product query fails to return a product. It is NOT failing to return a page.

    Here's what is happening when the message 'Sorry, the product was not found.' displays:

    includes/modules/pages/product_info/main_template_vars.php
    will run this code:
    if ( $res->fields['total'] < 1 ) {

    $tpl_page_body = '/tpl_product_info_noproduct.php';

    } else {

    $tpl_page_body = '/tpl_product_info_display.php';


    which then publishes this page:
    includes/templates/YOUR_TEMPLATE/templates/tpl_product_info_noproduct.php

    with the message on it.


    Change the noproduct page to the index page for each of your product types if applicable.
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base7 with Wholesale PRO - 88 preinstalled plugins zero errors.

  6. #6
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Redirect discontinued items

    Quote Originally Posted by stevesh View Post
    I'm not sure if it's exactly your problem, but I don't believe that setting the product status to Out Of Stock (or setting the product quantity to 0) removes the remaining products from stock. I think the only way to remove the last one of a product from inventory is to have it go through the checkout process.
    Hi Steve, you are correct.

    I manually set the Quantity to 0 and Products Status: to Out of Stock.

    It still displays as explained in post#3

    Going and manually checkout products, one at a time?

    Is there another solution for this? To redirect discontinued products to the index?
    Using Zen Cart 1.5.1

  7. #7
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Redirect discontinued items

    The easy way would be to do it in the database, but I'm not SQL expert enough to write the patch. I suspect twitchtoo is.

  8. #8
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Redirect discontinued items

    Quote Originally Posted by twitchtoo View Post
    You're merging two separate code issues here

    1 - missing 'pages'

    2 - missing 'products'

    What you want is to return to the index when the product query fails to return a product. It is NOT failing to return a page.

    Here's what is happening when the message 'Sorry, the product was not found.' displays:

    includes/modules/pages/product_info/main_template_vars.php
    will run this code:
    if ( $res->fields['total'] < 1 ) {

    $tpl_page_body = '/tpl_product_info_noproduct.php';

    } else {

    $tpl_page_body = '/tpl_product_info_display.php';


    which then publishes this page:
    includes/templates/YOUR_TEMPLATE/templates/tpl_product_info_noproduct.php

    with the message on it.


    Change the noproduct page to the index page for each of your product types if applicable.
    Thank you twitchtoo for the reply,

    I tried your solution, replacing tpl_product_info_noproduct.php with the following files:
    includes/templates/MyTemplate/templates/tpl_index_default.php
    Stopped displaying page info, including navigation breadcrumbs. Showing a blank center page. With the following error:
    [26-Dec-2013 11:04:23 America] PHP Warning: require(): Filename cannot be empty in /public_html/includes/templates/MyTemplate/templates/tpl_index_default.php on line 40
    [26-Dec-2013 11:04:23 America] PHP Fatal error: require(): Failed opening required '' (include_path='.:/usr/php/54/usr/lib64:/usr/php/54/usr/share/pear') in /public_html/includes/templates/MyTemplate/templates/tpl_index_default.php on line 400
    includes/templates/MyTemplate/templates/tpl_index_product_list.php
    Displays the following warning after the nav breadcrumbs:
    WARNING: An Error occurred, please refresh the page and try again.
    Stopped displaying the rest of the page. Showing a blank center page. With the following error:
    [26-Dec-2013 11:02:16 America] PHP Fatal error: 1065:Query was empty :: in /public_html/includes/classes/db/mysql/query_factory.php on line 120
    includes/templates/MyTemplate/templates/tpl_index_categories.php
    Replacing the above file works , displaying the navigation breadcrumbs and sub-category name only, plus all other page information, all the the way down to the footer.

    But when I change the URI to
    http: // Domain.com /index.php?main_page=product_info&cPath=2_5&products_id=320132, id= 320132 a random number, no product in the database. It changes the URI to
    http: // Domain.com /index.php?main_page=product_info&products_id=320132, genrating the following error
    [26-Dec-2013 11:19:07 America] PHP Fatal error: Call to a member function RecordCount() on a non-object in /public_html/includes/modules/category_row.php on line 18

    Thank you.
    Last edited by Kevin205; 26 Dec 2013 at 08:32 PM.
    Using Zen Cart 1.5.1

  9. #9
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Redirect discontinued items

    Quote Originally Posted by stevesh View Post
    The easy way would be to do it in the database, but I'm not SQL expert enough to write the patch. I suspect twitchtoo is.
    Me neither.

    But this is a huge issue for discontinued items, that are already bookmarked by site customers and indexed by search engines!
    Using Zen Cart 1.5.1

  10. #10
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Redirect discontinued items

    Kevin205, you're saying that you replaced the noproducts page with tpl_index_categories.php and it worked - correct?

    Now you're asking to troubleshoot URI mapping issues?
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base7 with Wholesale PRO - 88 preinstalled plugins zero errors.

 

 
Page 1 of 4 123 ... LastLast

Similar Threads

  1. v153 Flag discontinued products
    By fahadali in forum Customization from the Admin
    Replies: 16
    Last Post: 18 Mar 2016, 08:19 PM
  2. Redirect deleted, moved and discontinued products to the home page.
    By Podgeminster in forum General Questions
    Replies: 1
    Last Post: 15 Mar 2011, 02:11 AM
  3. Replies: 0
    Last Post: 8 Oct 2008, 03:58 PM

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