[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] [form-session-id]

[L]Name of this method[/L] ([L]letters/digits only[/L]) |
[L]Label for this method[/L] |
[L]Total based on this criteria[/L] |
[L]Calculate based on this algorithm[/L] |

[L]Apply this method by country[/L]
([L]select as many as desired[/L])

[calc] $modes = <<'EOF'; [loop lr=1 search=" ra=yes fi=country st=db ml=1000 rf=code,shipmodes "][loop-line] [/loop] EOF my $mode = $CGI->{ui_shipmode}; my (@c) = map { s/\t.*//; $_ } grep /\b$mode\b/, split /\n/, $modes; $Values->{ui_ship_country} = join "\0", @c; return; [/calc]
[msg arg.0="" arg.1=""]%sexcept%s these countries[/msg]

[L]Minimum shipping charge[/L] |
[L]Additional shipping calculation[/L] (number only is additional charge) |
Round up to nearest even [L currency_symbol]$[/L] |
[L]Allow to be zero cost[/L] |
[L]Message when zero[/L] |
[if value ui_ship_ups] [if value ui_ship_ups_internal] [seti available_ups_internal][available_ups_internal][/seti]
[L]UPS Zone chart[/L] |
[L]Table for lookups[/L] |
[else]
[L]UPS Origin Zone[/L][if variable UPS_ORIGIN] (default __UPS_ORIGIN__)[/if] |
[/else] [/if]
[L]Field that chooses UPS destination[/L][if variable UPS_POSTCODE_FIELD] (default __UPS_POSTCODE_FIELD__)[/if] |
[/if]

[button text="[L]Finished[/L]"] do_update_cmd=Ok [/button] [button text="[L]Next -->[/L]"] do_update_cmd=Ok ui_bounce_url=__UI_BASE__/ship_data [/button] [button text="[L]Cancel ship edit[/L]"] mv_nextpage=__UI_BASE__/ship mv_todo=back [/button]

@_UI_STD_FOOTER_@