Re: [PHP] Anyone used Luke Welling & Laura Thompsons shopping cart?

2002-10-27 Thread @ Edwin
Hello,

What is your PHP version? Perhaps, the problem has something to do with
"register_globals"?

What exactly is the problem you're having? Any error messages?

- E

PS.
The book is really great--it's part of my library :)


"Steve Jackson" <[EMAIL PROTECTED]> wrote:

> 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);
>
> }
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Anyone used Luke Welling & Laura Thompsons shopping cart?

2002-10-27 Thread Steve Jackson
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);

}