/    Sign up×
Community /Pin to ProfileBookmark

Shopping Cart advice needed

I just started learnig PHP, through tutorials and i am stuck with shopping cart. Is it even possible to do this what i want. On my site there will not be price of products just quantity and i want to make, when somebody chose products, enter how much of them he wants, type his personal data and press BUY all that comes to my e-mail and then i will call them or something, there is no payment system on my site. Because my English is bad i made this little picture to see if you dont understand me. I allready have database, allmost whole design completed this is last thing i need for my site. My problem is that, i don’t have any idea how to make this, so if somebody can point me to good tutorial for that or something else, part of code, idea how to do that, or anything that can help me , it will be helpful for me. Maybe i am aking too much here, but thank you anyways. Cheers

Here is the link for picture [url]http://tinypic.com/view.php?pic=98zj36&s=8#.U3UKPfl_sVg[/url]

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@harsimarriar96May 18.2014 — Yes it is possible, You can design/code and make the site work the way you want to.

I suggest you to make an Orders Panel and Admin Control Panel for that instead of having email's from the customers. That would be better for the users too, They can track their orders which which will be user friendly and it will increase your sales.
Copy linkTweet thisAlerts:
@nullReferenceMay 19.2014 — This is a simple example that will do what you're looking for. However i do agree with harsimarriar96. The best way to accomplish this is to store the user purchases in a database and administer through an administration panel. This allows for much more functionality (for example, maybe you want to alert someone who purchased an item a month ago that you have put that same item on sale?).

This is very simple code and you will have to modify to get it exactly how you want it. I didn't include all of the fields, but enough to where you should be able to see whats going on:

[CODE]
<html>
<head>
<title>Yep</title>
</head>
<body>
<form id="simpleForm" action="process.php" method="post">
<!-- Quantity Box-->
<input type="text" name="quantity"/>

<!-- Customer Name -->
<input type="text" name="cusName"/>

<!-- Customer Email -->
<input type="text" name="cusEmail"/>

<!-- Submit button that posts the form to action attribute. In this case process.php-->
<input type="submit" value="submit"/>
</form>
</body>
</html>


<?php

/* process.php
-----------------------------------------------------------------*/

//Obtain data sent to file via http POST
$quantity = $_POST['quantity'];
$name = $_POST['cusName'];
$email = $_POST['cusEmail'];

//Create email to send
$to = '[email protected]';
$subject = 'Someone purchased something';

$headers = 'MIME-Version: 1.0' . "rn";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";
$headers .= 'From: Customer Purchase <' . $email . '>' . "rn";

//use this if you want the email to be cc'd to others
$headers .= 'Cc: [email protected], [email protected]' . "rn";

//The message
$message = 'Name: ' . $totalApprovals . '<br/>';
$message .= 'Quantity: ' . $quantity . '<br/>';


//Send email
mail($to, $subject, $message, $headers);
[/CODE]
×

Success!

Help @Guinness spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...