Mabey, I am going about this in the wrong way.
What I have done (or at least would like to get too
work correctly), is on screen "order_info", I am
wanting to pull the drop down box that is there
"ship_Method" and use that variable in the include
"ShippingByTotal" to figure out what type of ship
method they want ie. Ground, 1 day air, 2 day air,
ect.
On the screen "order_info" I have even gone as far as
placing a hidden input type that has the variable for
ship_Method in it, but I still can not seem to pull
that information into "ShippingByTotal". I think I
just need to know how I can refer to $ship_Method
(preferably by ID or Display Precadance) from within
ShippingByTotal.
Below is going to be the ugly hack, I am trying to get
working for this. I figure that would help explain
what I am trying here as opposed to a written
description. I have removed some lines of code before
this that aren't needed for the description.
-----------------------------------------------
function ShippingByTotal($Total)
{
IF ($shipppping_Method="1")
{
if($Total <= 0.00)
{
$Shipping1 = 0.00;
}
elseif($Total <= 29.99)
{
$Shipping1 = 4.50;
}
else
{
$D = ($Total/100);
$S = round("$D");
$F = $S * 5;
if($S <= 0)
{
$Shipping1 = 5.00;
}
else
{
$Shipping1 = $F;
}
}
}
ELSEIF ($shipppping_Method="2")
{
if($Total <= 0.00)
{
$Shipping2 = 0.00;
}
elseif($Total <= 29.99)
{
$Shipping2 = 14.50;
}
else
{
$D = ($Total/100);
$S = round("$D");
$F = $S * 10;
if($S <= 0)
{
$Shipping2 = 10.00;
}
else
{
$Shipping2 = $F;
}
}
}
ELSEIF ($shipppping_Method="3")
{
if($Total <= 0.00)
{
$Shipping3 = 0.00;
}
elseif($Total <= 29.99)
{
$Shipping3 = 24.50;
}
else
{
$D = ($Total/100);
$S = round("$D");
$F = $S * 20;
if($S <= 0)
{
$Shipping3 = 20.00;
}
else
{
$Shipping3 = $F;
}
}
}
ELSE
{
print "Something has gone terribly wrong";
}
IF ($shipppping_Method="1")
{
$Shipping = $Shipping1;
}
ELSEIF ($shipppping_Method="2")
{
$Shipping = $Shipping2;
}
ELSEIF ($shipppping_Method="3")
{
$Shipping = $Shipping3;
}
ELSE
{
print "Something has gone terribly wrong part 2";
}
return($Shipping);
}
----------------------------------------------------
I took out some of the elseif statements because it
was way to long.
Hopefully you have a better idea of what it is I am
trying to do here, or am I just WAY off base? If I
can not get this code to work, then I will probaly
have a go at the suggestion from Leon, I just seem to
think it would be a bit easier way to do it this.
Thanks,
Nicky
__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail � Free email you can access from anywhere!
http://mail.yahoo.com/
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Site: http://www.working-dogs.com/freetrade/
Problems?: [EMAIL PROTECTED]