473,320 Members | 1,979 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

Jul 17 '05 #1
1 2453
Hi Michael!

On Tue, 23 Sep 2003 20:55:11 -0700, "Michael J. Astrauskas"
<tr****@cox.net> wrote:
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!


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.
http://sourceforge.net/projects/phpdbedittk/
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Phil Powell | last post by:
I need a back-to-basics shopping cart tutorial in PHP/mySQL. I thought I had it down and I failed, as usual. Here is what I mapped out as a spec: 3) initial work on bestilling.php to contain the...
1
by: Alex Ivascu | last post by:
Hi; I am no PHP programmer, unfortunately. So your assistance is appreciated. I am starting to look into using the Agora Shopping cart. There is a page in there called productPage.inc and I...
2
by: Paul Bruneau | last post by:
Hi, I hope someone can help me make a working shopping cart, as a learning tool. If I have a "Product Demo" html page with a "Buy Me" button, there must be a simple javascript method of...
2
by: Mark Hannon | last post by:
I am designing a PayPal shopping cart/store for a client and have placed several of PayPal's shopping cart forms on the page to correspond with different products. Each form has a unique name...
1
by: Paul Goodley | last post by:
Typically, shopping carts add a single item at a time, so it's easy to prompt the user for information needed for the order, but what if the shopping cart needs to process thirty items at once? I...
0
by: psb | last post by:
imagine a shopping cart application. I am on the product details page. this page has a cart summary on the right hand side of the page. the cart summary is a webcontrol that sits in the aspx page...
4
by: Winshent | last post by:
I am having problems with adding items to my shopping cart. The problem occures when adding items that already exists in the cart. When a user adds to cart, they are automatically redirected to...
7
by: isaac2004 | last post by:
hi i have a basic asp page that acts as an online bookstore. on my cart page i am having trouble generating 3 numbers; a subtotal, a shipping total, and a final price. here is my code i would...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.