|< 1 2 3 >| | 21 Einträge, 3 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Falls Versand gewählt wurde, müssen die Versandkosten berechnet werden
my $shippingCosts = undef;
my $shippingCostsCD = undef;
my $total = $subtotal;
if ( $orderDigital eq "cdromPost" ) {
$shippingCostsCD = $shipKompakt;
}
if ( ( $orderShipping eq "post" ) || ( $orderDigShipping eq "digPost" ) ) {
$shippingCosts = calculateShipping( $picOptions );
}
# Die höheren Versandkosten sind ausschlaggebend
if ( $shippingCostsCD > $shippingCosts ) {
$total = $total + $shippingCostsCD;
}
else {
$total = $total + $shippingCosts;
}
print "rein\n";
print "raus\n";
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
sub calculateShipping {
my ( $picOptions ) = @_;
my $shippingCosts = undef;
if ( $picOptions->[ 9 ] || $picOptions->[ 8 ] || $picOptions->[ 7 ] || $picOptions->[ 6 ] ) {
$shippingCosts = $shipRolle;
}
elsif ( $picOptions->[ 5 ] ) {
if ( $picOptions->[ 5 ] > 64 ) { $shippingCosts = $shipRolle; }
elsif ( ( $picOptions->[ 5 ] > 32 ) && ( $picOptions->[ 5 ] < 65 ) ) { $shippingCosts = $shipMaxi; }
else { $shippingCosts = $shipKompakt; }
}
elsif ( $picOptions->[ 4 ] || $picOptions->[ 12 ] ) {
my $pictureNr = $picOptions->[ 4 ] + $picOptions->[ 12 ];
if ( $pictureNr > 160 ) { $shippingCosts = $shipRolle; }
elsif ( ( $pictureNr > 87 ) && ( $pictureNr < 161 ) ) { $shippingCosts = $shipMaxi; }
else { $shippingCosts = $shipKompakt; }
}
elsif ( $picOptions->[ 3 ] || $picOptions->[ 2 ] || $picOptions->[ 1 ] || $picOptions->[ 10 ] || $picOptions->[ 10 ] ) {
my $pictureNr = $picOptions->[ 3 ] + $picOptions->[ 2 ] + $picOptions->[ 1 ] + $picOptions->[ 10 ] + $picOptions->[ 11 ];
if ( $pictureNr > 160 ) { $shippingCosts = $shipRolle; }
elsif ( ( $pictureNr > 149 ) && ( $pictureNr < 161 ) ) { $shippingCosts = $shipMaxi; }
elsif ( ( $pictureNr > 13 ) && ( $pictureNr < 150 ) ) { $shippingCosts = $shipGross; }
elsif ( ( $pictureNr > 4 ) && ( $pictureNr < 14 ) ) { $shippingCosts = $shipKompakt; }
else { $shippingCosts = $shipStd; }
}
else { $shippingCosts = $shipKompakt; }
# 2 Nachkommastellen erzeugen, falls nur eine da
if ( $shippingCosts =~ /\.\d$/ ) {
$shippingCosts = $shippingCosts."0";
}
if ( $shippingCosts =~ /^\d$/ ) {
$shippingCosts = $shippingCosts.".00";
}
return ( $shippingCosts );
} # calculateShipping()
1
2
3
4
5
6
7
# 2 Nachkommastellen erzeugen, falls nur eine da
if ( $shippingCosts =~ /\.\d$/ ) {
$shippingCosts = $shippingCosts."0";
}
if ( $shippingCosts =~ /^\d$/ ) {
$shippingCosts = $shippingCosts.".00";
}
$shippingCosts = sprintf("%.2f",$shippingCosts);
Quote# Bestelldaten ändern
elsif ( $cgi->param( 'updateOrder' ) ) {
my ( $updateCartError ) = updateCart( $dbh, $cgi );
unless ( $updateCartError eq "noNumber" ) {
updateOrder( $dbh, $cgi );
}
displayProfile( $dbh, $cgi, $sh );
} # elsif updateOrder
|< 1 2 3 >| | 21 Einträge, 3 Seiten |