Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Join Date
    Oct 2007
    Posts
    9
    Plugin Contributions
    0

    Default category descriptions on index page

    Hi all,

    I have all my categories listed on the index page, but I need the category descriptions there as well. The categories_description variable only seems to be available on the specific category pages. Is there any way around this?

    Cheers,
    cw

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

    Default Re: category descriptions on index page

    You would need to customize the categories row module to include descriptions ...

    Note: be sure to use your templates and overrides on this ...
    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!]
    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!

  3. #3
    Join Date
    Oct 2007
    Posts
    9
    Plugin Contributions
    0

    Default Re: category descriptions on index page

    Well, that's what I figured, but in that file, the $categories object doesn't contain the description (object shown below). How can I access the description within the category_row file?

    The object as it appears in category_row:

    queryFactoryResult Object
    (
    [is_cached] =>
    [resource] => Resource id #218
    [cursor] => 0
    [EOF] =>
    [fields] => Array
    (
    [categories_id] => 2
    [categories_name] => Curettes
    [categories_image] => thumb-placeholder.jpg
    [parent_id] => 0
    )
    )

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: category descriptions on index page

    Probably in the category_row.php as suggested might be red text and in an order that you prefer
    Code:
    //    $categories->fields['products_name'] = zen_get_products_name($categories->fields['products_id']);
    
        $list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"',
                                               'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_description'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories->fields['categories_name'] . '</a>');
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Oct 2007
    Posts
    9
    Plugin Contributions
    0

    Default Re: category descriptions on index page

    I'll give that a try. Thanks.

  6. #6
    Join Date
    Oct 2007
    Posts
    9
    Plugin Contributions
    0

    Default Re: category descriptions on index page

    Alright, I plugged that in, didn't work -- $categories->fields['categories_description'] returns nothing. As I wrote above, categories_description is not part of the categories object. Whatever code is generating the object is not in category_row.php, and it seems to default to not tapping the categories_description table when the page is the index page, but does for individual category pages. I'm stumped.

    Anyone have any further suggestions?

    Cheers,
    cw

  7. #7
    Join Date
    Oct 2007
    Posts
    9
    Plugin Contributions
    0

    application error Re: category descriptions on index page

    Alright, so I poked around and figured my best bet was to run my own query. So I did this:

    $categories_description_query = "SELECT categories_description
    FROM categories_description
    WHERE categories_id = :categoriesID";

    $categories_description_query = $db->bindVars($categories_description_query,
    ':categoriesID', $categories->fields['categories_id'], 'integer');
    $categories_description = $db->Execute($categories_description_query);

    Then later I can call $categories_description->fields['categories_description']

    Hope this helps anyone else stuck with the same problem.

    Cheers,
    cw

  8. #8
    Join Date
    Oct 2007
    Posts
    23
    Plugin Contributions
    0

    Default Re: category descriptions on index page

    You put that query in categories_row? (I've been trying to get this to work as well, I'm not sure how I missed your post. I think I've looked at all the others that are close...)

    Forgive my ignorance, but don't you have to have passwords to access the DB information?

    I will play with this, but if someone knows WHY it works and would share that knowledge, it would be a boon to the tiny bit of my brain that tries to program...

    Thanks

  9. #9
    Join Date
    Oct 2007
    Posts
    23
    Plugin Contributions
    0

    Default Re: category descriptions on index page

    I've tried to run your query, and I cannot figure out where to put it to make it work.
    Last edited by LittleR; 30 Oct 2007 at 03:54 PM. Reason: too much whining.

  10. #10
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: category descriptions on index page

    Forgive my ignorance, but don't you have to have passwords to access the DB information?
    ZenCart provides the opening of the DB with the credentials that are in your configure.php file.

    there is a division between files that obtain data (categories_row.php & others) and files that use this information for display - mostly tpl_ files. So this is 2 step. Insure that the data has been made available. Then in aas associated tpl_ file display this data.
    Zen-Venom Get Bitten

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Category descriptions on the main page?
    By mpayson in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 15 Mar 2011, 12:17 AM
  2. Category descriptions on Main Page
    By webrob in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 13 Mar 2010, 07:22 PM
  3. Category Descriptions on Main Page
    By tomkeyes in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 22 Oct 2009, 07:45 PM
  4. Category descriptions on Index page
    By uyeahu in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 3 Mar 2009, 07:16 PM

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