Revision 3a45c5ca
Von Sven Schöling vor etwa 10 Jahren hinzugefügt
SL/PriceSource/PriceRules.pm | ||
---|---|---|
36 | 36 |
sub best_price { |
37 | 37 |
my ($self) = @_; |
38 | 38 |
|
39 |
$self->make_price_from_rule( min_by { $self->price_for_rule($_) } max_by { $_->priority } @{ $self->available_rules }); |
|
39 |
my $rules = $self->available_rules; |
|
40 |
|
|
41 |
return unless @$rules; |
|
42 |
|
|
43 |
my @max_prio = max_by { $_->priority } @$rules; |
|
44 |
my $min_price = min_by { $self->price_for_rule($_) } @max_prio; |
|
45 |
|
|
46 |
$self->make_price_from_rule($min_price); |
|
40 | 47 |
} |
41 | 48 |
|
42 | 49 |
sub price_for_rule { |
Auch abrufbar als: Unified diff
PriceRule: Nicht Fehler werfen wenn garkeine Regel zutrifft