Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2012
    Posts
    12
    Plugin Contributions
    0

    Default Short Description Mod - PHP errors

    Hi there,

    I need help with debug errors after installing this mod, I am clueless with this, can someone please help???

    I installed the Short Description mod (http://www.zen-cart.com/downloads.php?do=file&id=168), seems to be working fine in admin however, it has wiped out the products information on my product listing page (everything else appears - here is a link: http://www.bullybazaar.com//index.ph...index&cPath=65)

    Have no idea if it has affected the product info page as I can't get to it...

    The 2 debug files I dl'd afterwards show this:
    1)
    Code:
    [26-Jun-2012 23:58:23] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/includes/index_filters/default_filter.php' (include_path='.:/usr/lib64/php:/usr/lib/php:/usr/share/pear') in /home4/bullybaz/public_html/includes/modules/pages/index/main_template_vars.php on line 182
    2)
    Code:
    [27-Jun-2012 00:00:53] PHP Fatal error:  Call to undefined function  zen_get_products_ahort_desc() in /home4/bullybaz/public_html/zcadmin/includes/modules/product/preview_info.php on line 42
    I thought there might be an easy fix, but I just looked and since installing last night there seems to be about 50 or so more debug pages in my cache folder

    Maybe I should uninstall? Is there another way to get a short description for my product to show up, maybe with a <div>???

    Thanks in advance for any help :)

    PS - I was able to get to a product info page and although the styling needs to be worked on, the short description is there. Here is a link:
    http://www.bullybazaar.com//index.ph...roducts_id=193

    So it seems to just be a problem on the products listing page, where I don't even want to use it. I have disabled it in admin but that doesn't seem to help....
    Last edited by CharBee; 27 Jun 2012 at 09:10 PM.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Short Description Mod - debug errors

    The error messages reveal that something you've done is asking it to look for files in /includes/includes/... which is definitely wrong.
    .

    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.

  3. #3
    Join Date
    Jun 2012
    Posts
    12
    Plugin Contributions
    0

    Default Re: Short Description Mod - PHP errors

    Aaah, I see that now...but all I did was upload the files and install the sql patch...

    Code:
    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Display Product Short Descriptions', 'PRODUCT_LIST_SHORT_DESC', '3', 'Set to 0 to disable, set to 1-99 to enable.', 8, 11, now(), now(), NULL, NULL);
    
    ALTER TABLE products_description ADD products_short_desc VARCHAR( 255 ) DEFAULT NULL AFTER products_description ;
    
    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Product Info - Display Product Short Descriptions', 'PRODUCT_INFO_SHORT_DESC', '1', 'Show Product''s short Description<br />0= off<br />1= on', 18, 30, now(), now(), NULL, 'zen_cfg_select_drop_down(array(array(''id''=>''0'', ''text''=>''Off''), array(''id''=>''1'', ''text''=>''On'')),');
    there doesn't seem to be anything in there that would do that, that I can see???

  4. #4
    Join Date
    Jun 2012
    Posts
    12
    Plugin Contributions
    0

    Default Re: Short Description Mod - PHP errors

    I can't say that I really know what I'm looking at, but I'm trying to figure it out...can someone tell me if I'm headed in the right direction? Thanks in advance for any help, I would really love to get this working.

    This is includes/modules/pages/index/main_template_vars.php from the mod, does the section in red have anything to do with my problem? ...
    Code:
    <?php
    /**
     * index main_template_vars.php
     *
     * @package page
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: short_desc update 2006-09-05 by joostvdl (based on): main_template_vars.php 2973 2006-02-04 23:27:35Z wilt $
     */
    
    // This should be first line of the script:
    $zco_notifier->notify('NOTIFY_HEADER_START_INDEX_MAIN_TEMPLATE_VARS');
    
    //die($category_depth);
    //die($_GET['music_genre_id']);
    
    // release manufacturers_id when nothing is there so a blank filter is not setup.
    // this will result in the home page, if used
    if (isset($_GET['manufacturers_id']) && $_GET['manufacturers_id'] <= 0) {
      unset($_GET['manufacturers_id']);
      unset($manufacturers_id);
    }
    
    // release music_genre_id when nothing is there so a blank filter is not setup.
    // this will result in the home page, if used
    if (isset($_GET['music_genre_id']) && $_GET['music_genre_id'] <= 0) {
      unset($_GET['music_genre_id']);
      unset($music_genre_id);
    }
    
    // release record_company_id when nothing is there so a blank filter is not setup.
    // this will result in the home page, if used
    if (isset($_GET['record_company_id']) && $_GET['record_company_id'] <= 0) {
      unset($_GET['record_company_id']);
      unset($record_company_id);
    }
    
    // only release typefilter if both record_company_id and music_genre_id are blank
    // this will result in the home page, if used
    if ((isset($_GET['record_company_id']) && $_GET['record_company_id'] <= 0) and (isset($_GET['music_genre_id']) && $_GET['music_genre_id'] <= 0) ) {
      unset($_GET['typefilter']);
      unset($typefilter);
    }
    
    // hook to notifier so that additional product-type-specific vars can be released too
    $zco_notifier->notify('NOTIFY_HEADER_INDEX_MAIN_TEMPLATE_VARS_RELEASE_PRODUCT_TYPE_VARS');
    
    
    if ($category_depth == 'nested')
    {
      $sql = "SELECT cd.categories_name, c.categories_image
              FROM   " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
              WHERE      c.categories_id = :categoriesID
              AND        cd.categories_id = :categoriesID
              AND        cd.language_id = :languagesID
              AND        c.categories_status= '1'";
    
      $sql = $db->bindVars($sql, ':categoriesID', $current_category_id, 'integer'); 
      $sql = $db->bindVars($sql, ':languagesID', $_SESSION['languages_id'], 'integer'); 
      $category = $db->Execute($sql);
    
      if (isset($cPath) && strpos($cPath, '_'))
      {
        // check to see if there are deeper categories within the current category
        $category_links = array_reverse($cPath_array);
        for($i=0, $n=sizeof($category_links); $i<$n; $i++)
        {
          $sql = "SELECT count(*) AS total
                  FROM   " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
                  WHERE      c.parent_id = :parentID 
                  AND        c.categories_id = cd.categories_id
                  AND        cd.language_id = :languagesID
                  AND        c.categories_status= '1'";
    
          $sql = $db->bindVars($sql, ':parentID', $category_links[$i], 'integer'); 
          $sql = $db->bindVars($sql, ':languagesID', $_SESSION['languages_id'], 'integer'); 
          $categories = $db->Execute($sql);
    
          if ($categories->fields['total'] < 1)
          {
            // do nothing, go through the loop
          } else {
            $categories_query = "SELECT c.categories_id, cd.categories_name, c.categories_image, c.parent_id
                                 FROM   " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
                                 WHERE      c.parent_id = :parentID
                                 AND        c.categories_id = cd.categories_id 
                                 AND        cd.language_id = :languagesID 
                                 AND        c.categories_status= '1' 
                                 ORDER BY   sort_order, cd.categories_name";
    
            $categories_query = $db->bindVars($categories_query, ':parentID', $category_links[$i], 'integer');
            $categories_query = $db->bindVars($categories_query, ':languagesID', $_SESSION['languages_id'], 'integer'); 
            break; // we've found the deepest category the customer is in
          }
        }
      } else {
        $categories_query = "SELECT c.categories_id, cd.categories_name, c.categories_image, c.parent_id
                             FROM   " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
                             WHERE      c.parent_id = :parentID
                             AND        c.categories_id = cd.categories_id
                             AND        cd.language_id = :languagesID
                             AND        c.categories_status= '1'
                             ORDER BY   sort_order, cd.categories_name";
    
        $categories_query = $db->bindVars($categories_query, ':parentID', $current_category_id, 'integer');
        $categories_query = $db->bindVars($categories_query, ':languagesID', $_SESSION['languages_id'], 'integer'); 
      }
      $categories = $db->Execute($categories_query);
      $number_of_categories = $categories->RecordCount();
      $new_products_category_id = $current_category_id;
    
      /////////////////////////////////////////////////////////////////////////////////////////////////////
      $tpl_page_body = 'tpl_index_categories.php';
      /////////////////////////////////////////////////////////////////////////////////////////////////////
    
      //  } elseif ($category_depth == 'products' || isset($_GET['manufacturers_id']) || isset($_GET['music_genre_id'])) {
    } elseif ($category_depth == 'products' || zen_check_url_get_terms()) {
      if (SHOW_PRODUCT_INFO_ALL_PRODUCTS == '1') {
        // set a category filter
        $new_products_category_id = $cPath;
      } else {
        // do not set the category
      }
      // create column list
      $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
      'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
      'PRODUCT_LIST_SHORT_DESC' => PRODUCT_LIST_SHORT_DESC,
      'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
      'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
      'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
      'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
      'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE);
    
      /*                         ,
      'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
      */
      asort($define_list);
      reset($define_list);
      foreach ($define_list as $key => $value)
      {
        if ($value > 0) $column_list[] = $key;
      }
    
      $select_column_list = '';
    
      for ($i=0, $n=sizeof($column_list); $i<$n; $i++)
      {
        switch ($column_list[$i])
        {
          case 'PRODUCT_LIST_MODEL':
          $select_column_list .= 'p.products_model, ';
          break;
          case 'PRODUCT_LIST_NAME':
          $select_column_list .= 'pd.products_name, ';
          break;
    	  case 'PRODUCT_LIST_SHORT_DESC':
          $select_column_list .= 'pd.products_short_desc, ';
          break;
          case 'PRODUCT_LIST_MANUFACTURER':
          $select_column_list .= 'm.manufacturers_name, ';
          break;
          case 'PRODUCT_LIST_QUANTITY':
          $select_column_list .= 'p.products_quantity, ';
          break;
          case 'PRODUCT_LIST_IMAGE':
          $select_column_list .= 'p.products_image, ';
          break;
          case 'PRODUCT_LIST_WEIGHT':
          $select_column_list .= 'p.products_weight, ';
          break;
        }
      }
      // always add quantity regardless of whether or not it is in the listing for add to cart buttons
      if (PRODUCT_LIST_QUANTITY < 1) {
        $select_column_list .= 'p.products_quantity, ';
      }
    
      // set the product filters according to selected product type
      $typefilter = 'default';
      if (isset($_GET['typefilter'])) $typefilter = $_GET['typefilter'];
      require(DIR_WS_INCLUDES . zen_get_index_filters_directory($typefilter . '_filter.php'));
    
    
    
      ////////////////////////////////////////////////////////////////////////////////////////////////////////////
      $tpl_page_body = 'tpl_index_product_list.php';
      ////////////////////////////////////////////////////////////////////////////////////////////////////////////
    } else {
      ////////////////////////////////////////////////////////////////////////////////////////////////////////////
      $tpl_page_body = 'tpl_index_default.php';
      ////////////////////////////////////////////////////////////////////////////////////////////////////////////
    }
    $current_categories_description = "";
    // categories_description
    $sql = "SELECT categories_description 
            FROM " . TABLE_CATEGORIES_DESCRIPTION . "
            WHERE categories_id= :categoriesID
            AND language_id = :languagesID";
    
    $sql = $db->bindVars($sql, ':categoriesID', $current_category_id, 'integer');
    $sql = $db->bindVars($sql, ':languagesID', $_SESSION['languages_id'], 'integer');
    $categories_description_lookup = $db->Execute($sql);
    if ($categories_description_lookup->RecordCount() > 0) {
      $current_categories_description = $categories_description_lookup->fields['categories_description'];
    }
    
    require($template->get_template_dir($tpl_page_body, DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . $tpl_page_body);
    
    // This should be last line of the script:
    $zco_notifier->notify('NOTIFY_HEADER_END_INDEX_MAIN_TEMPLATE_VARS');
    ?>

  5. #5
    Join Date
    Jun 2012
    Posts
    12
    Plugin Contributions
    0

    Default Re: Short Description Mod - PHP errors

    Ok, so I messed around with this so much yesterday I made things worse, decided to uninstall zen-cart and reinstall fresh.

    Can anyone tell me this - I would still like to use this mod, however, I only want it on the product info page not on any other page. I will assume that the correct way to do with would be to not upload any changes to do with any other pages...? And then the sql patch would need to be altered, correct? Would I just take out the first statement???

    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Display Product Short Descriptions', 'PRODUCT_LIST_SHORT_DESC', '3', 'Set to 0 to disable, set to 1-99 to enable.', 8, 11, now(), now(), NULL, NULL);

    ALTER TABLE products_description ADD products_short_desc VARCHAR( 255 ) DEFAULT NULL AFTER products_description ;

    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Product Info - Display Product Short Descriptions', 'PRODUCT_INFO_SHORT_DESC', '1', 'Show Product''s short Description<br />0= off<br />1= on', 18, 30, now(), now(), NULL, 'zen_cfg_select_drop_down(array(array(''id''=>''0'', ''text''=>''Off''), array(''id''=>''1'', ''text''=>''On'')),');

  6. #6
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Short Description Mod - PHP errors

    Quote Originally Posted by CharBee View Post
    I only want it on the product info page not on any other page. I will assume that the correct way to do with would be to not upload any changes to do with any other pages...?
    Sounds about right
    Quote Originally Posted by CharBee View Post
    And then the sql patch would need to be altered, correct? Would I just take out the first statement???

    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Display Product Short Descriptions', 'PRODUCT_LIST_SHORT_DESC', '3', 'Set to 0 to disable, set to 1-99 to enable.', 8, 11, now(), now(), NULL, NULL);
    Again, sounds about right, since that statement would be irrelevant. However it would also be harmless if it were run anyway.

    But, I've not looked at the code to confirm, so I'm just commenting that what you're suggesting is the direction I'd pursue if I had the same stated goals.
    .

    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.

  7. #7
    Join Date
    Jun 2012
    Posts
    12
    Plugin Contributions
    0

    Default Re: Short Description Mod - PHP errors

    Third times the charm! Got it working perfectly, just have to style it now. Thanks for your help!

  8. #8
    Join Date
    Jan 2006
    Posts
    1,542
    Plugin Contributions
    0

    Default Re: Short Description Mod - PHP errors

    Can you post an example of what this mod is supposed to do and look like? What is it's purpose? Thanks.

    EDIT: and that is a 1.5 zc it's working on?
    Steve
    prommart.com

 

 

Similar Threads

  1. v139h cannot copy product after installing Short Description mod
    By AndyCZ in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 26 May 2012, 09:41 AM
  2. Short Description mod - bigger textbox for Product Add page?
    By christopherw in forum Addon Templates
    Replies: 9
    Last Post: 1 Nov 2010, 12:07 AM
  3. Short Description for Cat. Mod: SQL error
    By RobertG in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 15 Feb 2010, 08:50 PM
  4. Short Description mod - left aligning the text?
    By sarad in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 15 Jan 2009, 08:20 AM
  5. Short Description Mod help
    By bswinnerton in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 27 Jul 2008, 02:34 AM

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