Jump to content

adding order lines(simple shopping cart/basket?)


chet139

Recommended Posts

Hey,

 

I am creating an internal order processing system which is not customer facing.

 

I have an order screen which I can pass various things like order date....customer....user(processing order) to another page and then add to the database to order table.

 

It would would be easy enough to add a product too, but an order can contain many products so i have an orderline table, but for one order I would like the ability to add multiple items before finalising how can this be done?

 

in the order form i dont mind a user just having to enter a productID and then hit enter to add it somewhere temporarily before adding to db.

 

I have attempted to implement a basic shopping cart thing, but the examples I have found are to complex to integrate. Im really stuck and its for my final year uni project...any help appreciated thanks alot!

 

 

Link to comment
Share on other sites

if it ur final year,

you should go over mysql database syntex,

agin as what your asking is silly,

you said a user can login and make an order then you want to add multipule orders,

from the same user,

that your dataase configureation any order from the same user example

date/time should have the users same id,

so u need to understand id's within a database structure.......

 

it inpossable and silly for a user to add there database id to re order somethink............

 

you need to create a login system then add users then logon as a user then see what happens....

 

you dont create a shopping basket without users do yaaaaaa

Link to comment
Share on other sites

Im sorry I dont really understood your message. But  I think I may have been unclear too.

 

Basically forgot about the user for now (assume a single user system if we have to).

 

What I am looking to do:

 

  I have an order page(textfields etc are all in place - from here I want one to be able to enter a product ID and then click "Add".

  By clicking add I want the productId to be stored (probably not direct to DB but as a var)

  The user should keep on being able to do this until they have added the products they wish.

  Now this list of products forms the order - along with other details (such as date...cust etc.) i want to create an entry in the Order table. and write the list of products to an orderLine table. Each product in the order as its on orderLine.

 

I know my database dsign is correct and normalised OK. Basically I kinda need to know how to store the contents of an order in some sort of variable before writing to a DB because I actually need to write to a few tables.

Link to comment
Share on other sites

Thanks for that.

 

When I'm trying to run this I am getting lots of undefined Index errors. Almost for every variable. I took it straight from the site.

 

Notice: Use of undefined constant active - assumed 'active' in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 7

 

Notice: Use of undefined constant uname - assumed 'uname' in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 16

 

Notice: Use of undefined constant uname - assumed 'uname' in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 17

 

Notice: Use of undefined constant whoareyou - assumed 'whoareyou' in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 17

 

Notice: Undefined index: whoareyou in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 17

 

Notice: Use of undefined constant cart - assumed 'cart' in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 18

 

Notice: Use of undefined constant buy - assumed 'buy' in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 24

 

Notice: Undefined index: buy in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 24

 

Notice: Use of undefined constant cart - assumed 'cart' in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 29

 

Notice: Undefined index: apple in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 29

 

Notice: Use of undefined constant cart - assumed 'cart' in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 29

 

Notice: Undefined index: banana in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 29

 

Notice: Use of undefined constant cart - assumed 'cart' in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 29

 

Notice: Undefined index: cherry in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 29

 

Notice: Use of undefined constant cart - assumed 'cart' in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 29

 

Notice: Undefined index: damson in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 29

 

Notice: Undefined variable: npf in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 34

 

Notice: Use of undefined constant next - assumed 'next' in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 40

 

Notice: Undefined index: next in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 40

 

I have tried putting somethings in quotes eg like this(active)  $_SESSION['active'] - it reduces errors but still not fully working.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.