diff --git a/lib/CF2022/Controller/Orders.pm b/lib/CF2022/Controller/Orders.pm index 94f78d4e925387fa6bb00a536504a33443294334..dbbafe78733e8003511279d87c3314362acf8945 100644 --- a/lib/CF2022/Controller/Orders.pm +++ b/lib/CF2022/Controller/Orders.pm @@ -24,7 +24,7 @@ sub create ($c ) { my $pt = {}; CLASS: foreach my $class ( qw(main nonfree subsidy) ) { - foreach my $id ( split /\D+/, $cfg->{"products_$class"} ) { + foreach my $id ( split /\D+/, $c->config->{"products_$class"} ) { $pt->{$class}{$id} = 1; } } @@ -105,7 +105,7 @@ sub create ($c ) { $product->{id} = $accreditation; } elsif ( $pt->{nonfree}{ $product->{id} } ) { - $product->{id} = $cfg->{products_fallback}; + $product->{id} = $c->config->{products_fallback}; } } @@ -114,7 +114,7 @@ sub create ($c ) { } # fallback akreditace - @products = ( { id => $cfg->{products_fallback} }, @products ) if ! $accredited; + @products = ( { id => $c->config->{products_fallback} }, @products ) if ! $accredited; my $order = { email => $args->{email}, @@ -149,7 +149,7 @@ sub create ($c ) { company => $args->{company}, }; - $item->{answers} = \@answers if $product->{id} =~ MAIN_PRODUCTS; + $item->{answers} = \@answers if $pt->{main}{$product->{id}}; push @{ $order->{positions} }, $item; }