?How to link ubercart catalog main category name to the folowing page
בעמוד הבא
http://www.keflahayot.co.il/catalog/31
יש ליד כל שם קטגוריה כפתור "מידע נוסף" שמפנה לעמוד הבא ושם הקטגוריה אינו קישור אלה רק טקסט
אני מעונין להפוך את שם הקטגוריה לקישור
אני חושב שהשינוי אמור להתבצע ב template.php באזור הזה של הקוד
function phptemplate_uc_catalog_browse($tid = 0) {
drupal_add_css(drupal_get_path('module', 'uc_catalog') .'/uc_catalog.css');
$output = '';
$catalog = uc_catalog_get_page((int)$tid);
$catalog->name == "Catalog" ? $catalog->name = t('Products') : '';
$catalog->name = t('Catalog !catalog', array('!catalog' => $catalog->name));
drupal_set_title(check_plain($catalog->name));
drupal_set_breadcrumb(uc_catalog_set_breadcrumb($catalog->tid));
$types = uc_product_types();
$links = array();
$child_list = array();
foreach ($catalog->children as $child) {
if (!empty($child->nodes)) {
$links[] = array('title' => $child->name . (variable_get('uc_catalog_breadcrumb_nodecount', FALSE) ? ' ('. $child->nodes .')' : ''), 'href' => uc_catalog_path($child),
'attributes' => array('rel' => 'tag'),
);
}
if (!empty($child->image)) {
$image = '
if (module_exists('imagecache')) {
$image .= l(theme('imagecache', 'uc_category', $child->image['filepath']), uc_catalog_path($child), array('html' => TRUE));
}
else {
$image .= l(theme('image', $child->image['filepath']), uc_catalog_path($child), array('html' => TRUE));
}
$image .= '
';
}
else {
$image = '
';
}
$grandchildren = array();
$j = 0;
$max_gc_display = 3;
foreach ($child->children as $i => $grandchild) {
if ($j > $max_gc_display) {
break;
}
$g_child_nodes = 0;
foreach ($types as $type) {
$g_child_nodes += taxonomy_term_count_nodes($grandchild->tid, $type);
}
if (1/$g_child_nodes/) {
$grandchildren[$i] = l($grandchild->name, uc_catalog_path($grandchild), array('class' => 'subcategory'));
$j++;
}
}
//$grandchildren = array_slice($grandchildren, 0, intval(count($grandchildren) / 2) + 1, TRUE);
if ($j > $max_gc_display) {
//array_push($grandchildren, l(t('More...'), uc_catalog_path($child), array('class' => 'subcategory')));
}
/if ($child->nodes) {/
$cell_link = '
';
if (variable_get('uc_catalog_show_subcategories', TRUE)) {
$subs = '
- ';
- '.$sub.'
foreach($grandchildren as $sub) {
$subs .= '
';
}
$subs .= '
';
$cell_link .= '
' . $subs . '
' . l(t("To catalog !catalog", array("!catalog" => $child->name)), uc_catalog_path($child)) . '
' . "\n";
}
$child_list[] = $cell_link;
/}/
}
/if (!empty($catalog->image)) {
if (module_exists('imagecache')) {
$output .= theme('imagecache', 'uc_thumbnail', $catalog->image['filepath'], $catalog->name, $catalog->name, array('class' => 'category'));
}
else {
$output .= theme('image', $catalog->image['filepath'], $catalog->name, $catalog->name, array('class' => 'category'));
}
}/
// Build an ORDER BY clause for the SELECT query based on table sort info.
if (empty($_REQUEST['order'])) {
$order = 'ORDER BY p.ordering, n.title, n.nid';
}
else {
$order = tapirsort_sql(uc_product_table_header());
}
$sql = "SELECT DISTINCT(n.nid), n.sticky, n.title, n.created, p.model, p.sell_price, p.ordering
FROM {node} n
INNER JOIN {term_node} tn ON n.vid = tn.vid
INNER JOIN {uc_products} AS p ON n.vid = p.vid
WHERE tn.tid = %d AND n.status = 1
AND n.type IN (". db_placeholders($types, 'varchar') .") ". $order;
$sql_count = "SELECT COUNT(DISTINCT(n.nid))
FROM {node} n
INNER JOIN {term_node} tn ON n.vid = tn.vid
INNER JOIN {uc_products} AS p ON n.vid = p.vid
WHERE tn.tid = %d
AND n.status = 1
AND n.type IN (". db_placeholders($types, 'varchar') .")";
$sql = db_rewrite_sql($sql);
$sql_count = db_rewrite_sql($sql_count);
$sql_args = array($catalog->tid);
foreach ($types as $type) {
$sql_args[] = $type;
}
$catalog->products = array();
$result = pager_query($sql, variable_get('uc_product_nodes_per_page', 12), 0, $sql_count, $sql_args);
while ($node = db_fetch_object($result)) {
$catalog->products[] = $node->nid;
}
if (count($catalog->products)) {
if (count($links)) {
$output .= theme('links', $links, array('class' => 'links inline uc-categories')) ."
\n";
}
$output .= $catalog->description;
$output .= theme('uc_catalog_products', $catalog->products);
$output .= '
';
}
elseif(arg(0) == 'catalog' && !arg(1)) {
// Display table of child categories similar to an osCommerce site's front page.
$columns = variable_get('uc_catalog_category_columns', 3);
$cat_rows = array();
$row = array();
$i = 1;
foreach ($child_list as $cell) {
$row[] = array('data' => $cell, 'class' => 'category ' . ($i % 2 == 0 ? 'even' : 'odd'));
if ($i % $columns == 0) {
$cat_rows[] = $row;
$row = array();
}
$i++;
}
if (count($row) > 0 && count($row) < $columns) {
if (count($cat_rows) >= 1) {
$row = array_merge($row, array_fill(count($row), $columns - count($row), array('data' => ' ', 'class' => 'category')));
}
$cat_rows[] = $row;
}
$output .= $catalog->description;
$output .= theme('table', array(), $cat_rows, array('class' => 'category'));
}
else {
if (count($links)) {
$rows = array();
foreach($links as $link) {
$rows[] = array(
'data' => array(
$link['title'],
array('data' => l('<span>'.t('More info').'</span>', $link['href'], array('html' => true)), 'class' => 'more-info-button'),
),
'class' => 'cat-category',
);
}
$output .= theme('table', array(), $rows, array('cellspacing' => '0', 'cellpadding' => '0', 'class' => 'int-categories'));
//$output .= theme('links', $links, array('class' => 'links inline uc-categories')) ."<br />\n";
}
else {
$output .= '<div class="no-products">'. t('No products are available in this category.') .'</div>';
}
//$output .= $catalog->description;
$output .= '<div class="pager-wrapper">' . theme('pager') . '</div>';
}
return $output;
}
