Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a1e016b4

Von Tamino Steinert vor etwa 1 Jahr hinzugefügt

  • ID a1e016b421f8bd5fd61536fe32c483f389282f05
  • Vorgänger a4420618
  • Nachfolger 72470bd9

Varianten: Sortieren nach Ausprägungen Reihnefolge dieser verwenden

Unterschiede anzeigen:

SL/Controller/Part.pm
foreach my $variant_property (@{$part->variant_properties}) {
my $key = 'variant_property_' . $variant_property->id;
$sort_keys{$key} = sub {
$_[0]->get_variant_property_value_by_unique_name($variant_property->unique_name)->value;
$_[0]->get_variant_property_value_by_unique_name($variant_property->unique_name)->sortkey;
}
}
......
@{$::form->{variants}};
my @to_sort = map { { old_pos => $variant_id_to_position{$_->id}, order_by => $method->($_) } } @items;
if ($::form->{order_by} =~ /^(sellprice|lastcost)$/) {
if ($::form->{order_by} =~ /^(sellprice|lastcost)$/ ||
$::form->{order_by} =~ /^variant_property_/) {
if ($::form->{sort_dir}) {
@to_sort = sort { $a->{order_by} <=> $b->{order_by} } @to_sort;
} else {

Auch abrufbar als: Unified diff