diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/pikul.tag | 22 |
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 $code</option>"; + . $table . qq(_$code") + . ($Tag->value('mv_shipmode') eq $table . "_$code" ? ' selected' : '') + . ">$table $code</option>"; + } } } - $elements .= q( + if ($widget eq 'select') { + $elements .= q( </select>); + } return $elements; } EOR |