[set help_name]shipping.data[/set] [set ui_class]Admin[/set] [seti page_title]Shipping options: edit data for method [cgi ui_shipmode][/seti] [seti page_banner]Shipping options: edit data for method [cgi ui_shipmode][/seti] [set page_perm]shipping[/set] [set icon_name]icon_config.gif[/set] @_UI_STD_HEAD_@ [if scratch ui_update_shipping] [set ui_update_shipping][/set] [/if] [if cgi ui_bounce_to] [bounce page="[cgi ui_bounce_to]"] [/if] [form-session-id]

[perl] $CGI->{ui_shipmode} ||= $Values->{ui_shipmode}; my $inmode = $CGI->{ui_shipmode}; #Log("ship_data inmode=$inmode"); my $lines = $Config->{Shipping_line}; my $ref; my (@modes); for(@$lines) { next unless $_->[0] eq $inmode; push (@modes, $_); } my ($master) = shift @modes; #Log("gave: " . join("|", @$master) ); my $opt = $master->[7]; $opt = {} if ! ref $opt; if ($opt->{ui_ship_type}) { #Log("ui_ship_type: $opt->{ui_ship_type}"); } my $algomessage = $master->[2]; if ($algomessage =~ /\[subtotal\snoformat=1\]/) { $algomessage = 'total price'; } elsif ($algomessage eq 'quantity') { $algomessage = 'total number'; } if($algomessage) { $algomessage = <$algomessage of items in cart. EOF } my @out; push (@out, < | [cgi ui_shipmode] -- [shipping-desc mode="[cgi ui_shipmode]"] Borderline values are rounded up the next bracket. $algomessage
Start range | End range | Charge type | Charge amount |
EOF my $idx = -1; my $prev_max; @types = ( '' => 'Number', f => 'Formula', '!' => 'UPS/FedEx WWW Lookup', x => 'Multiply by', u => 'Internal UPS', e => 'Message', ); if(! @modes) { if ($opt->{ui_ship_type} =~ /^UPSE:(.*)/) { push @modes, [ $inmode, $master->[1], $master->[2], 0, 150, "f [ups-query mode=$1 weight=" . '@@TOTAL' . '@@]', '', $opt, ], [ $inmode, $master->[1], $master->[2], 150, 9999999, "e Too heavy for UPS", '', $opt, ]; } elsif ($opt->{ui_ship_type} =~ /^FEDE:(.*)/) { push @modes, [ $inmode, $master->[1], $master->[2], 0, 150, "f [fedex-query mode=$1 cache=1 weight=" . '@@TOTAL' . '@@]', '', $opt, ], [ $inmode, $master->[1], $master->[2], 150, 9999999, "e Too heavy for FedEx", '', $opt, ]; } elsif ($opt->{ui_ship_type} =~ /^UPSI/) { push @modes, [ $inmode, $master->[1], $master->[2], 0, 150, "u", '', $opt, ], [ $inmode, $master->[1], $master->[2], 150, 9999999, "e Too heavy for UPS", '', $opt, ]; } else { push @modes, [ $inmode, $master->[1], '', 0, 9999999, 0, '', $opt, ]; } } for(@modes) { my $ref = $_; $idx++; $ref->[3] = $prev_max if $ref->[3] < 1 or $ref->[3] > 99999; $ref->[3] = 0 if ! $ref->[3]; $ref->[4] = 9999999 if ! length $ref->[4]; if ($ref->[4] > 9999998 and ! $modes[$idx + 1]) { $max_display = qq{(infinity)}; $class = 'rborder'; } else { $max_display = qq{}; $class = 'rnorm'; } $out = < |  | $max_display |  |  | EOF push @out, $out; } return join("\n\n", @out); [/perl]

[set [L]Back[/L]] mv_nextpage=__UI_BASE__/ship price_ok=0 [/set] [set [L]Finished[/L]] ui_bounce_to=__UI_BASE__/ship [/set]

@_UI_STD_FOOTER_@