How do redirect discontinued items/products to a the domain index page? Or to make it display the products main category?
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
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...
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
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.
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 Base8 - Obsidian - This, is what's new.
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
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.
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:
includes/templates/MyTemplate/templates/tpl_index_product_list.php[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
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:
includes/templates/MyTemplate/templates/tpl_index_categories.php[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
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
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 Base8 - Obsidian - This, is what's new.
Bookmarks