I am dead new to php so please bear with me
I am trying to achieve the following:
When choosing a plan plus a toolkit option the charge is to be:
Plan price + toolkit + setup (per the setup charge schedule)
I have 2 problems (so far)
#1 when a plan is selected with one toolkit option the $ cost of the setup charge is not calculated into the order total
#2 when a plan is selected with two or more toolkit options “1 Professional Plan ToolKit Setup No Charge” is the detail spit out as opposed to indicating the corresponding setup charge and there is no setup charge $ being added to the total of the order
The only other thing that I will need to do is limit the customer to only being able to choose only 1 plan and one of each toolkit
Any help is greatly appreciated
form is at www.php.cedarsprings.cc
php is as follows:
<?php
// create short variable names
$pro = $POST['pro'];
$comp = $POST['comp'];
$personal = $POST['personal'];
$diy = $POST['diy'];
$host = $POST['host'];
$qna = $POST['qna'];
$facts = $POST['facts'];
$calc = $POST['calc'];
$news = $POST['news'];
$setupcomp = $POST['setupcomp'];
$setuppersonal = $POST['setuppersonal'];
$setuphost = $POST['setuphost'];
echo '<p>Your order is as follows: </p>';
$totalqty = 0;
$totalqty = $pro + $comp + $personal + $diy + $host + $qna + $facts + $calc + $news + $setupcomp + $setuppersonal + $setupdiy + $setuphost;
echo 'Items Ordered: '.$totalqty.'<br />';
$totalamount = 0.00;
define('PROPRICE', 1.00);
define('COMPPRICE', 1.00);
define('PERSONALPRICE', 1.00);
define('DIYPRICE', 1.00);
define('HOSTPRICE', 1.00);
define('QNAPRICE', 1.00);
define('FACTSPRICE', 1.00);
define('CALCPRICE', 1.00);
define('NEWSPRICE', 1.00);
define('SETUPCOMPPRICE', 1.00);
define('SETUPPERSONALPRICE', 1.00);
define('SETUPDIYPRICE', 1.00);
define('SETUPHOSTPRICE', 1.00);
$totalamount = $pro PROPRICE
+ $comp COMPPRICE
+ $personal PERSONALPRICE
+ $diy DIYPRICE
+ $host HOSTPRICE
+ $qna QNAPRICE
+ $facts FACTSPRICE
+ $calc CALCPRICE
+ $news NEWSPRICE;
+ $setupcomp SETUPCOMPPRICE;
+ $setuppersonal SETUPPERSONALPRICE;
+ $setupdiy SETUPDIYPRICE;
+ $setuphost * SETUPHOSTPRICE;
if( $comp && $qna || $facts || $calc || $news> 0 )
$setupcomp = 1;
elseif( $personal && $qna || $facts || $calc || $news> 0 )
$setuppersonal = 1;
elseif( $diy && $qna || $facts || $calc || $news> 0 )
$setupdiy = 1;
elseif( $host && $qna || $facts || $calc || $news> 0 )
$setuphost = 1;
echo 'Subtotal: $'.number_format($totalamount,2).'<br />';
$taxrate = 0.15; // local salestax is 15%
$totalamount = ($totalamount) * (1 + $taxrate);
echo 'Total including tax: $'.number_format ($totalamount,2).'<br />';
if( $totalqty == 0 )
{
echo '<font color=red>';
echo 'You did not order anything! <br />';
echo '</font>';
}
else
{
if ($pro> 0 )
echo $pro.' Professional Plan<br />';
if ($comp> 0 )
echo $comp.' Comprehensive Plan<br />';
if ($personal> 0 )
echo $personal.' Personal Plan<br />';
if ($diy> 0 )
echo $diy.' DIY Plan<br />';
if ($host> 0 )
echo $host.' Hosting Only Plan<br />';
if ($qna> 0 )
echo $qna.' Quick Q & A ToolKit<br />';
if ($facts> 0 )
echo $facts.' Quick Facts ToolKit<br />';
if ($calc> 0 )
echo $calc.' Calculators ToolKit<br />';
if ($news> 0 )
echo $news.' Quarterly Newsletters ToolKit<br />';
elseif ($pro && $qna || $facts || $calc || $news> 0 )
echo $setupcomp.' Professional Plan ToolKit Setup No Charge<br />';
elseif ($comp && $qna || $facts || $calc || $news> 0 )
echo $setupcomp.' Comprehensive Plan ToolKit Setup Charge<br />';
elseif ($personal && $qna || $facts || $calc || $news> 0 )
echo $setuppersonal.' Personal Plan ToolKit Setup Charge<br />';
elseif ($diy && $qna || $facts || $calc || $news> 0 )
echo $setupdiy.' DIY Plan ToolKit Setup Charge<br />';
elseif ($host && $qna || $facts || $calc || $news> 0 )
echo $setuphost.' Hosting Only Plan ToolKit Setup Charge<br />';
}
echo '<p>Order processed at ';
echo date('H:i, jS F');
echo '</p>';
?>