While Statement Inside If
Posted: Mon Nov 17, 2008 3:44 am
Hey all,
Im having a few problems with editing the following code:
This code adds a special offer to the shopping cart of the website, what i want however is for multiple special offers to be added to the website when there are multiple choices for the user, so i changed it to this.
I should mention that the variable $joe stores the amount of drop downs that the user is presented with, thus in other words i want it special offer info to be iterated $joe times. I hope this explains enough for someone to help me.
Thanks in advance.
Im having a few problems with editing the following code:
Code: Select all
if(isset($_REQUEST['Include']))
{
$z=1;
$addtocart=$_REQUEST['SpecialOutfit-0'];
$chapcart->addToCart($addtocart,1);
}
Code: Select all
if(isset($_REQUEST['Include']))
{
$z=1;
$joe=0;
//$addtocart=$_REQUEST['SpecialOutfit-0'];
$joe=$_REQUEST['joe'];
$i=0;
while($i != $joe)
{
$addtocart=$_REQUEST['SpecialOutfit-'.$i.''];
$chapcart->addToCart($addtocart,1);
}
//$chapcart->addToCart($addtocart,1);
}
Thanks in advance.