Forums / Templates, Stylesheets, Page Layout / Category descriptions on Main Page

Category descriptions on Main Page

Locked

Views: 1,927

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
7 May 2007, 8:45 PM
#1
webrob avatar

webrob

New Zenner

Join Date:
Jun 2006
Location:
Huntington Beach, CA
Posts:
51
Plugin Contributions:
0

Category descriptions on Main Page

Hi everyone,

I am looking to add the category descriptions to teh right of the categories on the main page.

You can see my site here: http://www.inkjetoutput.com/new_store/

I already have the space for the description and I have twaeked with this file: /includes/modules/category_row.php but i can not get it to work. I have modified line 40 from:

                                           'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories->fields['categories_name'] . '</a>');

To:

                                          'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '</a><br />' . $categories->fields['categories_name'] . '<br>' . $categories->fields['categories_description'] . '<hr>');

Notice the last line where I tried to call for

$categories->fields['categories_description']

It is not grabbing the description though. What can I do to have this grab the description?

Thanks in advance!

Rob
Pier Marketing ◄ Printing and Marketing Collateral - Order Online!
Pier Technologies ◄ Web Development & IT Solutions
And That's News? ◄ My NEW Blog!!

7 May 2007, 9:08 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Category descriptions on Main Page

Since it is not used here, I expect that $categories->fields[] is not built to include 'categories-description', so there is nothing to grab.

I think you will need to find where it is built and add and populate that field before you can retrieve it here.

7 May 2007, 9:56 PM
#3
webrob avatar

webrob

New Zenner

Join Date:
Jun 2006
Location:
Huntington Beach, CA
Posts:
51
Plugin Contributions:
0

Re: Category descriptions on Main Page

$categories->fields[] is used here as $categories->fields['categories_name'] but not the fields. They are both in the same table but when I call for the descriptions it doesn't work. I need to find the function or class that is used but I can not figure it out.

Rob
Pier Marketing ◄ Printing and Marketing Collateral - Order Online!
Pier Technologies ◄ Web Development & IT Solutions
And That's News? ◄ My NEW Blog!!

7 May 2007, 10:10 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Category descriptions on Main Page

Clearer wording:
Since 'categories-description' is not used here, I expect that $categories->fields[] is not built to include it...

7 May 2007, 10:35 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Category descriptions on Main Page

/includes/functions/functions_categories.php, lines 370-405:

// categories pulldown with products
  function zen_draw_products_pull_down_categories($name, $parameters = '', $exclude = '') {
    global $db, $currencies;

    if ($exclude == '') {
      $exclude = array();
    }

    $select_string = '<select name="' . $name . '"';

    if ($parameters) {
      $select_string .= ' ' . $parameters;
    }

    $select_string .= '>';

    $categories = $db->Execute("select distinct c.categories_id, cd.categories_name " ."
                                from " . TABLE_CATEGORIES . " c, " .
                                         TABLE_CATEGORIES_DESCRIPTION . " cd, " .
                                         TABLE_PRODUCTS_TO_CATEGORIES . " ptoc " ."
                                where ptoc.categories_id = c.categories_id
                                and c.categories_id = cd.categories_id
                                and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                                order by categories_name");

    while (!$categories->EOF) {
      if (!in_array($categories->fields['categories_id'], $exclude)) {
        $select_string .= '<option value="' . $categories->fields['categories_id'] . '">' . $categories->fields['categories_name'] . '</option>';
      }
      $categories->MoveNext();
    }

    $select_string .= '</select>';

    return $select_string;
  }

This looks like the place, but I don't know enough to safely edit it.

8 May 2007, 12:28 AM
#6
webrob avatar

webrob

New Zenner

Join Date:
Jun 2006
Location:
Huntington Beach, CA
Posts:
51
Plugin Contributions:
0

Re: Category descriptions on Main Page

That is not it. That is for a category pull down menu. I still can not find it either :dontgetit

Rob
Pier Marketing ◄ Printing and Marketing Collateral - Order Online!
Pier Technologies ◄ Web Development & IT Solutions
And That's News? ◄ My NEW Blog!!

8 May 2007, 6:06 PM
#7
webrob avatar

webrob

New Zenner

Join Date:
Jun 2006
Location:
Huntington Beach, CA
Posts:
51
Plugin Contributions:
0

Re: Category descriptions on Main Page

webrob:

That is not it. That is for a category pull down menu. I still can not find it either :dontgetit

Does anyone know if this comes form a function or a class file at least??

Rob
Pier Marketing ◄ Printing and Marketing Collateral - Order Online!
Pier Technologies ◄ Web Development & IT Solutions
And That's News? ◄ My NEW Blog!!

9 May 2007, 6:17 PM
#8
webrob avatar

webrob

New Zenner

Join Date:
Jun 2006
Location:
Huntington Beach, CA
Posts:
51
Plugin Contributions:
0

Re: Category descriptions on Main Page

No one has done something like this? I really need to figure this out!!! Please help someone!!

:blink: :blink: :blink: :blink:

Rob
Pier Marketing ◄ Printing and Marketing Collateral - Order Online!
Pier Technologies ◄ Web Development & IT Solutions
And That's News? ◄ My NEW Blog!!

17 May 2007, 1:25 PM
#9
blag avatar

blag

Zen Follower

Join Date:
May 2007
Location:
Leicester, England
Posts:
165
Plugin Contributions:
0

Re: Category descriptions on Main Page

Yep

I'd like to know how to do that, too!! If you find out, let me know!!:bigups:

13 Mar 2010, 6:22 PM
#10
splieg avatar

splieg

New Zenner

Join Date:
Jul 2005
Location:
Newfoundland, Canada
Posts:
59
Plugin Contributions:
0

Re: Category descriptions on Main Page

I'm looking to do the same thing..... add the Category description to the category list page. I'm using Zen-Cart 1.3.8a and have edited the category_row.php page to show the category picture, then the cat name and I want the description placed below the name for each category. I've can't seem to determine which function i must edit so that the $categories->fields['categories_description'] would work. I'm assuming it's one of the functions within functions_categories.php. Can someone please offer some assistance???

Thanks