From 488e6e8145ce64dd124ba6187a5d7b5813bb927b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Tue, 20 Jul 2021 14:50:48 +0800 Subject: Trying to get weight shouldn't be the template user's concern --- config/pikul_codes.tag | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/pikul_codes.tag b/config/pikul_codes.tag index fb4a0e6..71fd5cc 100644 --- a/config/pikul_codes.tag +++ b/config/pikul_codes.tag @@ -1,7 +1,7 @@ -UserTag pikul-codes Order company district city province weight +UserTag pikul-codes Order company district city province UserTag pikul-codes Routine <{PIKUL_ANTERAJA}) { @provisions = ( @@ -12,6 +12,10 @@ sub { $origin = $::Variable->{ANTERAJA_ORIGIN}; $table = 'anteraja'; } + my $weight = 0.0; + for my $item (@{$Carts->{main}}) { + $weight += $Tag->data('products', 'weight', $item->{code}) * $item->{quantity}; + } use Pikul; Pikul::init($company, \@provisions); my @codes = @{Pikul::codes( -- cgit v1.2.3