Shopping Cart Quantity

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael J. Astrauskas

    Shopping Cart Quantity

    I'm developing a fairly basic shopping cart. My original implementation
    had the user click on a link to add an item to the cart
    (addtocart.php? item=123456). I figured it could just increase the
    quantity every time the user clicked. However, with caching turned off
    the quantity is increased if the user presses back and then forward in
    his/her browser. Is there any simple way to avoid this? I noticed that a
    lot of online retailers don't increase the quantity above 1 when a user
    clicks on [Add to Cart]; they simply allow the user to enter a quantity
    on the next page. Is this the best/only solution? Thank you!

    --
    - Michael J. Astrauskas

  • Jochen Daum

    #2
    Re: Shopping Cart Quantity

    Hi Michael!

    On Tue, 23 Sep 2003 20:55:11 -0700, "Michael J. Astrauskas"
    <trevie@cox.net > wrote:
    [color=blue]
    >I'm developing a fairly basic shopping cart. My original implementation
    >had the user click on a link to add an item to the cart
    >(addtocart.php ?item=123456). I figured it could just increase the
    >quantity every time the user clicked. However, with caching turned off
    >the quantity is increased if the user presses back and then forward in
    >his/her browser. Is there any simple way to avoid this? I noticed that a
    >lot of online retailers don't increase the quantity above 1 when a user
    >clicks on [Add to Cart]; they simply allow the user to enter a quantity
    >on the next page. Is this the best/only solution? Thank you![/color]

    Tthere was a posting about GET parameters that change the data in the
    database some days before, which stated that you should not have any
    of them. Instead use POSt and redirect to a GET request after you
    changed the amount. That way
    - back works
    - reloading doesn't add again.

    HTH, Jochen

    --
    Jochen Daum - CANS Ltd.
    PHP DB Edit Toolkit -- PHP scripts for building
    database editing interfaces.
    Download PHP DB Edit Toolkit for free. PHP DB Edit Toolkit is a set of PHP classes makes the generation of database edit interfaces easier and faster. The main class builds tabular and form views based on a data dictionary and takes over handling of insert/update/delete and user input.

    Comment

    Working...