From c51bcbe6a3d80499a2806c7a45c3f871b71bdb3b Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sat, 28 May 2016 17:52:29 +0100 Subject: [PATCH] Take postage prices from environment --- lib/App/Web/Oof.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/App/Web/Oof.pm b/lib/App/Web/Oof.pm index a0a4451..637f393 100644 --- a/lib/App/Web/Oof.pm +++ b/lib/App/Web/Oof.pm @@ -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; -- 2.39.2