I am developing a shopping cart based on the above authors shopping cart fom
their book. (Book is a must by the way). I am still pretty new to PHP and
MySQL and need some help with the cart. Basically I need to add a form to
adjust the quantity in the cart instead of just incrementing by one and then
allowing the user to change the amount when she gets there. I have tried
unsuccessfully for the last three days to do this.

the code that increments the cart is this but if anyone has used the
shopping module and knows how to adjust the code to add this fairly simple
procedure I'd appreciate it.

if($new)
{
//new item selected
if(!session_is_registered("cart"))
{
$cart = array();
session_register("cart");
$items = 0;
session_register("items");
$total_price = "0.00";
session_register("total_price");
}
if($cart[$new])
$cart[$new]++;
else
$cart[$new] = 1;
$total_price = calculate_price($cart);
$items = calculate_items($cart);

}

Reply via email to