Jump to content
Lizard Wizard Coding Club

Paypal cart shipping calculation


Recommended Posts

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?

Link to post
Share on other sites
  • 1 month later...

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);

?>

Link to post
Share on other sites

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);

?>

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...