Revision 685

Date:
2018/06/06 08:42:50
Author:
ahitrov
Revision Log:
Debug warnings

Files:

Legend:

 
Added
 
Removed
 
Modified
  • utf8/plugins/webshop/lib/webshop/Keeper.pm

     
    538 538 );
    539 539 return (0, []) unless @coupons;
    540 540 my @usable = grep { $_->discount } @coupons;
    541 warn "We count on ".scalar(@usable)." coupons\n" if $DEBUG;
    541 warn "We count on ".scalar(@usable)." coupons: [".join(', ', map { $_->id.'. '.$_->name } @usable)."]\n" if $DEBUG;
    542 542 my ($total, $sum) = $self->basket_count( \@basket );
    543 543 return (0, \@usable) unless $sum;
    544 544 my %summoned = ( coupons => [], discount => 0 );
     
    575 575 }
    576 576
    577 577 @groups = sort { $b->{discount} <=> $a->{discount} } @groups;
    578 warn "We choose ".scalar(@{$groups[0]->{coupons}})." coupons: [".join(', ', map { $_->id.'. '.$_->name } @{$groups[0]->{coupons}})."]\n" if $DEBUG;
    578 579 return ($groups[0]->{discount}, $groups[0]->{coupons});
    579 580 }
    580 581