UserTag pikul Order widget extra UserTag pikul Routine <value('address2'); my $city = $Tag->value('city'); my $province = $Tag->value('state'); my $weight = 0.0; for my $item (@{$Carts->{main}}) { $weight += $Tag->data('products', 'weight', $item->{code}) * $item->{quantity}; } my (@origins, @destinations, @code_prefixes, @name_prefixes); use Pikul; for (my $company = $::Variable->{PIKUL}; $company < $::Variable->{PIKUL_END}; $company++) { if ($company == $::Variable->{PIKUL}) { $origins[$company] = undef; $destinations[$company] = undef; $code_prefixes[$company] = undef; $name_prefixes[$company] = undef; } elsif ($company == $::Variable->{PIKUL_ANTERAJA}) { my $access_key_id = $::Variable->{ANTERAJA_ACCESS_KEY_ID} || $Global::Variable->{ANTERAJA_ACCESS_KEY_ID}; my $secret_access_key = $::Variable->{ANTERAJA_SECRET_ACCESS_KEY} || $Global::Variable->{ANTERAJA_SECRET_ACCESS_KEY}; my $base_path = $::Variable->{ANTERAJA_BASE_PATH} || $Global::Variable->{ANTERAJA_BASE_PATH}; if (!$access_key_id || !$secret_access_key || !$base_path) { $origins[$company] = undef; $destinations[$company] = undef; $code_prefixes[$company] = undef; $name_prefixes[$company] = undef; next; } Pikul::init($company, [ $access_key_id, $secret_access_key, $base_path ]); $origins[$company] = $::Variable->{ANTERAJA_ORIGIN} || $Global::Variable->{ANTERAJA_ORIGIN}; $destinations[$company] = $Tag->query({sql => "SELECT code FROM anteraja WHERE \ district='$district' AND city='$city' AND province='$province'", wantarray => 1})->[0]->[0] || ''; $code_prefixes[$company] = 'anteraja_'; $name_prefixes[$company] = 'Anteraja '; } } my $elements = Pikul::html( \@origins, \@destinations, $weight, $widget, $extra, 'mv_shipmode', $Tag->value('mv_shipmode'), \@code_prefixes, \@name_prefixes ); Pikul::cleanup(); return $elements; } EOR