If this is your first visit, check our documentation. To post, register or login.
Forums / Search Engines / Sorry Product Not Found

Sorry Product Not Found

Started by soxophoneplayer on 21 Jun 2016, 5:44 PM · Views: 103

Results 1 to 8 of 8
21 Jun 2016, 5:44 PM
#1
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

Join Date:
Feb 2008
Posts:
534
Plugin Contributions:
0

Sorry Product Not Found

zc 1.5.5a, Responsive Sheffield Blue 2.0, many mods

The majority of my products are One of a Kind.

In my admin I have stock count enabled and a product is disabled if quantity is zero. If I have sufficient material to make a replacement, I will reuse the product page, updating images if necessary. But in many cases I am not able to recreate the product, and I delete the product page.

If a customer follows a bookmark or search result that is either at zero stock, or the page has been completely removed, they get the 'sorry not found'. To be fair, the continue button offers an opportunity to go to the main page, but its all pretty underwhelming to land on that page. I've edited the actual text of the message in the language file, but its still a weak spot IMO. Further, I wonder if all these no longer existing product pages are hurting me in the SEO department.

On my 404 page (which I've finally figured out how to enable after 8 years) I've got a custom message and the site map and hope to dress it up more soon, depending on what I do re the Sorry page.

Is there a way to direct a hit on a completely deleted page to the 404 instead of the Sorry Page, while having the zero stock pages get the Sorry Page.... or to send both cases to 404.

Or to create a stylized/dressed up replacement blurb for the Sorry message that would appear on the existing Sorry page.

And - is any one of these ideas better from SEO perspective than my current situation.

21 Jun 2016, 8:48 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Sorry Product Not Found

By landing on the sorry product does not exist page, a 404 is issued, so to that extent that is covered, whether it be your "redesigned" page or as provided.

As far as content/places to go from there, generally speaking sounds like you are on the right track. Customer lands there, and finds the product no longer available. Now what?!

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

22 Jun 2016, 11:46 AM
#3
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

Join Date:
Feb 2008
Posts:
534
Plugin Contributions:
0

Re: Sorry Product Not Found

mc12345678:

By landing on the sorry product does not exist page, a 404 is issued...

Thanks. Didn't know that.

Also hadn't realized still further sleuthing yesterday that I can put the new products, featured, specials and/or upcoming products on the Sorry page via admin index listing.That in itself makes the page less barren

22 Jun 2016, 11:57 AM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Sorry Product Not Found

soxophoneplayer:

Thanks. Didn't know that.

Also hadn't realized still further sleuthing yesterday that I can put the new products, featured, specials and/or upcoming products on the Sorry page via admin index listing.That in itself makes the page less barren

I should know the link by now, but there also is a minor correction to the includes/init_includes/init_sanitize.php to be made in earlier ZC versions where there is a check if the product_id exists and if it doesn't a zen_redirect is issued. That one particular redirect should be commented out because it issues a 302 before landing on the sorry page and issues a 404. (The existing code tells anything "listening" that the 404 is only temporary, by commenting out the redirect line, the 404 becomes more permanent.) at the moment, not sure if that "comment out" made it into 1.5.5a or a dated version of that or not. Sorry for not doing that extra leg work/knowing.

As to the display of those other options, a lot of people worked to make that possible and correct some template issues from older versions just so there would be something "native" to be displayed. :)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

22 Jun 2016, 12:54 PM
#5
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

Join Date:
Feb 2008
Posts:
534
Plugin Contributions:
0

Re: Sorry Product Not Found

 * We do some checks here to ensure $_GET['main_page'] has a sane value
 */
  if (!isset($_GET['main_page']) || !zen_not_null($_GET['main_page'])) $_GET['main_page'] = 'index';

  if (!is_dir(DIR_WS_MODULES .  'pages/' . $_GET['main_page'])) {
    if (MISSING_PAGE_CHECK == 'On' || MISSING_PAGE_CHECK == 'true') {
      $_GET['main_page'] = 'index';
    } elseif (MISSING_PAGE_CHECK == 'Page Not Found') {
      header('HTTP/1.1 404 Not Found');
      $_GET['main_page'] = FILENAME_PAGE_NOT_FOUND;
    }
  }
  $current_page = $_GET['main_page'];
  $current_page_base = $current_page;
  $code_page_directory = DIR_WS_MODULES . 'pages/' . $current_page_base;
  $page_directory = $code_page_directory;

includes/init_includes/init_sanitize has changed quite a bit since 1.3.9, but above section is the same other than 'FILENAME_PAGE_NOT_FOUND replacing 'page_not_found'.

Is this the part of the file of which you speak?

22 Jun 2016, 4:23 PM
#6
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Sorry Product Not Found

This: taken from ZC 1.5.4 was to what I was speaking:

 if (isset($_GET['products_id']) && isset($_SESSION['check_valid']) &&  $_SESSION['check_valid'] != 'false') {
    $check_valid = zen_products_id_valid($_GET['products_id']);
    if (!$check_valid) {
      $_GET['main_page'] = zen_get_info_page($_GET['products_id']);
      /**
       * do not recheck redirect
       */
      $_SESSION['check_valid'] = 'false';
      zen_redirect(zen_href_link($_GET['main_page'], 'products_id=' . $_GET['products_id']));
    }
  } else {
    $_SESSION['check_valid'] = 'true';
  }

On github, the code is still there for ZC 1.5.5, but in the current 1.6.0 code the line in question has been commented out as an identified solution by one of the other frequent ZC users/posters. I forget who identified the solution, but this way only a 404 is issued. I believe that something more is expected to come of it, but time will tell.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

18 May 2018, 3:28 PM
#7
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,336
Plugin Contributions:
41

Re: Sorry Product Not Found

I am having this problem with 1.5.4 with deleted products urls getting stuck in a redirect loop.

I added this

      $_SESSION['check_valid'] = 'false';
      //zen_redirect(zen_href_link($_GET['main_page'], 'products_id=' . $_GET['products_id'])); 
            header('HTTP/1.1 404 Not Found');
      $_GET['main_page'] = FILENAME_PAGE_NOT_FOUND;

added page_not_found to my robots skip for prosperity

it lands on index.php?main_page=product_info&products_id=0 still with a 404

but still it is a 302.... I tried the solution above by commenting out

      zen_redirect(zen_href_link($_GET['main_page'], 'products_id=' . $_GET['products_id']));

which works nicely for inactive products, but fails to resolve the redirect loops for deleted products.

Any suggestions to turn this in to a 301 would be appreciated.

18 May 2018, 4:12 PM
#8
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,336
Plugin Contributions:
41

Re: Sorry Product Not Found

Some progress...

If I use this instead

zen_redirect(zen_href_link(FILENAME_PAGE_NOT_FOUND, header('HTTP/1.1 301 Moved Permanently')));

I get rid of index.php?main_page=product_info&products_id=0 and correctly get index.php?main_page=page_not_found

but still a 302.

I can't find anywhere where a 302 is defined... I suspect it is a lack of function causing a default 302.