Jump to content
xt:Commerce Community Forum

Unterkategorien in extra Box


doktormemo

Recommended Posts

Hallo,

ich möchte gerne, wenn man eine Hauptkategorie auswählt, dass die dazugehörigen Unterkategorien in einer extra Box angezeigt lassen.

Hier ein kleines Beispiel, was ich mir vorstelle... Bath Accessories, Bath Decor: Luxury Bath Accessories & Bath Items at Restoration Hardware

Ich habe mir eine Listenversion der xtc_show_category.inc.php runtergeladen

<?php
/*
-----------------------------------------------------------------------------------------
$Id: xtc_show_category.inc.php 1262 2005-09-30 10:00:32Z mz $

XT-Commerce - community made shopping
http://www.xt-commerce.com

Copyright (c) 2003 XT-Commerce
-----------------------------------------------------------------------------------------
based on:
(c) 2000-2001 The Exchange Project (earlier name of osCommerce)
(c) 2002-2003 osCommerce(categories.php,v 1.23 2002/11/12); www.oscommerce.com
(c) 2003 nextcommerce (xtc_show_category.inc.php,v 1.4 2003/08/13); www.nextcommerce.org

Released under the GNU General Public License
-----------------------------------------------------------------------------------------
Modified to get a cleaner HTML-output without tables
Bugfix
Shows, which categories have subcategories
by Gunnar Tillmann
http://www.gunnart.de
-----------------------------------------------------------------------------------------
*/

function xtc_show_category($counter) {

global $foo, $categories_string, $id;


//start the loop
for ($a=0; $a<$foo[$counter]['level']; $a++)
{}


if ($foo[$counter]['level']=='') //maincat
{
if (strlen($categories_string)=='0')
{
$categories_string .='<ul class="navilist">';
}
$categories_string .='
<li class="maincat';
if (xtc_has_category_subcategories($counter))
{
$categories_string .= ' submenue';
}
$categories_string .= '"><a class="';
if ( ($id) && (in_array($counter, $id)) )
{
$categories_string .= 'gewaehlt';
}
$categories_string .= '" href="';
}

else //subcat
{
$categories_string .= '
<li class="subcat level'.$foo[$counter]['level'];
if (xtc_has_category_subcategories($counter))
{
$categories_string .= ' submenue'.$foo[$counter]['level'];
}
$categories_string .= '"><a class="';
if ( ($id) && (in_array($counter, $id)) )
{
$categories_string .= 'gewaehlt';
}
$categories_string .= '" href="';
}

$cPath_new=xtc_category_link($counter,$foo[$counter]['name']);

$categories_string .= xtc_href_link(FILENAME_DEFAULT, $cPath_new);
$categories_string .= '">';

$categories_string .= $foo[$counter]['name'];

if (SHOW_COUNTS == 'true')
{
$products_in_category = xtc_count_products_in_category($counter);
if ($products_in_category > 0)
{
$categories_string .= ' <span class="catcount">(' . $products_in_category . ')</span>';
}
}

$categories_string .= '</a></li>';

if ($foo[$counter]['next_id'])
{
xtc_show_category($foo[$counter]['next_id']);
}
else
{
$categories_string .= '
</ul>';
}
}

?>[/PHP]

Wie kann ich eine extra Box erstellen, wo dann die Unterkategorien von der aktiven Hauptkategorie angezeigt wird?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...