Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2010
    Posts
    124
    Plugin Contributions
    0

    Default Links Broken _info not product_info

    I just wanted to lend a hand for anyone experiencing this problem. After searching to no end I found the cause finally in the \includes\functions\functions_lookups file in the following line:


    Code:
      function zen_get_info_page($zf_product_id) {
        global $db;
        $sql = "select products_type from " . TABLE_PRODUCTS . " where products_id = '" . (int)$zf_product_id . "'";
        $zp_type = $db->Execute($sql);
        if ($zp_type->RecordCount() == 0) {
          return 'product_info';
        } else {
          $zp_product_type = $zp_type->fields['products_type'];
          $sql = "select type_handler from " . TABLE_PRODUCT_TYPES . " where type_id = '" . (int)$zp_product_type . "'";
          $zp_handler = $db->Execute($sql);
          return $zp_handler->fields['type_handler'] . '_info';
        }
      }
    Note the else statement showing NO records found indicating no product type. The page returned will cause the link to the product page to appear as "_info" NOT "product_info" if no type found. So the root cause, yup plain old operator error. You MUST load a product type and sometimes this is easily missed when doing mass loads. So if your links are broken and product pages are giving 404 errors due to the URL construct of "_info" without the word "product" in the link, then most likely you have not specified a product type when loading data or doing sql updates.

    The function "zen_get_info_page" is called in multiple areas and will return the same without the product type. Hope I saved someone frustration by finding a simple error!!!

    LINK LOOKS LIKE: Link would read something like /index.php?main_page=_info&cPath=16_43&products_id=2493

    SHOULD BE: /index.php?main_page=product_info&cPath=16_43&products_id=2493

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Links Broken _info not product_info

    Quote Originally Posted by Paul69 View Post
    So the root cause, yup plain old operator error. You MUST load a product type and sometimes this is easily missed when doing mass loads. So if your links are broken and product pages are giving 404 errors due to the URL construct of "_info" without the word "product" in the link, then most likely you have not specified a product type when loading data or doing sql updates.
    Correct. Thanks for confirming that those symptoms are a direct result of bad data.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. v137 product_info.html --> being truncated to _info.html
    By gsh in forum General Questions
    Replies: 3
    Last Post: 4 Sep 2014, 02:01 AM
  2. broken links or broken page. Help Please!
    By jim23866 in forum General Questions
    Replies: 1
    Last Post: 14 Jan 2011, 11:13 PM
  3. Link issue - main_page=product_info / main_page=_info
    By Chrome Orange in forum General Questions
    Replies: 5
    Last Post: 7 May 2010, 05:34 AM
  4. Rollover Image Links on product_info pages
    By hara in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 7 Oct 2008, 02:44 AM

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