Ok took store off "Down for Maintenance" and re implemented the changed category_row.php file.
Check it out - here
Ok took store off "Down for Maintenance" and re implemented the changed category_row.php file.
Check it out - here
I keep getting sent back to home page not into category?
Well I have to take the store back down for the weekend, hopefully we can figure it on monday...
I'm just getting started with zencart. This was exactly what I was looking for with the random category pictures. However, it shows up the image unavailable picture for all. In the code, it should kick it to the transpixelgif if no file exists. I'm confused. You can check it out here: www.cheaperbyfar.com.
Thanks,
Will
I ended up giving up (kept looping me back to the index page) and making all of my category photos using multiple photos of products for that category, came out very nice, but time consuming.
This is my Category row.php - works for me although i am not using category images on home page or seo urls.
Infact i am using the css categories menu so dont even need this anymore.....
<?php
/**
* index category_row.php
*
* Prepares the content for displaying a category's sub-category listing in grid format.
* Once the data is prepared, it calls the standard tpl_list_box_content template for display.
*
* @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: category_row.php 4084 2006-08-06 23:59:36Z drbyte $
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
$title = '';
$num_categories = $categories->RecordCount();
$row = 0;
$col = 0;
$list_box_contents = '';
if ($num_categories > 0) {
if ($num_categories < MAX_DISPLAY_CATEGORIES_PER_ROW || MAX_DISPLAY_CATEGORIES_PER_ROW == 0) {
$col_width = floor(100/$num_categories);
} else {
$col_width = floor(100/MAX_DISPLAY_CATEGORIES_PER_ROW);
}
while (!$categories->EOF) {
global $db;
$sql = "select products_image from " . TABLE_PRODUCTS . " where master_categories_id = " . $categories->fields['categories_id'] . " AND products_image IS NOT NULL AND products_image != '.jpg' AND products_image != '' ORDER BY RAND() LIMIT 1";
$result = $db->Execute($sql);
$cat_image = $result->fields['products_image'];
$filename = DIR_WS_IMAGES . $cat_image;
if (file_exists($filename)) {
} else {
$cat_image = "pixel_trans.gif";
}
if (!$categories->fields['categories_image']) !$categories->fields['categories_image'] = $cat_image;
$cPath_new = zen_get_path($categories->fields['categories_id']);
// strip out 0_ from top level cats
$cPath_new = str_replace('=0_', '=', $cPath_new);
// $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_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories->fields['categories_name'] . '</a>');
$col ++;
if ($col > (MAX_DISPLAY_CATEGORIES_PER_ROW -1)) {
$col = 0;
$row ++;
}
$categories->MoveNext();
}
}
?>
WebMC-
Thank you for reposting the code, I don't need it now thou...
check out the images I ended up making here
I'll have the store up till 5pm EST as I'm working on it.
good stuff good luck with the store - nice website name btw!
Dunno, copied yours in exactly, still doesn't work. Guess I'm gonna go the other route.....come back to this later. The other addon I have installed is category dressing, but don't think that's interfering.
Bookmarks