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
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
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!
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
)
)
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
I'll give that a try. Thanks.
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
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
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
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.
ZenCart provides the opening of the DB with the credentials that are in your configure.php file.Forgive my ignorance, but don't you have to have passwords to access the DB information?
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