PDA

Shop Support News Archive - Shopbetreiber News -> Forum : Unterkategorien Anzeigen Lassen?


_-Shadow-_
10.03.2006, 12:34
Ich weis hört sich etwas blöd an aber wie stelle ich es ein das immer die Unterkategorien angezeigt werden?

Fragenkind
18.05.2006, 16:22
''>ZITAT(_-Shadow-_ @ Mar 10 2006, 12:34) 1437
Ich weis hört sich etwas blöd an aber wie stelle ich es ein das immer die Unterkategorien angezeigt werden?
[/b]

Ein einfaches einschalten gibt es nicht. Dazu müsste wohl die categories.php umgeschrieben werden. Kenne mich leider damit auch zu wenig aus. Wäre daher auch dankbar wenn einer eine Lösung hätte.

JP2302
30.05.2006, 11:59
Hallo Shadow ,
hast du in zwischen eine Modifizierung für deine Categ.....?
Ich suche selbst auch eine Lösung dafür.
In meinem Shop habe ich zur Zeit nur 4 Kategorien mit jeweils 1-2 Unterkategorie ,das sieht dann schon etwas verloren aus, wenn man nur die 4 Kat's sieht.
Viellenicht findet sich jemand der so was schon in seinem Shop umgesetzt hat.

LG JP2302

HarryBoo
30.05.2006, 18:21
Hier die Lösung.

Zwei Dateien müssen ersetzt werden.
Anschließend die passenden Grafiken und Farben angepasst werden, siehe z.B. hier ''>ZITAT</div>$categories_string .= '<img src='.$tpl_path.'/img/cat_arrow_other.gif align="absmiddle"><font color="#006600">';
Nachfolgend der Quellcode der beiden Dateien

Hier die xtc_show_category.inc.php (\source\inc\xtc_show_category.inc.php)

<?php
/ -----------------------------------------------------------------------------------------
**$Id: xtc_show_category.inc.php,v 1.2 2004/02/22 16:15:30 fanta2k Exp $

**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
**-----------------------------------------------------------------------------------------
**Third Party contributions:
**Add Bullet Images for Categories Infobox v1.0 (12/09/2002)**by Toby Adams <toby@opticalfunk.co.uk
**All Categories V1.7 (06/17/2003)** by Christian Lescuyer <cl@goelette.net>
**hw_categories.php_v0.2 (22.06.2003)**FrankW <Daywalker@Hawkweb.de>

**Released under the GNU General Public License
**--------------------------------------------------------------------------------------- /


function xtc_show_category($cid, $level, $foo, $cpath) {
** global**$categories_string, $HTTP_GET_VARS;


$tpl_path='templates/'.CURRENT_TEMPLATE;
if ($cid != 0) {
// 1.7 Get the current path info
**$category_path = explode('_',$HTTP_GET_VARS['cPath']);
**$in_path = in_array($cid, $category_path);
**$this_category = array_pop($category_path);

** for ($a=0; $a<$level; $a++)
**// 1.7 only indent subcategories (top level are flush left)
** if ($a>0) {
****$categories_string .=**'';
** }
** // 1.7 indicate the current category
** if ($this_category == $cid) {
******// 1.6 Are we on the "path" to selected category? If yes, use
******if ($in_path) {
**** $categories_string .=**'<img src='.$tpl_path.'/img/cat_arrow_other.gif align="absmiddle"><font color="#006600">[b]';
******} else {
**** $categories_string .=**'<img src='.$tpl_path.'/img/cat_arrow_down.gif align="absmiddle">';
****}
******$categories_string .=**$foo[$cid]['name'];
******if ($in_path)
****** $categories_string .=**'</font>';
******// 1.7**don't link the current category
******if ($this_category != $cid) {
****** $categories_string .= '</a>';
******}
** }

** // 1.7**don't link the current category
** if ($this_category != $cid) {
****if (xtc_has_category_subcategories($cid)) {
******** // 1.6 Are we on the "path" to selected category? If yes, use
******** if ($in_path) {
********$categories_string .=**'<a href="' . xtc_href_link(FILENAME_DEFAULT, 'cPath=' . $cpath . $cid) . '"><img src='.$tpl_path.'/img/cat_arrow_active.gif align="absmiddle" border=0><font color="#006600">[b]';
******** } else {
********$categories_string .=**'<a href="' . xtc_href_link(FILENAME_DEFAULT, 'cPath=' . $cpath . $cid) . '"><img src='.$tpl_path.'/img/cat_arrow_down.gif align="absmiddle" border=0>';
****** }
****} else {
******** // 1.6 Are we on the "path" to selected category? If yes, use [b]
******** if ($in_path) {
********$categories_string .=**'<a href="' . xtc_href_link(FILENAME_DEFAULT, 'cPath=' . $cpath . $cid) . '"><img src='.$tpl_path.'/img/cat_arrow_active.gif align="absmiddle" border=0><font color="#006600">[b]';
******** } else {
********$categories_string .=**'<a href="' . xtc_href_link(FILENAME_DEFAULT, 'cPath=' . $cpath . $cid) . '"><img src='.$tpl_path.'/img/cat_arrow_right.gif align="absmiddle" border=0>';
****** }
****}
******$categories_string .=**$foo[$cid]['name'];
******if ($in_path)
****** $categories_string .=**'</font>';
******// 1.7**don't link the current category
******if ($this_category != $cid) {
****** $categories_string .= '</a>';
******}
** }
// 1.4 SHOW_COUNTS is 'true' or 'false', not true or false
****if (SHOW_COUNTS == 'true') {
**** $products_in_category = xtc_count_products_in_category($cid);
**** if ($products_in_category > 0) {
******$categories_string .= '(' . $products_in_category . ')';
**** }
****}
** $categories_string .= '
' ."\n";
****}

// Traverse category tree
**foreach ($foo as $key => $value) {
** if ($foo[$key]['parent'] == $cid) {
****xtc_show_category($key, $level+1, $foo, ($level != 0 ? $cpath . $cid . '_' : ''));
** }
**}
}
?>

