Page 1 of 1
shop - SHOP CATEGORIES: Sortierung ändern
Posted: Sun 20. Jan 2013, 12:54
by RalfB
Ich möchte die Sortierung in der Auflistung des "SHOP_CATEGORIES" ändern.
der Part: "<li class="active"><a href="....." steht jetzt ganz am Ende der Auflistung, da ich diesen aber für Bestseller benutzen bzw. benannt habe möchte ich ihn ganz ober haben, als Beginn der Auflistung.
Wo und wie kann ich das anpassen?
Re: shop - SHOP CATEGORIES: Sortierung ändern
Posted: Mon 21. Jan 2013, 10:35
by nameless1
möchtest du die auflistung sortieren oder die position der auflistung neu bestimmen? zweiteres geht uner
Code: Select all
include/inc_module/mod_shop/template/default.html
ggf. auch eine andere .html dort, je nachdem wie es konfiguriert ist.
Re: shop - SHOP CATEGORIES: Sortierung ändern
Posted: Mon 21. Jan 2013, 15:00
by RalfB
nameless1 wrote:möchtest du die auflistung sortieren oder die position der auflistung neu bestimmen? zweiteres geht uner
Code: Select all
include/inc_module/mod_shop/template/default.html
ggf. auch eine andere .html dort, je nachdem wie es konfiguriert ist.
Also ich möchte die Position neu bestimmen. Diese Position "Unter "Alle Produkte" listen", "<li class="active"><a href="....." steht jetzt ganz am Ende der Auflistung. Ich möchte diese, aber für Bestseller benutzen bzw. habe sie auch schon so benannt möchte und somit möchte ich sie ganz ober haben, als Beginn der Auflistung.
Wie kann ich das dann in der "default.html anpassen?
Re: shop - SHOP CATEGORIES: Sortierung ändern
Posted: Mon 21. Jan 2013, 16:01
by nameless1
kannst du mir n link per pm schicken? will mir das gerade nicht nachbauen und kann mich nicht mehr an den aufbau erinnern.
cheers!
Re: shop - SHOP CATEGORIES: Sortierung ändern
Posted: Mon 21. Jan 2013, 17:00
by breitsch
geht nur mit core hack, der Kategorienbaum wird im Core aufgebaut und als ganzes ins Template übergeben.
File: include/inc_module/mod_shop/frontend.render.php
Code: Select all
row 383
$x = 0;
change to
$x = 1;
row 452 to 461
if( ! $shop_limited_cat ) {
$shop_cat[$x] = '<li';
if($shop_cat_selected == 'all') {
$shop_cat[$x] .= ' class="active"';
}
$shop_cat[$x] .= '>';
$shop_cat[$x] .= '<a href="' . $shop_cat_link . '&shop_cat=all">';
$shop_cat[$x] .= html_specialchars($_tmpl['config']['cat_all']);
$shop_cat[$x] .= '</a>';
$shop_cat[$x] .= '</li>';
change to
if( ! $shop_limited_cat ) {
$shop_cat[0] = '<li';
if($shop_cat_selected == 'all') {
$shop_cat[0] .= ' class="active"';
}
$shop_cat[0] .= '>';
$shop_cat[0] .= '<a href="' . $shop_cat_link . '&shop_cat=all">';
$shop_cat[0] .= html_specialchars($_tmpl['config']['cat_all']);
$shop_cat[0] .= '</a>';
$shop_cat[0] .= '</li>';
add row after 462
add in new row 463
ksort($shop_cat);
Das bringt die 'Aktuell' Kategorie nach oben.
Gehörte eigentlich folgendermassen in den Core:
File: include/inc_module/mod_shop/template/default.html
Code: Select all
add in config section
; position of the cat_all category
; 0 = on top
; 1 = at bottom
cat_all_position = 0
File: include/inc_module/mod_shop/frontend.render.php
Code: Select all
row 383
$x = 0;
change to
$x = 1;
row 451
(isset($_tmpl['config']['cat_all_position']) && $_tmpl['config']['cat_all_position'] == 1) ? $x=99999 : $x=0;
add row after 462
add in new row 463
ksort($shop_cat);
dann wäre on top default, könnte aber im template übersteuert werden.
Re: shop - SHOP CATEGORIES: Sortierung ändern
Posted: Tue 22. Jan 2013, 14:32
by RalfB
breitsch wrote:geht nur mit core hack, der Kategorienbaum wird im Core aufgebaut und als ganzes ins Template übergeben.
Gehörte eigentlich folgendermassen in den Core:
File: include/inc_module/mod_shop/template/default.html
Code: Select all
add in config section
; position of the cat_all category
; 0 = on top
; 1 = at bottom
cat_all_position = 0
File: include/inc_module/mod_shop/frontend.render.php
Code: Select all
row 383
$x = 0;
change to
$x = 1;
row 451
(isset($_tmpl['config']['cat_all_position']) && $_tmpl['config']['cat_all_position'] == 1) ? $x=99999 : $x=0;
add row after 462
add in new row 463
ksort($shop_cat);
dann wäre on top default, könnte aber im template übersteuert werden.
Hallo breitsch,
ich hab deine zweite Variante gewählt, da du schreibst das es die "Richtigere" ist. Sie funktioniert wunderbar!
Vielen Dank!
