summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-20 19:43:32 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-20 19:43:32 +0800
commit89e5f9be28448e62e85b2b7d53c9c06c9528cc50 (patch)
tree2ca2ca08f2d077e5f7a04177c51b16929fa40387 /config
parent126a16b71989ed0f2e887a61d68c3cdac9d62d7d (diff)
select option are only if select
Diffstat (limited to 'config')
-rw-r--r--config/pikul.tag22
1 files changed, 13 insertions, 9 deletions
diff --git a/config/pikul.tag b/config/pikul.tag
index 343e50b..3c8f455 100644
--- a/config/pikul.tag
+++ b/config/pikul.tag
@@ -2,6 +2,10 @@ UserTag pikul Order widget extra
UserTag pikul Routine <<EOR
sub {
my ($widget, $extra) = @_;
+ my $elements;
+ if ($widget eq 'select') {
+ $elements = '<select name="mv_shipmode"' . ($extra ? " $extra" : '') . '>';
+ }
my $district = $Tag->value('address2');
my $city = $Tag->value('city');
my $province = $Tag->value('state');
@@ -9,10 +13,6 @@ sub {
for my $item (@{$Carts->{main}}) {
$weight += $Tag->data('products', 'weight', $item->{code}) * $item->{quantity};
}
- my $elements;
- if ($widget eq 'select') {
- $elements = '<select name="mv_shipmode"' . ($extra ? " $extra" : '') . '>';
- }
use Pikul;
for (my $company = $::Variable->{PIKUL_ANTERAJA}; $company <= $::Variable->{PIKUL_ANTERAJA};
$company++) {
@@ -34,15 +34,19 @@ sub {
$weight)};
Pikul::cleanup();
for my $code (@codes) {
- $elements .= q(
+ if ($widget eq 'select') {
+ $elements .= q(
<option value=")
- . $table . qq(_$code")
- . ($Tag->value('mv_shipmode') eq $table . "_$code" ? ' selected' : '')
- . ">$table&nbsp;$code</option>";
+ . $table . qq(_$code")
+ . ($Tag->value('mv_shipmode') eq $table . "_$code" ? ' selected' : '')
+ . ">$table&nbsp;$code</option>";
+ }
}
}
- $elements .= q(
+ if ($widget eq 'select') {
+ $elements .= q(
</select>);
+ }
return $elements;
}
EOR