und nun die categories.php (\source\boxes\categories.php)
<?php
/ -----------------------------------------------------------------------------------------
**$Id: categories.php,v 1.3 2004/03/16 14:59:01 fanta2k Exp $

**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 (categories.php,v 1.10 2003/08/17); www.nextcommerce.org

**Released under the GNU General Public License
**-----------------------------------------------------------------------------------------
**Third Party contributions:
**Enable_Disable_Categories 1.3******** Autor: Mikel Williams | mikel@ladykatcostumes.com
**Add Bullet Images for Categories Infobox v1.0 (12/09/2002)**by Toby Adams <toby@opticalfunk.co.uk
**All Categories V1.7 (06/17/2003)** by Christian Lescuyer <cl@goelette.net>
**hw_categories.php_v0.2 (22.06.2003)**FrankW <Daywalker@Hawkweb.de>


**Released under the GNU General Public License
**--------------------------------------------------------------------------------------- /
// reset var
$box_smarty = new smarty;
$box_content='';
$box_smarty->assign('tpl_path','templates/'.CURRENT_TEMPLATE.'/');
// include needed functions
require_once(DIR_FS_CATALOG .'templates/'.CURRENT_TEMPLATE. '/source/inc/xtc_show_category.inc.php');
require_once(DIR_FS_INC . 'xtc_has_category_subcategories.inc.php');
require_once(DIR_FS_INC . 'xtc_count_products_in_category.inc.php');


$categories_string = '';
** if (GROUP_CHECK=='true') {
**$group_check="and c.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'";
}
$categories_query = xtc_db_query("select c.categories_id,
******************************************cd.categ ories_name,
******************************************c.parent _id from " .
******************************************TABLE_CA TEGORIES . " c, " .
******************************************TABLE_CA TEGORIES_DESCRIPTION . " cd
******************************************where c.categories_status = '1'
******************************************".$group_check."
******************************************and c.categories_id = cd.categories_id
******************************************and cd.language_id='" . (int)$_SESSION['languages_id'] ."'
******************************************order by sort_order, cd.categories_name");

while ($categories = xtc_db_fetch_array($categories_query))**{
** $foo[$categories['categories_id']] = array(
************************************** 'name' => $categories['categories_name'],
************************************** 'parent' => $categories['parent_id']);


}


xtc_show_category(0, 0, $foo, '');


** $box_smarty->assign('BOX_CONTENT', $categories_string);
$box_smarty->assign('language', $_SESSION['language']);
******// set cache ID
if (USE_CACHE=='false') {
$box_smarty->caching = 0;
$box_categories= $box_smarty->fetch(CURRENT_TEMPLATE.'/boxes/box_categories.html');
} else {
$box_smarty->caching = 1;
$box_smarty->cache_lifetime=CACHE_LIFETIME;
$box_smarty->cache_modified_check=CACHE_CHECK;
$cache_id = $_SESSION['language'].$_GET['cPath'];
$box_categories= $box_smarty->fetch(CURRENT_TEMPLATE.'/boxes/box_categories.html',$cache_id);
}

** $smarty->assign('box_CATEGORIES',$box_categories);

?>

JP2302
31.05.2006, 16:42
Super .
Danke dir HarryBoo.

LG JP2302

maverick
02.08.2006, 15:27
Hallo HarryBoo,
was muss ich ändern, damit nur 1 Unterkategorie geöffnet wird?

Vielen Dank vorab.

Gruß maverick

Holger
09.10.2006, 01:11
Nun hatte ich endlich mal Zeit die Datein zu ändern, damit die Kategorien aufgeklappt erscheinen - und siehe da, es funktioniert sogar.

Leider wird die Schrift nun nicht mehr fett dargestellt und hebt sich somit nicht sonderlich vom Rest ab.

Wo kann ich das ändern dass die Kategorien wieder fettgedrucht werden? Kann ja eigentlich nur in diesen beiden Datein sein, ich habe aber nichts passendes gefunden :( :(

Viele Grüße
Holger

losti
13.04.2008, 11:43
''>ZITAT(Holger @ Oct 9 2006, 1:11) 12752
Nun hatte ich endlich mal Zeit die Datein zu ändern, damit die Kategorien aufgeklappt erscheinen - und siehe da, es funktioniert sogar.

Leider wird die Schrift nun nicht mehr fett dargestellt und hebt sich somit nicht sonderlich vom Rest ab.

Wo kann ich das ändern dass die Kategorien wieder fettgedrucht werden? Kann ja eigentlich nur in diesen beiden Datein sein, ich habe aber nichts passendes gefunden :( :(

Viele Grüße
Holger
[/b]

Holger, hast du denn nun rausgefunden, wo man was ändern muss, damit die Kategorien wieder fettgedruckt werden? Wäre dankbar für deine Antwort.
Gruss losti

Primus2007
13.04.2008, 18:11
mir passt es nicht die 2 dateien zu ersezen, da schon modifikationen daran vorgenommen wurden. Wäre besser wenn mal jemand schreiben könnte was in den dateien verändert werden muss.