dessie1981
Programmer
Hi everyone.
I have developed an online store and i am trying to add a feature which shows how many items the user has in their basket.
I have 3 frames, main - where there is a table of results and text field with a quick add button in each row of the results.
SideFrame - Search tools
TopFrame - Show's some images and links, but also the number of items in the shopping basket.
Everytime the user adds a products i am
reloadading the top frame to refresh the "number" that the user sees.
The problem is that this seems to only work intermittently
It does not seem to reload the frame everytime.
I am using javascript to reload the frame.
<form name="myform" action = "<?echo $_SERVER['PHP_SELF'];?>?empty=1" method="POST">
<input name="Submit" type="submit" class="form-button" value="Empty Basket" OnClick="parent.topFrame.location.reload();" />
</form>
here is the php i have used to calculate the no of items in the basket.
if (count($_SESSION['quantity']) != 0)
{
$newval = 0;
foreach ($_SESSION['quantity'] as $val)
{
$newval = $val + $newval;
}
}
else
{
$newval = 0;
}
any ideas???
Regards
Dessie
I have developed an online store and i am trying to add a feature which shows how many items the user has in their basket.
I have 3 frames, main - where there is a table of results and text field with a quick add button in each row of the results.
SideFrame - Search tools
TopFrame - Show's some images and links, but also the number of items in the shopping basket.
Everytime the user adds a products i am
reloadading the top frame to refresh the "number" that the user sees.
The problem is that this seems to only work intermittently
It does not seem to reload the frame everytime.
I am using javascript to reload the frame.
<form name="myform" action = "<?echo $_SERVER['PHP_SELF'];?>?empty=1" method="POST">
<input name="Submit" type="submit" class="form-button" value="Empty Basket" OnClick="parent.topFrame.location.reload();" />
</form>
here is the php i have used to calculate the no of items in the basket.
if (count($_SESSION['quantity']) != 0)
{
$newval = 0;
foreach ($_SESSION['quantity'] as $val)
{
$newval = $val + $newval;
}
}
else
{
$newval = 0;
}
any ideas???
Regards
Dessie