SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2001
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    passing on form field data...

    My client www.crescentproducts.com has a problem for me. Here is what he wants to do. On the doctors link, there are products pages and a an order form. While one is looking at the products pages, i want to add in a quantity field and an add to "cart" button for each product. So lets say i want to order 5 fiber pillows, i can enter that in on the products page so when i go to the order form page the field for the fiber pillows will already have 5 for a quantity in it, As this would work for all the products on the site. Is there a way to do this with out adding a shopping cart. I'm not sure if there is a simple way to do it without changing the site layout.

  2. #2
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could perhaps accomplish this using a cookie to hold a list of all products selected.

    You would need to add a form to each product entry with a hidden 'Product Description', a 'Quantity' dropdown and an 'Add To Cart' button. The form action could either be the same page or a cookie-update-then-redirect page, which sets the 'shoppingcart' cookie with a description of the product and the quantity (and the cost?).

    Then your order form page would read the cookie and split it into product entries for writing to the page in a sensible format.

    Ideally you should also have 'Delete' and 'Change Quantity' buttons for each product in the shopping cart, and then another page that finds that entry in the cookie and either deletes or updates it.

    This could also be accomplished (more easily) with server-side scripting in PHP or ASP.

    HTH.


Bookmarks

Posting Permissions

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