Shopping Cart table issue

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Shopping Cart table issue

    Hi,
    I am using ASP on my webpage to pull up data from SQL tables. I am
    using a Shopping cart page where the users can place orders.
    The problem I have once the user has logged in and placed an order
    the shopping cart table is empty (as it should be).
    But when the user tries to place another order in the same session by
    adding an item to the cart, the table shows the new item along with
    the old item that has already been ordered (instead of just the new
    item)
    The SQL table does flush the old data after the order is placed and
    the table is empty. However when a new item is ordered, the table
    shows the new as well as the already ordered old item. Where does it
    store this old data? Is there some sort of cache and if so, how can I
    delete it?
    Thanks, Amit
    Amit Kela Guest

  2. Similar Questions and Discussions

    1. Like a Shopping Cart but -NOT- a Shopping Cart
      Have you ever seen www.apple.com/store? And if you noticed when you choose G5 for example... you select the kind of MAC and then you can customize...
    2. Shopping cart help
      Hi, I need to create a shopping cart style website. Are there any good tutorials or 'shareware' stuff out there that I can look at? I want to do...
    3. ASP Shopping Cart
      I recently reviewed a shopping cart called Product cart made by a company called Early Impact. http://www.earlyimpact.com I was curious to find...
    4. shopping cart shopping
      Im looking to buy some ecommerce software to hook up to an HTML site. The company will have around 350 products or so to start out, and will be...
    5. JS shopping cart
      peterct07@yahoo.com (Peter Cartwright) wrote in message news:<b6141bd7.0307171525.1c322082@posting.google.com>... Oops wrong forum
  3. #2

    Default Re: Shopping Cart table issue

    Are you creating a table per shopping cart? That's a lousy design. Don't do
    it. Tables aren't arrays and your application shouldn't have to modify your
    schema. Use a single table for all your carts, something like this:

    CREATE TABLE ShoppingCart (user_id INTEGER NOT NULL REFERENCES Users
    (user_id), product_id INTEGER NOT NULL REFERENCES Products (product_id), qty
    INTEGER NOT NULL CHECK (qty>0), cart_status CHAR(1) NOT NULL CHECK
    (cart_status IN ('O','C','Z') /* Open,Confirmed,Cancelled */), PRIMARY KEY
    (user_id, product_id))

    SELECT ...
    FROM ShoppingCart
    WHERE user_id = ??

    --
    David Portas
    SQL Server MVP
    --


    David Portas Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139