Kryptronic Software Support Forum

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.

#1 05-23-2003 11:50:42

justme
Member
Registered: 04-16-2003
Posts: 47
Website

Help..Shipping NOT working over $40

I have no idea what is going on, I have copy / pasted my script for shipping by total amount.  It works great but if you purchase over $40 shipping is NOT showing up.  Please help!!



#########
######### This custom script calculates shipping
######### based on total order cost. Orders
######### over a subtotal of CURR 250.00 are free.
#########
######### A listing of available variables:
#########
######### $ship_items_found     Count Of shippable items
#########
######### $ship_methods_found   Count of items with a
#########                       shipping method already
#########
######### $cart_items_found     Count of rows in the cart
#########
######### $cart_quantity_found  Total quantity of items
#########                       in the cart
#########
######### $tracking_subtotal    Subtotal of the prices for
#########                       all items in the cart
#########
######### $cart_total_weight    Total weight of all items
#########                       in the cart in pounds.
#########
######### Directly below, enter in the name for this
######### method to be displayed to the user.
#########

my $ship_meth_name = "USPS Mail";
my $ship_total = "5.95";
my $ship_display = "";

#########
######### Figure out what the shipping charge will be by
######### using if statements and less than/greater than
######### logic.
#########

if ($tracking_subtotal >= "0" && $tracking_subtotal <= "39.99") {

$ship_total = "5.95";
$ship_display = "$ship_meth_name - $currency_symbol$ship_total";

} elsif ($tracking_subtotal > "40.00" && $tracking_subtotal <= "79.99") {

$temp_shipping_total = "6.95";
$ship_display = "$ship_meth_name - $currency_symbol$ship_total";

} elsif ($tracking_subtotal > "80.00" && $tracking_subtotal <= "249.99") {

$ship_total = "7.95";
$ship_display = "$ship_meth_name - $currency_symbol$ship_total";

} else {

$ship_total = "0.00";
$ship_display = "$ship_meth_name - FREE";

} ######### End of if statement.

#########
######### Format the $ship_total as a price.
#########

$ship_total = sprintf("%.2f", $ship_total);

#########
######### Print the HTML display for the shipping
######### charge.
#########

print <<ENDOFTEXT;

<CENTER>

<TABLE WIDTH="100%" CELLPADDING="10" CELLSPACING="3">

<TR BGCOLOR="$html_pri_tablerow_color">

<TD VALIGN="TOP"><FONT FACE="$html_small_font_face" SIZE="$html_small_font_size" COLOR="$html_small_font_color"><B>Shipping Method</B> <FONT COLOR="$html_notnull_font_color"><B>$html_notnull_character</B></FONT><BR><BR></FONT>

<INPUT TYPE="RADIO" NAME="shipinfo" VALUE="$ship_meth_name:$ship_total" CHECKED> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color">

$ship_display

</FONT></TD>

</TR>

</TABLE>

</CENTER>

<BR>

ENDOFTEXT


Heidi
Justme-in-Az
http://cgi2.ebay.com/aw-cgi/eBayISAPI.d … stme-in-az

Shockers Shock Covers
http://shockcovers.com

Offline

 

#2 05-23-2003 15:55:44

WayneK
Member
Registered: 08-17-2003
Posts: 256
Website

Re: Help..Shipping NOT working over $40

after first elsif

$temp_shipping_total = "6.95";

should be $ship_total = "6.95";


- Wayne
<-- Witty Clever Phrase Goes Here -->

Offline

 

#3 05-23-2003 16:01:14

BooBoo
Member
From: Anaheim, CA
Registered: 07-25-2003
Posts: 147
Website

Re: Help..Shipping NOT working over $40

You have bypassed the $40.00 amount.  Change your code from:

if ($tracking_subtotal >= "0" && $tracking_subtotal <= "39.99") {

$ship_total = "5.95";
$ship_display = "$ship_meth_name - $currency_symbol$ship_total";

} elsif ($tracking_subtotal > "40.00" && $tracking_subtotal <= "79.99") {

$temp_shipping_total = "6.95";
$ship_display = "$ship_meth_name - $currency_symbol$ship_total";

} elsif ($tracking_subtotal > "80.00" && $tracking_subtotal <= "249.99") {

$ship_total = "7.95";
$ship_display = "$ship_meth_name - $currency_symbol$ship_total";

} else {

$ship_total = "0.00";
$ship_display = "$ship_meth_name - FREE";

++++++++++++++++++++++++++++++++++++

if ($tracking_subtotal >= "0" && $tracking_subtotal <= "39.99") {

$ship_total = "5.95";
$ship_display = "$ship_meth_name - $currency_symbol$ship_total";

} elsif ($tracking_subtotal > "39.99" && $tracking_subtotal <= "79.99") {

$temp_shipping_total = "6.95";
$ship_display = "$ship_meth_name - $currency_symbol$ship_total";

} elsif ($tracking_subtotal > "79.99" && $tracking_subtotal <= "249.99") {

$ship_total = "7.95";
$ship_display = "$ship_meth_name - $currency_symbol$ship_total";

} else {

$ship_total = "0.00";
$ship_display = "$ship_meth_name - FREE";


Your code had > 40.00 and > 80.00, meaning that any order with a total of either 40.00 or 80.00 would receive free shipping.  By changing it to > 39.99 and > 79.99, you do not have the gap.

HTH!


--
Keith Roberts
IT Manager
Laptops For Less, Inc
keith@getadeal.com
<a href="http://www.laptopsforless.com">Your source for laptop batteries, pda batteries, digital camera batteries, cell phone batteries, and accessories</a>

Offline

 

#4 05-23-2003 16:18:02

WayneK
Member
Registered: 08-17-2003
Posts: 256
Website

Re: Help..Shipping NOT working over $40

I second that and raise you a >=

You could also use >= 40.00 && <= 79.99 and >=80.00 && <= 249.99


- Wayne
<-- Witty Clever Phrase Goes Here -->

Offline

 

Board footer