Results 1 to 2 of 2
  1. #1
    Join Date
    May 2009
    Posts
    10
    Plugin Contributions
    0

    Default How can I display the category descriptiong text on the product display info page?

    If a product is in 2 categories I also want to display both category descriptions on the product display info page

    Thank you

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How can I display the category descriptiong text on the product display info page

    You would have to determine what to do with the results, but something like this will grab all of the categories_descriptions for the product for the tpl_product_info_display.php ...
    Code:
    <?php
      $all_categories = "SELECT categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE products_id = '" . (int)$_GET['products_id'] . "'";
      $all_categories = $db->Execute($all_categories);
      $all_categories_description = "";
      while (!$all_categories->EOF) {
      // categories_description
        $sql = "SELECT categories_description
                FROM " . TABLE_CATEGORIES_DESCRIPTION . "
                WHERE categories_id= :categoriesID
                AND language_id = :languagesID";
    
        $sql = $db->bindVars($sql, ':categoriesID', $all_categories->fields['categories_id'], 'integer');
        $sql = $db->bindVars($sql, ':languagesID', $_SESSION['languages_id'], 'integer');
        $categories_description_lookup = $db->Execute($sql);
        if ($categories_description_lookup->RecordCount() > 0) {
          $all_categories_description .= $categories_description_lookup->fields['categories_description'];
          $all_categories_description .= '<br class="clearBoth" />';
        }
        $all_categories->MoveNext();
      }
      echo $all_categories_description;
    ?>
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

Similar Threads

  1. Replies: 3
    Last Post: 17 Nov 2013, 12:11 AM
  2. How can I display the Attributes on the Product List or Category Page?
    By webion in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 3 Feb 2010, 07:50 PM
  3. How to Remove the Left Column from the Product Info Display Page??
    By autoace in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 20 Aug 2009, 03:37 PM
  4. How can i have the product info display on the right side of image?
    By missblover in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 22 Apr 2009, 09:16 PM
  5. How can I change the Product Info. Display Page?
    By stevewag in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 21 Apr 2009, 01:13 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