[set help_name]shipping.edit[/set] [set ui_class]Admin[/set] [seti page_title][L]Shipping options[/L]: [msg arg.0="[cgi ui_shipmode]"]edit method %s[/msg][/seti] [seti page_banner][L]Shipping options[/L]: [msg arg.0="[cgi ui_shipmode]"]edit method %s[/msg][/seti] [set page_perm]shipping[/set] [set icon_name]icon_config.gif[/set] [set meta_header] [/set] @_UI_STD_HEAD_@ [if scratch ui_update_shipping] [set ui_update_shipping][/set] [bounce page="[either][cgi ui_bounce_url][or]__UI_BASE__/ship[/either]"] [/if] [if cgi ui_bounce_url] [bounce page="[either][cgi ui_bounce_url][or]__UI_BASE__/ship[/either]"] [/if] [perl] my $inmode = $CGI->{ui_shipmode}; #Log("inmode=$inmode"); my $lines = $Config->{Shipping_line}; #Log("shipping: " . $Tag->uneval( { ref => $lines }) ); my $ref; if($inmode) { for(@$lines) { next unless $_->[0] eq $inmode; $ref = $_; last; } } $ref = [] if ! $ref; my ($mode, $desc, $crit, $min, $max, $cost, $query, $opt) = @{$ref}; #Log("gave: " . join("|", @$ref) ); $opt = {} if ! ref $opt; if ($opt->{ui_ship_type}) { #Log("ui_ship_type: $opt->{ui_ship_type}"); $Values->{ui_ship_type} = $opt->{ui_ship_type}; } elsif ( not $Values->{ui_ship_type} = $CGI->{ui_ship_type} ) { if(! $crit) { # do nothing; } elsif($crit eq 'weight') { $Values->{ui_ship_type} = 'weight'; } elsif($crit eq 'volume') { $Values->{ui_ship_type} = 'volume'; } elsif($crit eq 'quantity') { $Values->{ui_ship_type} = 'quantity'; } elsif($crit =~ /^\[subtotal/) { $Values->{ui_ship_type} = '_subtotal'; } else { $Values->{ui_ship_type} = "custom"; $Values->{ui_ship_custom_criteria} = $crit; } } $Values->{ui_ship_message} = $cost; $Values->{ui_ship_description} = $desc; $Values->{ui_ship_ups} = $Values->{ui_ship_type} =~ /^ups/i ? 1 : 0; $Values->{ui_ship_ups_external} = $Values->{ui_ship_type} =~ /^upse/i ? 1 : 0; $Values->{ui_ship_ups_internal} = $Values->{ui_ship_type} =~ /^upsi/i ? 1 : 0; if(! $crit and $Values->{ui_ship_ups}) { $crit = 'weight'; } $Values->{ui_ship_criteria} = $crit; my (@straight) = qw/zone adder at_least origin round table geo free/; for(@straight) { $Values->{"ui_ship_$_"} = $opt->{$_}; } return; [/perl]
@_UI_STD_FOOTER_@