From 0253ac37312fc76d2cbea0ad1eb10aed066cea9b 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 18:22:43 +0800 Subject: Rename pikul_codes to just pikul --- config/pikul.tag | 42 ++++++++++++++++++++++++++++++++++++++++++ config/pikul_codes.tag | 42 ------------------------------------------ pages/ord/checkout.html | 2 +- 3 files changed, 43 insertions(+), 43 deletions(-) create mode 100644 config/pikul.tag delete mode 100644 config/pikul_codes.tag diff --git a/config/pikul.tag b/config/pikul.tag new file mode 100644 index 0000000..17030a7 --- /dev/null +++ b/config/pikul.tag @@ -0,0 +1,42 @@ +UserTag pikul Order company district city province +UserTag pikul Routine <{PIKUL_ANTERAJA}) { + @provisions = ( + $Global::Variable->{ANTERAJA_ACCESS_KEY_ID}, + $Global::Variable->{ANTERAJA_SECRET_ACCESS_KEY}, + $Global::Variable->{ANTERAJA_BASE_PATH} + ); + $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( + $origin, + $Tag->query({ + sql => "SELECT code FROM $table WHERE district='$district' AND \ + city='$city' AND province='$province'", + wantarray => 1 + })->[0]->[0] || '', + $weight)}; + Pikul::cleanup(); + my $elements = '); + return $elements; +} +EOR diff --git a/config/pikul_codes.tag b/config/pikul_codes.tag deleted file mode 100644 index 71fd5cc..0000000 --- a/config/pikul_codes.tag +++ /dev/null @@ -1,42 +0,0 @@ -UserTag pikul-codes Order company district city province -UserTag pikul-codes Routine <{PIKUL_ANTERAJA}) { - @provisions = ( - $Global::Variable->{ANTERAJA_ACCESS_KEY_ID}, - $Global::Variable->{ANTERAJA_SECRET_ACCESS_KEY}, - $Global::Variable->{ANTERAJA_BASE_PATH} - ); - $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( - $origin, - $Tag->query({ - sql => "SELECT code FROM $table WHERE district='$district' AND \ - city='$city' AND province='$province'", - wantarray => 1 - })->[0]->[0] || '', - $weight)}; - Pikul::cleanup(); - my $elements = '); - return $elements; -} -EOR diff --git a/pages/ord/checkout.html b/pages/ord/checkout.html index 19617fe..74800cc 100644 --- a/pages/ord/checkout.html +++ b/pages/ord/checkout.html @@ -85,7 +85,7 @@
- [pikul_codes company="__PIKUL_ANTERAJA__" district="[value address2]" city="[value city]" province="[value state]"] + [pikul company="__PIKUL_ANTERAJA__" district="[value address2]" city="[value city]" province="[value state]"]