T
Tim
Hello,
I'm extremely puzzled; I cannot figure out what I'm doing wrong. Here's
the situation. I would really appreciate any suggestions.
I'm modifying a shopping cart in the following way. I've just added new
prices to several drop-downs on our javascript-based ordering page. These
new prices must have shipping costs added to them at the bottom of the
ordering system in a text box called "Shipping", while the existing prices
do not have to have shipping costs added.
Basically this means that if the user selects the first 3 options in the
drop-down boxes, the text box of "Shipping" must show "7.00", but if any
option after that is selected, the text box of "Shipping" must show "0.00".
Oh, and here's another wrinkle: only certain drop-down boxes will need this
modification. Also, if a customer selects more than one of these "7.00"
items, an additional "7.00" must be added to their shipping costs.
Any suggestions on how to best implement this? I've tried the following
code, but it isn't working--specifically, I can't the shipping to be
properly affected if a users should move from a "7.00 Shipping" option to a
"0.00" option..
var ShippingTotal = 0;
var ShippingAdded = 7;
var TemporaryShipping = 0;
var NewQuantity1 = "False";
var NewQuantity3 = "False";
....[this is the same code for all drop-down boxes]
if ((document.Form.Item3.selectedIndex == 1) ||
(document.Form.Item3.selectedIndex == 2) ||
(document.Form.Item3.selectedIndex == 3))
{
NewQuantity3="True";
}
else
{
NewQuantity3="False";
}
if (NewQuantity3=="True")
{
ShippingTotal += ShippingAdded;
document.Form.Shipping.value = ShippingTotal;
}
else if (NewQuantity3=="False")
{
document.Form.Shipping.value = ShippingTotal;
}
Again, any help would be greatly appreciated. Thanks in advance.
Tim
I'm extremely puzzled; I cannot figure out what I'm doing wrong. Here's
the situation. I would really appreciate any suggestions.
I'm modifying a shopping cart in the following way. I've just added new
prices to several drop-downs on our javascript-based ordering page. These
new prices must have shipping costs added to them at the bottom of the
ordering system in a text box called "Shipping", while the existing prices
do not have to have shipping costs added.
Basically this means that if the user selects the first 3 options in the
drop-down boxes, the text box of "Shipping" must show "7.00", but if any
option after that is selected, the text box of "Shipping" must show "0.00".
Oh, and here's another wrinkle: only certain drop-down boxes will need this
modification. Also, if a customer selects more than one of these "7.00"
items, an additional "7.00" must be added to their shipping costs.
Any suggestions on how to best implement this? I've tried the following
code, but it isn't working--specifically, I can't the shipping to be
properly affected if a users should move from a "7.00 Shipping" option to a
"0.00" option..
var ShippingTotal = 0;
var ShippingAdded = 7;
var TemporaryShipping = 0;
var NewQuantity1 = "False";
var NewQuantity3 = "False";
....[this is the same code for all drop-down boxes]
if ((document.Form.Item3.selectedIndex == 1) ||
(document.Form.Item3.selectedIndex == 2) ||
(document.Form.Item3.selectedIndex == 3))
{
NewQuantity3="True";
}
else
{
NewQuantity3="False";
}
if (NewQuantity3=="True")
{
ShippingTotal += ShippingAdded;
document.Form.Shipping.value = ShippingTotal;
}
else if (NewQuantity3=="False")
{
document.Form.Shipping.value = ShippingTotal;
}
Again, any help would be greatly appreciated. Thanks in advance.
Tim