You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Below is a basic shipping script for UPS based on weight... and the country being United States.
Is it possible mod this so if the ship country is United States AND the ship state is either Hawaii or Alaska, it adds a value to the cost?
So if it ships to those two states it takes the cost and adds say $10 to each level...... and if it ships to any of the other "else" 48 states it leaves the costs as is?
Rachel?
$custom_code_result = ""; my $match = ""; my %countries = ( 'united states' => "match", ); if ($countries{lc($fd_trackitem_shipcountry)} eq "match") { $match = "true"; my $ship_meth_name_1 = ""; my $ship_total_1 = ""; my $ship_display_1 = ""; $ship_meth_name_1 = "UPS Ground"; if ($item_total_weight > 0 && $item_total_weight <= 1 ) { $ship_total_1 = "9.95"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 2 ) { $ship_total_1 = "12.57"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 4 ) { $ship_total_1 = "0.00"; } elsif ( $item_total_weight > 2 && $item_total_weight <= 6 ) { $ship_total_1 = "0.00"; } elsif ( $item_total_weight > 3 && $item_total_weight <= 8 ) { $ship_total_1 = "0.00"; } elsif ( $item_total_weight > 4 && $item_total_weight <= 10 ) { $ship_total_1 = "0.00"; } elsif ( $item_total_weight > 5 && $item_total_weight <= 12 ) { $ship_total_1 = "0.00"; } elsif ( $item_total_weight > 6 && $item_total_weight <= 14 ) { $ship_total_1 = "0.00"; } elsif ( $item_total_weight > 7 && $item_total_weight <= 16 ) { $ship_total_1 = "0.00"; } else { $ship_total_1 = "0.00"; } if ($ship_total_1 eq "0.00") { $ship_display_1 = "$ship_meth_name_1 \- $currency_symbol$ship_total_1"; } elsif ($ship_total_1 ne "") { $ship_total_1 = sprintf("%.2f", $ship_total_1); $ship_display_1 = "$ship_meth_name_1 \- $currency_symbol$ship_total_1"; } # End logic for ship method 1 if ($ship_display_1 ne "") { $custom_code_result .= <<ENDOFTEXT; <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name_1:$ship_total_1" CHECKED> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_1<br /></FONT> ENDOFTEXT } # End ship method 1 }
Offline
Try this if you want... no guarantee, no test... use at your own risk.
$custom_code_result = ""; my $match = ""; my $state_match = ""; my %countries = ( 'united states' => "match", ); my %states = ( 'alaska' => "match", 'hawaii' => "match", ); if ($countries{lc($fd_trackitem_shipcountry)} eq "match") { $match = "true"; my $ship_meth_name_1 = ""; my $ship_total_1 = ""; my $ship_display_1 = ""; ### This Section for Alaska, Hawaii if ($states{lc($fd_trackitem_shipstateprov)} eq "match") { $state_match = "true"; $ship_meth_name_1 = "AL/HI Shipping Method Name"; ### Change Name Here if ($item_total_weight > 0 && $item_total_weight <= 1 ) { $ship_total_1 = "19.95"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 2 ) { $ship_total_1 = "22.57"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 4 ) { $ship_total_1 = "10.00"; } elsif ( $item_total_weight > 2 && $item_total_weight <= 6 ) { $ship_total_1 = "10.00"; } elsif ( $item_total_weight > 3 && $item_total_weight <= 8 ) { $ship_total_1 = "10.00"; } elsif ( $item_total_weight > 4 && $item_total_weight <= 10 ) { $ship_total_1 = "10.00"; } elsif ( $item_total_weight > 5 && $item_total_weight <= 12 ) { $ship_total_1 = "10.00"; } elsif ( $item_total_weight > 6 && $item_total_weight <= 14 ) { $ship_total_1 = "10.00"; } elsif ( $item_total_weight > 7 && $item_total_weight <= 16 ) { $ship_total_1 = "10.00"; } else { $ship_total_1 = "0.00"; } ## endif (rate selection) } else { ### This section for all other states $ship_meth_name_1 = "UPS Ground"; if ($item_total_weight > 0 && $item_total_weight <= 1 ) { $ship_total_1 = "9.95"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 2 ) { $ship_total_1 = "12.57"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 4 ) { $ship_total_1 = "0.00"; } elsif ( $item_total_weight > 2 && $item_total_weight <= 6 ) { $ship_total_1 = "0.00"; } elsif ( $item_total_weight > 3 && $item_total_weight <= 8 ) { $ship_total_1 = "0.00"; } elsif ( $item_total_weight > 4 && $item_total_weight <= 10 ) { $ship_total_1 = "0.00"; } elsif ( $item_total_weight > 5 && $item_total_weight <= 12 ) { $ship_total_1 = "0.00"; } elsif ( $item_total_weight > 6 && $item_total_weight <= 14 ) { $ship_total_1 = "0.00"; } elsif ( $item_total_weight > 7 && $item_total_weight <= 16 ) { $ship_total_1 = "0.00"; } else { $ship_total_1 = "0.00"; } ## endif (rate selection) } ## endif (state selection) if ($ship_total_1 eq "0.00") { $ship_display_1 = "$ship_meth_name_1 \- $currency_symbol$ship_total_1"; } elsif ($ship_total_1 ne "") { $ship_total_1 = sprintf("%.2f", $ship_total_1); $ship_display_1 = "$ship_meth_name_1 \- $currency_symbol$ship_total_1"; } # End logic for ship method 1 if ($ship_display_1 ne "") { $custom_code_result .= <<ENDOFTEXT; <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name_1:$ship_total_1" CHECKED> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_1<br /></FONT> ENDOFTEXT } # End ship method 1 } ## endif (country selection)
Offline
Well here is the full blown thing.
Decides if it is United States and then state of HI or AK, or lower 48 states.
Decides if it is Canada.
Decides if it is Puerto Rico.
Calculates rate by weight.
$custom_code_result = ""; my $match = ""; my $state_match = ""; my %countries = ( 'united states' => "match", ); my %states = ( 'alaska' => "match", 'hawaii' => "match", ); if ($countries{lc($fd_trackitem_shipcountry)} eq "match") { $match = "true"; my $ship_meth_name_1 = ""; my $ship_total_1 = ""; my $ship_display_1 = ""; if ($states{lc($fd_trackitem_shipstateprov)} eq "match") { $state_match = "true"; ### This section for HI,AK Ground $ship_meth_name_1 = "UPS Ground"; if ($item_total_weight > 0 && $item_total_weight <= 1 ) { $ship_total_1 = "19.95"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 2 ) { $ship_total_1 = "23.87"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 4 ) { $ship_total_1 = "27.87"; } elsif ( $item_total_weight > 2 && $item_total_weight <= 6 ) { $ship_total_1 = "31.87"; } elsif ( $item_total_weight > 3 && $item_total_weight <= 8 ) { $ship_total_1 = "35.87"; } elsif ( $item_total_weight > 4 && $item_total_weight <= 10 ) { $ship_total_1 = "39.87"; } elsif ( $item_total_weight > 5 && $item_total_weight <= 12 ) { $ship_total_1 = "43.87"; } elsif ( $item_total_weight > 6 && $item_total_weight <= 14 ) { $ship_total_1 = "47.87"; } elsif ( $item_total_weight > 7 && $item_total_weight <= 16 ) { $ship_total_1 = "51.87"; } else { $ship_total_1 = "55.87"; } if ($ship_total_1 eq "0.00") { $ship_display_1 = "$ship_meth_name_1 \- $currency_symbol$ship_total_1"; } elsif ($ship_total_1 ne "") { $ship_total_1 = sprintf("%.2f", $ship_total_1); $ship_display_1 = "$ship_meth_name_1 \- $currency_symbol$ship_total_1"; } # End logic for ship method 1 if ($ship_display_1 ne "") { $custom_code_result .= <<ENDOFTEXT; <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name_1:$ship_total_1" CHECKED> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_1<br /></FONT> ENDOFTEXT } } else { ### This section for all other states Ground my $ship_meth_name_1 = ""; my $ship_total_1 = ""; my $ship_display_1 = ""; $ship_meth_name_1 = "UPS Ground"; if ($item_total_weight > 0 && $item_total_weight <= 1 ) { $ship_total_1 = "9.95"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 2 ) { $ship_total_1 = "12.57"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 4 ) { $ship_total_1 = "0.00"; } elsif ( $item_total_weight > 2 && $item_total_weight <= 6 ) { $ship_total_1 = "0.00"; } elsif ( $item_total_weight > 3 && $item_total_weight <= 8 ) { $ship_total_1 = "0.00"; } elsif ( $item_total_weight > 4 && $item_total_weight <= 10 ) { $ship_total_1 = "0.00"; } elsif ( $item_total_weight > 5 && $item_total_weight <= 12 ) { $ship_total_1 = "0.00"; } elsif ( $item_total_weight > 6 && $item_total_weight <= 14 ) { $ship_total_1 = "0.00"; } elsif ( $item_total_weight > 7 && $item_total_weight <= 16 ) { $ship_total_1 = "0.00"; } else { $ship_total_1 = "0.00"; } if ($ship_total_1 eq "0.00") { $ship_display_1 = "$ship_meth_name_1 \- $currency_symbol$ship_total_1"; } elsif ($ship_total_1 ne "") { $ship_total_1 = sprintf("%.2f", $ship_total_1); $ship_display_1 = "$ship_meth_name_1 \- $currency_symbol$ship_total_1"; } # End logic for ship method 1 if ($ship_display_1 ne "") { $custom_code_result .= <<ENDOFTEXT; <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name_1:$ship_total_1" CHECKED> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_1<br /></FONT> ENDOFTEXT } } # End ship method 1 my $ship_meth_name_2 = ""; my $ship_total_2 = ""; my $ship_display_2 = ""; if ($states{lc($fd_trackitem_shipstateprov)} eq "match") { $state_match = "true"; ### This section for HI,AK 3 Day Select $ship_meth_name_2 = "UPS 3 Day Select"; if ($item_total_weight > 0 && $item_total_weight <= 2 ) { $ship_total_2 = "29.95"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 4 ) { $ship_total_2 = "33.95"; } elsif ( $item_total_weight > 2 && $item_total_weight <= 6 ) { $ship_total_2 = "37.95"; } elsif ( $item_total_weight > 3 && $item_total_weight <= 8 ) { $ship_total_2 = "41.95"; } elsif ( $item_total_weight > 4 && $item_total_weight <= 10 ) { $ship_total_2 = "45.95"; } elsif ( $item_total_weight > 5 && $item_total_weight <= 12 ) { $ship_total_2 = "49.95"; } elsif ( $item_total_weight > 6 && $item_total_weight <= 14 ) { $ship_total_2 = "53.95"; } elsif ( $item_total_weight > 7 && $item_total_weight <= 16 ) { $ship_total_2 = "57.95"; } else { $ship_total_2 = "61.95"; } if ($ship_total_2 eq "0.00") { $ship_display_2 = "Free Shipping"; } elsif ($ship_total_2 ne "") { $ship_total_2 = sprintf("%.2f", $ship_total_2); $ship_display_2 = "$ship_meth_name_2 \- $currency_symbol$ship_total_2"; } # End logic for ship method 2 if ($ship_display_2 ne "") { $custom_code_result .= <<ENDOFTEXT; <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name_2:$ship_total_2"> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_2<br /></FONT> ENDOFTEXT } } else { ### This section for all other states 3 Day Select my $ship_meth_name_2 = ""; my $ship_total_2 = ""; my $ship_display_2 = ""; $ship_meth_name_2 = "UPS 3 Day Select"; if ($item_total_weight > 0 && $item_total_weight <= 2 ) { $ship_total_2 = "19.95"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 4 ) { $ship_total_2 = "23.95"; } elsif ( $item_total_weight > 2 && $item_total_weight <= 6 ) { $ship_total_2 = "27.95"; } elsif ( $item_total_weight > 3 && $item_total_weight <= 8 ) { $ship_total_2 = "31.95"; } elsif ( $item_total_weight > 4 && $item_total_weight <= 10 ) { $ship_total_2 = "35.95"; } elsif ( $item_total_weight > 5 && $item_total_weight <= 12 ) { $ship_total_2 = "39.95"; } elsif ( $item_total_weight > 6 && $item_total_weight <= 14 ) { $ship_total_2 = "43.95"; } elsif ( $item_total_weight > 7 && $item_total_weight <= 16 ) { $ship_total_2 = "47.95"; } else { $ship_total_2 = "51.95"; } if ($ship_total_2 eq "0.00") { $ship_display_2 = "Free Shipping"; } elsif ($ship_total_2 ne "") { $ship_total_2 = sprintf("%.2f", $ship_total_2); $ship_display_2 = "$ship_meth_name_2 \- $currency_symbol$ship_total_2"; } # End logic for ship method 2 if ($ship_display_2 ne "") { $custom_code_result .= <<ENDOFTEXT; <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name_2:$ship_total_2"> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_2<br /></FONT> ENDOFTEXT } } # End ship method 2 my $ship_meth_name_3 = ""; my $ship_total_3 = ""; my $ship_display_3 = ""; if ($states{lc($fd_trackitem_shipstateprov)} eq "match") { $state_match = "true"; ### This section for HI,AK 2nd Day Air $ship_meth_name_3 = "UPS 2nd Day Air"; if ($item_total_weight > 0 && $item_total_weight <= 2 ) { $ship_total_3 = "36.95"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 4 ) { $ship_total_3 = "40.95"; } elsif ( $item_total_weight > 2 && $item_total_weight <= 6 ) { $ship_total_3 = "44.95"; } elsif ( $item_total_weight > 3 && $item_total_weight <= 8 ) { $ship_total_3 = "53.95"; } elsif ( $item_total_weight > 4 && $item_total_weight <= 10 ) { $ship_total_3 = "57.96"; } elsif ( $item_total_weight > 5 && $item_total_weight <= 12 ) { $ship_total_3 = "61.95"; } elsif ( $item_total_weight > 6 && $item_total_weight <= 14 ) { $ship_total_3 = "65.95"; } elsif ( $item_total_weight > 7 && $item_total_weight <= 16 ) { $ship_total_3 = "69.95"; } else { $ship_total_3 = "73.95"; } if ($ship_total_3 eq "0.00") { $ship_display_3 = "Free Shipping"; } elsif ($ship_total_3 ne "") { $ship_total_3 = sprintf("%.2f", $ship_total_3); $ship_display_3 = "$ship_meth_name_3 \- $currency_symbol$ship_total_3"; } # End logic for ship method 3 if ($ship_display_3 ne "") { $custom_code_result .= <<ENDOFTEXT; <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name_3:$ship_total_3"> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_3<br /></FONT> ENDOFTEXT } } else { ### This section for all other states 2nd Day Air my $ship_meth_name_3 = ""; my $ship_total_3 = ""; my $ship_display_3 = ""; $ship_meth_name_3 = "UPS 2nd Day Air"; if ($item_total_weight > 0 && $item_total_weight <= 2 ) { $ship_total_3 = "26.95"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 4 ) { $ship_total_3 = "30.95"; } elsif ( $item_total_weight > 2 && $item_total_weight <= 6 ) { $ship_total_3 = "34.95"; } elsif ( $item_total_weight > 3 && $item_total_weight <= 8 ) { $ship_total_3 = "43.95"; } elsif ( $item_total_weight > 4 && $item_total_weight <= 10 ) { $ship_total_3 = "47.96"; } elsif ( $item_total_weight > 5 && $item_total_weight <= 12 ) { $ship_total_3 = "51.95"; } elsif ( $item_total_weight > 6 && $item_total_weight <= 14 ) { $ship_total_3 = "55.95"; } elsif ( $item_total_weight > 7 && $item_total_weight <= 16 ) { $ship_total_3 = "59.95"; } else { $ship_total_3 = "63.95"; } if ($ship_total_3 eq "0.00") { $ship_display_3 = "Free Shipping"; } elsif ($ship_total_3 ne "") { $ship_total_3 = sprintf("%.2f", $ship_total_3); $ship_display_3 = "$ship_meth_name_3 \- $currency_symbol$ship_total_3"; } # End logic for ship method 3 if ($ship_display_3 ne "") { $custom_code_result .= <<ENDOFTEXT; <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name_3:$ship_total_3"> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_3<br /></FONT> ENDOFTEXT } } # End ship method 3 my $ship_meth_name_4 = ""; my $ship_total_4 = ""; my $ship_display_4 = ""; if ($states{lc($fd_trackitem_shipstateprov)} eq "match") { $state_match = "true"; ### This section for HI,AK Next Day Air Saver $ship_meth_name_4 = "UPS Next Day Air Saver By 5pm."; if ($item_total_weight > 0 && $item_total_weight <= 2 ) { $ship_total_4 = "57.95"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 4 ) { $ship_total_4 = "65.95"; } elsif ( $item_total_weight > 2 && $item_total_weight <= 6 ) { $ship_total_4 = "73.95"; } elsif ( $item_total_weight > 3 && $item_total_weight <= 8 ) { $ship_total_4 = "81.95"; } elsif ( $item_total_weight > 4 && $item_total_weight <= 10 ) { $ship_total_4 = "89.95"; } elsif ( $item_total_weight > 5 && $item_total_weight <= 12 ) { $ship_total_4 = "97.95"; } elsif ( $item_total_weight > 6 && $item_total_weight <= 14 ) { $ship_total_4 = "105.95"; } elsif ( $item_total_weight > 7 && $item_total_weight <= 16 ) { $ship_total_4 = "113.95"; } else { $ship_total_4 = "121.95"; } if ($ship_total_4 eq "0.00") { $ship_display_4 = "Free Shipping"; } elsif ($ship_total_4 ne "") { $ship_total_4 = sprintf("%.2f", $ship_total_4); $ship_display_4 = "$ship_meth_name_4 \- $currency_symbol$ship_total_4"; } # End logic for ship method 4 if ($ship_display_4 ne "") { $custom_code_result .= <<ENDOFTEXT; <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name_4:$ship_total_4"> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_4<br /></FONT> ENDOFTEXT } } else { ### This section for all other states Next Day Air Saver my $ship_meth_name_4 = ""; my $ship_total_4 = ""; my $ship_display_4 = ""; $ship_meth_name_4 = "UPS Next Day Air Saver By 5pm."; if ($item_total_weight > 0 && $item_total_weight <= 2 ) { $ship_total_4 = "47.95"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 4 ) { $ship_total_4 = "55.95"; } elsif ( $item_total_weight > 2 && $item_total_weight <= 6 ) { $ship_total_4 = "63.95"; } elsif ( $item_total_weight > 3 && $item_total_weight <= 8 ) { $ship_total_4 = "71.95"; } elsif ( $item_total_weight > 4 && $item_total_weight <= 10 ) { $ship_total_4 = "79.95"; } elsif ( $item_total_weight > 5 && $item_total_weight <= 12 ) { $ship_total_4 = "87.95"; } elsif ( $item_total_weight > 6 && $item_total_weight <= 14 ) { $ship_total_4 = "95.95"; } elsif ( $item_total_weight > 7 && $item_total_weight <= 16 ) { $ship_total_4 = "103.95"; } else { $ship_total_4 = "111.95"; } if ($ship_total_4 eq "0.00") { $ship_display_4 = "Free Shipping"; } elsif ($ship_total_4 ne "") { $ship_total_4 = sprintf("%.2f", $ship_total_4); $ship_display_4 = "$ship_meth_name_4 \- $currency_symbol$ship_total_4"; } # End logic for ship method 4 if ($ship_display_4 ne "") { $custom_code_result .= <<ENDOFTEXT; <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name_4:$ship_total_4"> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_4<br /></FONT> ENDOFTEXT } } # End ship method 4 my $ship_meth_name_5 = ""; my $ship_total_5 = ""; my $ship_display_5 = ""; if ($states{lc($fd_trackitem_shipstateprov)} eq "match") { $state_match = "true"; ### This section for HI,AK Next Day Air $ship_meth_name_5 = "UPS Next Day Air By 10am."; if ($item_total_weight > 0 && $item_total_weight <= 2 ) { $ship_total_5 = "61.95"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 4 ) { $ship_total_5 = "69.95"; } elsif ( $item_total_weight > 2 && $item_total_weight <= 6 ) { $ship_total_5 = "77.95"; } elsif ( $item_total_weight > 3 && $item_total_weight <= 8 ) { $ship_total_5 = "85.95"; } elsif ( $item_total_weight > 4 && $item_total_weight <= 10 ) { $ship_total_5 = "93.95"; } elsif ( $item_total_weight > 5 && $item_total_weight <= 12 ) { $ship_total_5 = "101.95"; } elsif ( $item_total_weight > 6 && $item_total_weight <= 14 ) { $ship_total_5 = "109.95"; } elsif ( $item_total_weight > 7 && $item_total_weight <= 16 ) { $ship_total_5 = "117.95"; } else { $ship_total_5 = "125.95"; } if ($ship_total_5 eq "0.00") { $ship_display_5 = "Free Shipping"; } elsif ($ship_total_5 ne "") { $ship_total_5 = sprintf("%.2f", $ship_total_5); $ship_display_5 = "$ship_meth_name_5 \- $currency_symbol$ship_total_5"; } # End logic for ship method 5 if ($ship_display_5 ne "") { $custom_code_result .= <<ENDOFTEXT; <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name_5:$ship_total_5"> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_5<br /></FONT> ENDOFTEXT } } else { ### This section for all other states Next Day Air my $ship_meth_name_5 = ""; my $ship_total_5 = ""; my $ship_display_5 = ""; $ship_meth_name_5 = "UPS Next Day Air By 10am."; if ($item_total_weight > 0 && $item_total_weight <= 2 ) { $ship_total_5 = "51.95"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 4 ) { $ship_total_5 = "59.95"; } elsif ( $item_total_weight > 2 && $item_total_weight <= 6 ) { $ship_total_5 = "67.95"; } elsif ( $item_total_weight > 3 && $item_total_weight <= 8 ) { $ship_total_5 = "75.95"; } elsif ( $item_total_weight > 4 && $item_total_weight <= 10 ) { $ship_total_5 = "83.95"; } elsif ( $item_total_weight > 5 && $item_total_weight <= 12 ) { $ship_total_5 = "91.95"; } elsif ( $item_total_weight > 6 && $item_total_weight <= 14 ) { $ship_total_5 = "99.95"; } elsif ( $item_total_weight > 7 && $item_total_weight <= 16 ) { $ship_total_5 = "107.95"; } else { $ship_total_5 = "115.95"; } if ($ship_total_5 eq "0.00") { $ship_display_5 = "Free Shipping"; } elsif ($ship_total_5 ne "") { $ship_total_5 = sprintf("%.2f", $ship_total_5); $ship_display_5 = "$ship_meth_name_5 \- $currency_symbol$ship_total_5"; } # End logic for ship method 5 if ($ship_display_5 ne "") { $custom_code_result .= <<ENDOFTEXT; <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name_5:$ship_total_5"> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_5<br /></FONT> ENDOFTEXT } } # End ship method 5 } # End Country Selection my %countries = ( 'canada' => "match", ); if ($countries{lc($fd_trackitem_shipcountry)} eq "match") { $match = "true"; my $ship_meth_name_1 = ""; my $ship_total_1 = ""; my $ship_display_1 = ""; $ship_meth_name_1 = "UPS Standard To Canada 5 Bus. Days"; if ($item_total_weight > 0 && $item_total_weight <= 2 ) { $ship_total_1 = "21.95"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 4 ) { $ship_total_1 = "25.95"; } elsif ( $item_total_weight > 2 && $item_total_weight <= 6 ) { $ship_total_1 = "29.95"; } elsif ( $item_total_weight > 3 && $item_total_weight <= 8 ) { $ship_total_1 = "33.95"; } elsif ( $item_total_weight > 4 && $item_total_weight <= 10 ) { $ship_total_1 = "37.95"; } elsif ( $item_total_weight > 5 && $item_total_weight <= 12 ) { $ship_total_1 = "41.95"; } elsif ( $item_total_weight > 6 && $item_total_weight <= 14 ) { $ship_total_1 = "45.95"; } elsif ( $item_total_weight > 7 && $item_total_weight <= 16 ) { $ship_total_1 = "49.95"; } else { $ship_total_1 = "53.95"; } if ($ship_total_1 eq "0.00") { $ship_display_1 = "Free Shipping"; } elsif ($ship_total_1 ne "") { $ship_total_1 = sprintf("%.2f", $ship_total_1); $ship_display_1 = "$ship_meth_name_1 \- $currency_symbol$ship_total_1"; } # End logic for ship method 1 if ($ship_display_1 ne "") { $custom_code_result .= <<ENDOFTEXT; <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name_1:$ship_total_1" CHECKED> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_1<br /></FONT> ENDOFTEXT } # End ship method 1 my $ship_meth_name_2 = ""; my $ship_total_2 = ""; my $ship_display_2 = ""; $ship_meth_name_2 = "UPS Worldwide Expedited 3 Bus. Days"; if ($item_total_weight > 0 && $item_total_weight <= 2 ) { $ship_total_2 = "79.00"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 4 ) { $ship_total_2 = "94.00"; } elsif ( $item_total_weight > 2 && $item_total_weight <= 6 ) { $ship_total_2 = "109.00"; } elsif ( $item_total_weight > 3 && $item_total_weight <= 8 ) { $ship_total_2 = "124.00"; } elsif ( $item_total_weight > 4 && $item_total_weight <= 10 ) { $ship_total_2 = "139.00"; } elsif ( $item_total_weight > 5 && $item_total_weight <= 12 ) { $ship_total_2 = "154.00"; } elsif ( $item_total_weight > 6 && $item_total_weight <= 14 ) { $ship_total_2 = "169.00"; } elsif ( $item_total_weight > 7 && $item_total_weight <= 16 ) { $ship_total_2 = "184.00"; } else { $ship_total_2 = "199.00"; } if ($ship_total_2 eq "0.00") { $ship_display_2 = "Free Shipping"; } elsif ($ship_total_2 ne "") { $ship_total_2 = sprintf("%.2f", $ship_total_2); $ship_display_2 = "$ship_meth_name_2 \- $currency_symbol$ship_total_2"; } # End logic for ship method 2 if ($ship_display_2 ne "") { $custom_code_result .= <<ENDOFTEXT; <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name_2:$ship_total_2"> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_2<br /></FONT> ENDOFTEXT } # End ship method 2 } my %countries = ( 'puerto rico' => "match", ); if ($countries{lc($fd_trackitem_shipcountry)} eq "match") { $match = "true"; my $ship_meth_name_1 = ""; my $ship_total_1 = ""; my $ship_display_1 = ""; $ship_meth_name_1 = "UPS Ground"; if ($item_total_weight > 0 && $item_total_weight <= 2 ) { $ship_total_1 = "36.95"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 4 ) { $ship_total_1 = "41.95"; } elsif ( $item_total_weight > 2 && $item_total_weight <= 6 ) { $ship_total_1 = "45.95"; } elsif ( $item_total_weight > 3 && $item_total_weight <= 8 ) { $ship_total_1 = "49.95"; } elsif ( $item_total_weight > 4 && $item_total_weight <= 10 ) { $ship_total_1 = "53.95"; } elsif ( $item_total_weight > 5 && $item_total_weight <= 12 ) { $ship_total_1 = "57.95"; } elsif ( $item_total_weight > 6 && $item_total_weight <= 14 ) { $ship_total_1 = "61.95"; } elsif ( $item_total_weight > 7 && $item_total_weight <= 16 ) { $ship_total_1 = "65.95"; } else { $ship_total_1 = "69.95"; } if ($ship_total_1 eq "0.00") { $ship_display_1 = "UPS Ground"; } elsif ($ship_total_1 ne "") { $ship_total_1 = sprintf("%.2f", $ship_total_1); $ship_display_1 = "$ship_meth_name_1 \- $currency_symbol$ship_total_1"; } # End logic for ship method 1 if ($ship_display_1 ne "") { $custom_code_result .= <<ENDOFTEXT; <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name_1:$ship_total_1" CHECKED> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_1<br /></FONT> ENDOFTEXT } # End ship method 1 my $ship_meth_name_2 = ""; my $ship_total_2 = ""; my $ship_display_2 = ""; $ship_meth_name_2 = "UPS 2nd Day Air"; if ($item_total_weight > 0 && $item_total_weight <= 2 ) { $ship_total_2 = "44.95"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 4 ) { $ship_total_2 = "53.95"; } elsif ( $item_total_weight > 2 && $item_total_weight <= 6 ) { $ship_total_2 = "62.95"; } elsif ( $item_total_weight > 3 && $item_total_weight <= 8 ) { $ship_total_2 = "71.95"; } elsif ( $item_total_weight > 4 && $item_total_weight <= 10 ) { $ship_total_2 = "80.95"; } elsif ( $item_total_weight > 5 && $item_total_weight <= 12 ) { $ship_total_2 = "89.95"; } elsif ( $item_total_weight > 6 && $item_total_weight <= 14 ) { $ship_total_2 = "98.95"; } elsif ( $item_total_weight > 7 && $item_total_weight <= 16 ) { $ship_total_2 = "107.95"; } else { $ship_total_2 = "116.95"; } if ($ship_total_2 eq "0.00") { $ship_display_2 = "Free Shipping"; } elsif ($ship_total_2 ne "") { $ship_total_2 = sprintf("%.2f", $ship_total_2); $ship_display_2 = "$ship_meth_name_2 \- $currency_symbol$ship_total_2"; } # End logic for ship method 2 if ($ship_display_2 ne "") { $custom_code_result .= <<ENDOFTEXT; <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name_2:$ship_total_2"> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_2<br /></FONT> ENDOFTEXT } # End ship method 2 my $ship_meth_name_3 = ""; my $ship_total_3 = ""; my $ship_display_3 = ""; $ship_meth_name_3 = "UPS Next Day Air"; if ($item_total_weight > 0 && $item_total_weight <= 2 ) { $ship_total_3 = "68.95"; } elsif ( $item_total_weight > 1 && $item_total_weight <= 4 ) { $ship_total_3 = "80.95"; } elsif ( $item_total_weight > 2 && $item_total_weight <= 6 ) { $ship_total_3 = "92.95"; } elsif ( $item_total_weight > 3 && $item_total_weight <= 8 ) { $ship_total_3 = "104.95"; } elsif ( $item_total_weight > 4 && $item_total_weight <= 10 ) { $ship_total_3 = "116.96"; } elsif ( $item_total_weight > 5 && $item_total_weight <= 12 ) { $ship_total_3 = "128.95"; } elsif ( $item_total_weight > 6 && $item_total_weight <= 14 ) { $ship_total_3 = "140.95"; } elsif ( $item_total_weight > 7 && $item_total_weight <= 16 ) { $ship_total_3 = "152.95"; } else { $ship_total_3 = "164.95"; } if ($ship_total_3 eq "0.00") { $ship_display_3 = "Free Shipping"; } elsif ($ship_total_3 ne "") { $ship_total_3 = sprintf("%.2f", $ship_total_3); $ship_display_3 = "$ship_meth_name_3 \- $currency_symbol$ship_total_3"; } # End logic for ship method 3 if ($ship_display_3 ne "") { $custom_code_result .= <<ENDOFTEXT; <INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name_3:$ship_total_3"> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display_3<br /></FONT> ENDOFTEXT } # End ship method 3 }
Last edited by theblade24 (06-14-2008 13:02:52)
Offline