Ok I grabed the code for the mini shopping carte thing and have it working great. The thing is there is no way to remove a item.
I do not know much about PHP or PHP Sessons so I could really use some help here. I will post the code below for you to see. I just was a link that says delete and when clicked on have the item removed from the session.
Thanks for any help that may come this way..
Stephen
<?php
session_start();
if ($basket!=""){
if (session_is_registered("ses_basket_items")){
$basket_position_counter=0;
$double=0;
if ($ses_basket_items>0){
foreach ($ses_basket_name as $basket_item){
if ($basket_item==$basket){
$double=1;
$basket_position=$basket_position_counter;
}
$basket_position_counter++;
}
}
if ($double==1){
$oldamount=$ses_basket_amount[$basket_position];
$ses_basket_amount[$basket_position]++;
$amount=$ses_basket_amount[$basket_position];
$oldprice=$ses_basket_price[$basket_position];
$newprice=($oldprice/$oldamount)*$amount;
$ses_basket_price[$basket_position]=$newprice;
}else{
$ses_basket_name[]=$basket;
$ses_basket_amount[]=1;
$ses_basket_price[]=$price;
$ses_basket_id[]=$id;
$ses_basket_des[]=$des;
$ses_basket_ship[]=$ship;
$ses_basket_items++;
}
}else{
$ses_basket_items=1;
$ses_basket_name[0]=$basket;
$ses_basket_amount[0]=1;
$ses_basket_price[0]=$price;
$ses_basket_id[0]=$id;
$ses_basket_des[0]=$des;
$sas_basket_ship[0]=$ship;
session_register("ses_basket_items");
session_register("ses_basket_name");
session_register("ses_basket_amount");
session_register("ses_basket_price");
session_register("ses_basket_id");
session_register("ses_basket_des");
session_register("ses_basket_ship");
}
}
if ($ses_basket_items>0){
?>
<?
for ($basket_counter=0;$basket_counter<$ses_basket_items;$basket_counter++){
$price=sprintf("%01.2f",$ses_basket_price[$basket_counter]);
$amount=$ses_basket_amount[$basket_counter];
$name=$ses_basket_name[$basket_counter];
$des=$ses_basket_des[$basket_counter];
$ship=$ses_basket_ship[$basket_counter];
?>
<tr>
<td Class="main"><? echo $amount ?></td>
<td class="main"><? echo $name ?></td>
<td class="main">$<? echo $price ?></td>
<td class="main"><? echo $ship ?>lbs</td>
<td class="main"><? echo $des ?>delete <? echo $basket_counter ?></td>
</tr>
<?
}
} else {
$ses_basket_items=0;
unset($ses_basket_name);
unset($ses_basket_amount);
unset($ses_basket_price);
unset($ses_basket_id);
unset($ses_basket_des);
unset($ses_basket_ship);
}
?>
<!-- #EndEditable --></table>
</td>
</tr>
<tr colspan="5">
<td><span class="main"> Click on the order button to place your order. You will then be taken to a page that will let you place the size of your parts if they are needed. Once everything meets your approval click on the Submit Order Button, you will here from us with in two business days.</span>
<center><span class="headings">Thank you from DoorParts.ca</span></center><br><center><input type="submit" name="Submit" value="Order Parts"></center>
</table>