]> iEval git - app-web-oof.git/blobdiff - lib/App/Web/Oof.pm
Take postage prices from environment
[app-web-oof.git] / lib / App / Web / Oof.pm
index 405ffb52a1cae80c430216fdb7c2bb73f35d1868..637f3935180bd294206ca02aec1c83a676c70ed4 100644 (file)
@@ -6,7 +6,7 @@ use warnings;
 use utf8;
 use parent qw/Plack::Component/;
 
-our $VERSION = '0.000_005';
+our $VERSION = '0.000_006';
 
 use DBIx::Simple;
 use Email::Sender::Simple 'sendmail';
@@ -37,6 +37,11 @@ sub HTML::Element::fclass { shift->look_down(class => qr/\b$_[0]\b/) }
 
 ##################################################
 
+my $postage_base = $ENV{OOF_POSTAGE_BASE} // 225;
+my $postage_per_item = $ENV{OOF_POSTAGE_PER_ITEM} // 50;
+
+##################################################
+
 my %db;
 my ($form, $continue, $order, $details, $pay);
 
@@ -167,7 +172,7 @@ sub continue_app {
        }
        $tree->look_down(name => 'discount')->detach unless $dvalue;
        $tree->fid('discount_tr')->detach unless $dvalue;
-       my $postage = 220 + 50 * ($quant - $quant_freepost);
+       my $postage = $postage_base + $postage_per_item * ($quant - $quant_freepost);
        $postage = 0 if $quant == $quant_freepost;
        $tree->fid('postage')->replace_content(stringify_money $postage);
        $total += $postage;
This page took 0.016714 seconds and 4 git commands to generate.