Shopping Cart Questions

Discussion in 'MySQL' started by leony, Aug 1, 2008.

  1. #1
    Hi

    I have got two questions about my recently built shopping cart.

    1) Regarding the item descriptions: Most of the carts give a link on the item description so that the customer can navigate back to the product.

    Is it done on the mysql database (to enter the item's url on the database) or some php script somehow?

    2) When I refresh the cart page, the item quantites update itself. (i.e if the product quantity is 1, when I refresh the page, it becomes 2). How can I prevent this?

    I store the cart information in the database by the way.

    Thank you.
     
    leony, Aug 1, 2008 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    Yes, you would need to put the link back to the project on the php output code for displaying the cart.

    On #2, I can't say for sure, but it sounds like the cart page is the same page you post an item to. To prevent the refresh thing, the best bet it to use an intermediate processing page.

    Item -> (POST or GET) -> Process (Add, Update, Delete) -> (redirect) -> Cart
     
    jestep, Aug 1, 2008 IP
  3. leony

    leony Peon

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for the reply. I need to post a PHP code for this but this is not the place. I will try my luck in the PHP section.
     
    leony, Aug 1, 2008 IP