Click to See Complete Forum and Search --> : Create shopping basket in javascript
madjock
05-06-2006, 07:46 PM
I need to create a shopping basket in javascript.
Any experts out there can give me a simple script to copy, find, adapt to accomplish this would be really obliged. :confused:
phpnovice
05-06-2006, 07:59 PM
I need to create a shopping basket in javascript.
First, a question... Are you sure it needs to be in JavaScript? Don't get me wrong, I love JavaScript and I use it a lot. I have even written a JavaScript Shopping Cart that worked quite well. However, I also use server-side code and I feel a Shopping Cart is best suited to server-side code -- not JavaScript. So, tell me what you're up against.
madjock
05-07-2006, 11:36 AM
Its like this, doing college course on xhtml and dynamic webscripting have been given an assignment which I have no idea how to complete, lecturer not too good.
Here is basics of task:
The prototype must allow the customer to order up to 999 of each and every item. The VAT exclusive cost of the full order must be displayed, the VAT at 17.5% must be calculated and displayed and the total cost must be displayed.
The customer must be able to quit at any time and return on the same computer within 28 days to complete the order. If the order is not then sent, the information must be stored for a further 28 days.
At any time the user must be able to ask to see how many of what items have been selected. When in this mode, the user must be able to delete the line or change the number required. As these changes are made the totals must be immediately updated. The user must be able to continue shopping at the point where (s)he requested the current status.
At some point before the order is accepted the user must enter name, address, post code, date of birth and credit card type and number.
There must be a page that mimics a server-side script by displaying the data described in the above paragraph and also displays the items ordered, their prices, VAT and invoice total. As this is a prototype that will be tested on a stand alone computer there are no security considerations. This page must use the image, server.png, as a background to differentiate it visually from those pages that the user will see.
Dont have any javascript or php knowledge, have an array of goods dont know how to display so you see my predicament.
Any help would be great.
Liz
phpnovice
05-07-2006, 02:07 PM
That is quite a tall order (i.e., advanced stuff) -- especially if you're saying that you have no idea how to complete it. In fact, my script won't even do all of that. My script is not written to allow the customer to return at a later date. My script is real-time-only (data is saved in an array in a separate frame within the browser window). For the ability to return later, you would have to store your data in a cookie. A single domain may only have up to 20 cookies and cookies are limited to 4K (some browsers apply that limit to each cookie and some browsers apply that limit to the total of 20 cookies). So, if you have too many possible items that a customer may purchase, you run the risk of running out of space to store the data in cookies.
madjock
05-07-2006, 03:25 PM
Thanks for the help will have to blag my way through