From 7a2a4da3e91d0aa5a681f063845b68f4e49ea704 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: Wed, 7 Jul 2021 23:03:09 +0800 Subject: Anteraja cost usertag --- products/ship/shipping.asc | 5 +++++ usertag/anteraja_cost.tag | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 products/ship/shipping.asc create mode 100644 usertag/anteraja_cost.tag diff --git a/products/ship/shipping.asc b/products/ship/shipping.asc new file mode 100644 index 0000000..fced578 --- /dev/null +++ b/products/ship/shipping.asc @@ -0,0 +1,5 @@ +anteraja: Anteraja + crit weight + min 1000 + max 50000 + cost f [anteraja_cost district='[evalue address3]' city='[evalue city]' province='[evalue state]' weight=@@TOTAL@@] diff --git a/usertag/anteraja_cost.tag b/usertag/anteraja_cost.tag new file mode 100644 index 0000000..0cb143b --- /dev/null +++ b/usertag/anteraja_cost.tag @@ -0,0 +1,16 @@ +UserTag anteraja_cost Order prod_group district city province weight +UserTag anteraja_cost Routine <query({sql => "SELECT code FROM \ + shipping WHERE district='". __DISTRICT__ ."' AND city='" + . __CITY__ . "' AND province='" . __PROVINCE__ . "'", wantarray + => 1})->[0]->[0]; + my $destination = $Tag->query({sql => "SELECT code FROM shipping WHERE district='" . $district + . "' AND city='" . $city . "' AND province='" . $province . "'", + wantarray=> 1})->[0]->[0]; + return $Tag->pikul_cost(0, \@provisions, "$origin", "$destination", $weight, 'REG'); +} +EOR -- cgit v1.2.3