473,383 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

e-commerce

5
Hi guys,

I am trying to build an e-shop using php and mysql. So far, I have managed to store the products, the customers and the products that they have been ordered, to the database. I also have managed to select all of them from the database. I would like to ask you how can I manage to make an order for different products at the same time without the customer to be registered again. Just to give a username and password and then to make the order.

Thanks a lot guys.
Oct 2 '07 #1
8 1408
ak1dnar
1,584 Expert 1GB
I think your question is, you need a way for adding multiple products to the same shopping cart, right?
Oct 2 '07 #2
No ajaxrand. They're asking for a quick and easy way to store a username and password.

Bascially you need to ask for a username and password at checkout.

In your customers table, add those two fields

Create a quick <form> that asks for those two fields, then
Expand|Select|Wrap|Line Numbers
  1. $userid = mysql_query("SELECT userid FROM customers where username='$username' and password = '$password'");
  2.  
  3. if (!empty($userid))
  4.    $_SESSION["userid"] = $userid;
  5. else
  6.   ;// no user found
  7.  
There are other ways to do this with the $_COOKIE session variable, but it's all the same.

Then on your page where you collect billing and shipping information, do a quick test for:
Expand|Select|Wrap|Line Numbers
  1. if (isset($_SESSION["userid"]))
  2.    ;// get all the previously registered information and then use it as the <input name="firstname" value="$firstname"
  3.  
HTH,

Rob
Oct 3 '07 #3
subaru
5
You are close ajaxrand,

What I need to do is to add multiple products to the same customer iwithout being registered again.
Oct 3 '07 #4
ronverdonk
4,258 Expert 4TB
robbiesmith79: When adding code in this forum please add code tags around them. See the Posting Guidelines on how do do that.

moderator
Oct 3 '07 #5
ak1dnar
1,584 Expert 1GB
You are close ajaxrand,

What I need to do is to add multiple products to the same customer iwithout being registered again.
You have to handle this from table level:
So it's better to show us the table structure that you have made so far. Then we'll be able to get a clear picture.
Oct 3 '07 #6
subaru
5
Thanks ajaxrad. I will post to you the table structure so you have a clear idea of what I need to do.
if the customer does not exist, then add to the customers table. In the shipping page, I see the customer's details with the item tha have been ordered.

I the customer exists, then I want to add another item to the cart but without the customer to be registered again. I mean, the existing customer has to give a username and a password and then the new item will be added to the existing customer.
Oct 3 '07 #7
Thanks ajaxrad. I will post to you the table structure so you have a clear idea of what I need to do.
if the customer does not exist, then add to the customers table. In the shipping page, I see the customer's details with the item tha have been ordered.

I the customer exists, then I want to add another item to the cart but without the customer to be registered again. I mean, the existing customer has to give a username and a password and then the new item will be added to the existing customer.
You could call the customer id and link it to the orders. So instead of having to require your customer to login again and again, you could use the customer id as a foreign key in the table that contains the customer's orders.
Oct 4 '07 #8
ak1dnar
1,584 Expert 1GB
You could call the customer id and link it to the orders. So instead of having to require your customer to login again and again, you could use the customer id as a foreign key in the table that contains the customer's orders.
Yet I don't know, what he has done with his customer registration and login.
That's what I am waiting to see those tables. but you are so correct. On the orders table we have to insert ordered items with a reference to the customer table (customer id) for each product that the customer willing to purchase.

If there is No login or Customer accounts simply he can use a Session based Shopping cart with the application.
Oct 4 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Laphan | last post by:
Hi All I seem to be getting to grips with the whole ASP DB ecommerce thing, but there are certain aspects that my knowledge is really thin. If poss, could you please advise or point me in the...
1
by: Miguel Dias Moura | last post by:
Hello, in 2 months i will create an eCommerce web site in ASP.net. I have been creating web sites in Flash, ASP, ASP.net and PHP for quite sometime. However i never created an eCommerce web...
0
by: VB Programmer | last post by:
I installed IBuySpy ECommerce app and customized an ecommerce site. Now I want to make a 2nd ECommerce app, based on the Starter Kit. But, when I run Setup it asks if I want to repair or...
6
by: J Rieggle | last post by:
Hi there, I am stuck on a problem that relates to eCommerce sites, but isnt ASP.NET specific (sorry). The ecommerce site is working in the UK, and products will be sold in pounds stirling. ...
7
by: Joe | last post by:
Hi there. I have to develop an eCommerce/intranet application for a client which obviously has to access a database(mysql in this case) and handle posting data to the server where I can hanle the...
2
by: Brent Borovan | last post by:
Over the next few months our company will be adding ecommerce functionality to a new web based service we are developing. Customers can sign up for the service and pay for it either on a monthly...
0
by: Lisa | last post by:
This is a unique opportunity to architect and build a new web site and integrate with all other company software to provide global commerce for our products on the web from the ground up. The...
2
by: Griff | last post by:
Hi We have an eCommerce site that was designed as a BusinessToBusiness system. When anyone accesses a page, the site checks to see whether they have a current session (i.e. already...
11
by: Greg | last post by:
How can C# be used for a website ? Would the person viewing a site need to have the .NET framework installed ? What other technologies would need to be used ? Would a database server be needed...
1
by: ss.morshedi | last post by:
Dear all; please answer my questions,tnx. 1.Explain the advantages of using XML with a database for ecommerce sites 2.Explain the functionalities of your website especially with regard to...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.