Add Freight to cart total
Posted: Tue Dec 21, 2004 2:30 pm
Hi,
At the moment it has a java script that updates the qty on click .. The java script is:
The list/menu is made up of:
The price is displayed as:
I have been unable to have the same function to add the freight to the total as well .. using list/menu:
Any ideas on what I need to do to acheive this?
Cheers
At the moment it has a java script that updates the qty on click .. The java script is:
Code: Select all
<script language="JavaScript">
function UpdateQty(item)
{
itemId = item.name;
newQty = item.optionsїitem.selectedIndex].text;
document.location.href = 'cart.php?action=update_item&id='+itemId+'&qty='+newQty;
}
</script>Code: Select all
<select name="<?php echo $rowї"itemId"]; ?>" onChange="UpdateQty(this)">
<?php
for($i = 1; $i <= 20; $i++)
{
echo "<option ";
if($rowї"qty"] == $i)
{
echo " SELECTED ";
}
echo ">" . $i . "</option>";
}
?>
</select>Code: Select all
<?php echo number_format($totalCost, 2, ".", ","); ?>Code: Select all
<select name="freight">
<option>Freight</option>
<option value="8.00">North</option>
<option value="15.00">South</option>
</select>Cheers