Re: Shopping Cart Prob

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Right off the problem with your cart updating the quantities is because you
are using <form> tags for each item in the cart, hence when you click the
submit button its only submitting the contents within the LAST <form> tag
within your source, however when you are in the actual textbox and hit enter
it submits THAT form by default (whichever form houses the textbox you
happen to be in). Loose the form tags, just make one, and have it iterate
through the submitted values to update your cart -- you might already be
doing this as I haven't looked @ the php part yet.

-Mike

----- Original Message -----
From: "Boa Constructor" <mickel@ntlworld.com>
To: <php-db@lists.php.net>
Sent: Wednesday, May 21, 2003 7:30 PM
Subject:  Shopping Cart Prob


> Hey ppl, yup I'm still trying to fix this thing.  Ok I've progressed a
> little, I can change the quantity of ONE product ONLY if the return key is
> pressed.  If you press the submit button it doesn't work - weird!
>
> Also, when I click the link that takes the shopper back to where they
were,
> the session contents aren't passed along with the catagory ID when doing
> this, am I meant to do this or do I simply pass the session ID in this
link
> so that when the shopper comes back to the cart for the second time the
> products they added previously are still there?
>
> When more than one product is added to the basket and the quantities are
> changed the value 0 is displayed for the quantity and hence the total.
>
> I've obviously not quite got the hang of sessions  because I tried the
> following uncommented and it worked even less.
>
>
> $shoppingcart = array();
> //session_register("shoppingcart");
> session_start();
> //$quantity = 1;
> //session_register("quantity");
>
>
> Can anyone give me some directions here, I'm a bit lost........ok I'm
> completely lost!
>
> Here is my code for the cart:
> http://www.hostmaster-x.co.uk/shoppingcartquantityprob.txt
>
> if you wanna try it yourself, go to
> http://www.hostmaster-x.co.uk/Products.php
>
>
> Thank you for at least reading this far!
>
>
> Cheers,
>
> Graeme :)
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux