%once> use JSON::XS; my $json = JSON::XS->new->utf8; %once> <%args> $name => undef $rusname => undef $check => undef %args> <%init> my $fields = $check ? $json->decode($check) : {}; my @fields; while ( my ($reg_id, $cost) = each %$fields ) { push @fields, { region => $reg_id, cost => $cost }; } @fields = sort { int($a->{cost}) <=> int($b->{cost}) } @fields; my $regions = $keeper->get_documents ( class => 'webshop::Area', status => 1, order_by => 'name', return_mode => 'array_ref', ); my %pid = map { $_->pid => 1 } @$regions; my @pid = keys %pid; my $countries = @pid ? $keeper->get_documents ( id => \@pid, class => 'webshop::Country', return_mode => 'hash_ref', ) : {}; $m->out(''); $m->out('
Регион: | ');
$m->out('Стоимость доставки (число): |
---|