shop - SHOP CATEGORIES: Sortierung ändern

Hier bekommst Du deutschsprachigen Support bezüglich offizieller Module für phpwcms. Keine Fehlermeldungen oder Erweiterungswünsche bitte!
Post Reply
RalfB
Posts: 192
Joined: Mon 9. Jan 2012, 13:05

shop - SHOP CATEGORIES: Sortierung ändern

Post 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?
nameless1
Posts: 878
Joined: Sun 27. Apr 2008, 23:22

Re: shop - SHOP CATEGORIES: Sortierung ändern

Post 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.
RalfB
Posts: 192
Joined: Mon 9. Jan 2012, 13:05

Re: shop - SHOP CATEGORIES: Sortierung ändern

Post 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?
nameless1
Posts: 878
Joined: Sun 27. Apr 2008, 23:22

Re: shop - SHOP CATEGORIES: Sortierung ändern

Post 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!
breitsch
Posts: 473
Joined: Sun 6. Mar 2005, 23:12
Location: bern switzerland

Re: shop - SHOP CATEGORIES: Sortierung ändern

Post 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.
http://www.youtube.com/watch?v=jqxENMKaeCU
because it's important!
breitsch
RalfB
Posts: 192
Joined: Mon 9. Jan 2012, 13:05

Re: shop - SHOP CATEGORIES: Sortierung ändern

Post 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! :)
Post Reply