PHPlife Posted December 18, 2011 Report Posted December 18, 2011 I need to change the way shipping is calculated. Right now the shipping is charged per item as it goes in the cart. I need to make it be on the total dollar amount of items in the cart. For example if I have an item that is $6.00 and something that is $15 - I want to charge shipping on $21. How do i do that?
kama1983 Posted January 27, 2012 Report Posted January 27, 2012 calculate row 1 + row 2 and add them to final result you can do it for example : <?php $con = mysql_connect("localhost", "peter", "abc123"); if (!$con) { die('Could not connect: ' . mysql_error()); } $db_selected = mysql_select_db("test_db",$con); $sql = "SELECT * from Person"; $result = mysql_query($sql,$con); while($row = mysql_fetch_array) { $row1 = $row[0 or name your field]; $row2 = $row[1 or name your field]; echo $row1 + $row2; } mysql_close($con); ?>
kama1983 Posted January 27, 2012 Report Posted January 27, 2012 calculate row 1 + row 2 and add them to final result you can do it for example : <?php $con = mysql_connect("localhost", "peter", "abc123"); if (!$con) { die('Could not connect: ' . mysql_error()); } $db_selected = mysql_select_db("test_db",$con); $sql = "SELECT * from Person"; $result = mysql_query($sql,$con); while($row = mysql_fetch_array) { $row1 = $row[0 or name your field]; $row2 = $row[1 or name your field]; echo $row1 + $row2; } mysql_close($con); ?>
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now