JSHGROUP 0 Newbie Poster

no problem, do what you have to do :0)

Justin

JSHGROUP 0 Newbie Poster

Not using an e-com package, the script is a combo of JS and PHP...you can see it here: www.kwipple.com - test website.

JSHGROUP 0 Newbie Poster

Could you please show coding example.

JSHGROUP 0 Newbie Poster

I'm launching an multi outlet online food ordering website - most of the coding etc has been done I just have a couple of problems, one of which is this....

I want to add a min order requirement so that if the order comes in at £8 the order is accepted, or if it comes in at £7.99 or under the order cannot complete.

Baring in mind that this is going to be different on each clients page, a universal code would be really good where I simply change the £X amount on each.

Also a message should appear to advide the customer that their order hasn't reached the min order requirment.


Many thanks for your help.

Justin

JSHGROUP 0 Newbie Poster

Hi there, I'm setting up a multiple outlet online food ordering website and have a question regarding delivery charge options...

Each individual outlet is going to have different delivery options, from FREE Delivery to £X cost. I simply would like to know how I include a simple piece of code that can be copied into each takeaways script, to stated that i.e. if the total order is over £8 then delivery charge is "0" if the total order is under £7.99 then a delivery charge of £1 is automatically added to the order price.

Many thanks

Justin

JSHGROUP 0 Newbie Poster

What you've given me doesn't do what I want it to do. Its still sending through everything that is listed on the form. It does that anyway without any new code being added.

Its quite simple what I want...

When a customer enters a figure next to a product on the form, as long as its 1 or greater it should be detected by the script to add that product to the email body along with all the other information, such as total price and delivery details. I do NOT want it sending fields with "0" or a blank qty box to the email address as this is pointless.

JSHGROUP 0 Newbie Poster
<body>
<script language="php">
$email = $POST[email];
$mailto = "justin@jshgroup.co.uk";
$mailsubj = "Order from PrestonTakeaways";
$mailhead = "From: Preston Takeaways\n";
reset ($HTTP_POST_VARS);
$mailbody = "Order from PrestonTakeaways:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "Name: ".$_POST["PROD_HeroBurrito_2.99"]."/n"; }
if (!eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); }
</script>
<p class="style1"><span class="style2"><strong>Thanks for your order!</strong></span></p>
<p class="style1">&nbsp;</p>
<p class="style3"><strong>Sit back relax and your meal will be with you in 
45-60mins</strong></p>
<p class="style3">&nbsp;</p>
<p class="style3"><strong>Any problems give the store a call: [number]</strong></p>
</body>
</html>

Where on the above code does this which you have provided go?

#
$mailbody .= "Product1: ".$_POST["PROD_HeroBurrito_2.99"]."/n";
#
$mailbody .= "Product2: .$_POST["PROD_SpeltBread_4.99"]."/n";
#
$mailbody .= "Product3: ".$_POST["PROD_SPMG_4_99"]."/n";
#
$mailbody .= "Product4: ".$_POST["PROD_SPCR_4_99"]."/n";


Many thanks, Justin

JSHGROUP 0 Newbie Poster

If I were you I would search for:

while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; }

And define all options seperate, so you can easily order it.

like this:

//Display it:
$mailbody .= "Name: ".$_POST["PROD_HeroBurrito_2.99"]."/n";

Do that for every product/option.
You should change PROD_HeroBurrito_2.99 to the Form name.

I hope you understand what I mean =)

Hi Viletung

Do I need to remove this:

while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; }

Completly and replace it with;

$mailbody .= "Name: ".$_POST["PROD_HeroBurrito_2.99"]."/n";


It isnt very clear.

Justin

JSHGROUP 0 Newbie Poster

HERES THE CODE:

INDEX.HTM (THANKS.PHP BELOW)

<HTML>
<HEAD>
<TITLE>Order Form Test</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <meta name="description" content="P " />
    <meta name="keywords" content="p " />
    <meta name="owner" content="JSHGROUP, PRESTONTAKEAWAYS" />
    <meta name="copyright" content="PRESTONTAKEAWAYS 2010" />
    <meta name="author" content="PRESTONTAKEAWAYS" />
    <meta name="rating" content="General" />
    <meta name="revisit-after" content="1 days" />
    
<style type="text/css">
.style1 {
	font-size: small;
	font-weight: bold;
}
.style4 {
	font-size: small;
	text-align: right;
}
.style5 {
	font-size: small;
}
.style6 {
	font-size: small;
	text-align: center;
}
.style7 {
	font-size: small;
	font-weight: bold;
	text-align: center;
}
.style8 {
	border-width: 0;
	background-color: #FFFFFF;
}
.style9 {
	font-size: small;
	font-weight: bold;
	text-align: right;
}
.style10 {
	font-size: small;
	font-weight: bold;
	text-align: right;
	color: #000080;
}
.style11 {
	font-size: small;
	text-align: left;
	color: #000080;
}
.style12 {
	font-size: small;
	text-align: right;
	background-color: #CCCCCC;
}
.style14 {
	text-align: left;
}
.style15 {
	font-size: small;
	text-align: left;
}
.style16 {
	font-family: "Times New Roman";
}
.style17 {
	text-align: center;
}
.style18 {
	font-size: small;
	text-align: right;
	color: #000080;
}
</style>

</HEAD>

<LINK REL="stylesheet" TYPE="text/css" HREF="/stylesheet.css">

<script language="JavaScript" type="text/javascript">
<!--

function CalculateTotal(frm) {
    var order_total = 0

    // Run through all the form fields
    for (var i=0; i < frm.elements.length; ++i) {

        // Get the current field
        form_field = frm.elements[i]

        // Get the field's name
        form_name = form_field.name

        // Is it a "product" field?
        if (form_name.substring(0,4) == "PROD") {

            // If so, extract the price from the name
            item_price = parseFloat(form_name.substring(form_name.lastIndexOf("_") + 1))

            // Get the quantity
            item_quantity = parseInt(form_field.value)

            // Update the order total …
JSHGROUP 0 Newbie Poster

Could you please show / explain please - not very familar with PHP and its workings, I'm surprise I got this far!

This is what comes through on email....

PROD_HeroBurrito_2_99 : 2
PROD_SpeltBread_4_99 : 1
PROD_SPMG_4_99 : 3
PROD_SPCR_4_99 : 4
PROD_SW_3_99 : 5
PROD_SWMG_3_99 : 3
PROD_RY_4_99 : 4
PROD_KT_4_99 :
PROD_KCR_4_50 :
PROD_KA_4_99 :
PROD_AG_2_99 :
TOTAL : 97.78
name : a
address : b
address0 : a
mobile : 3434
email : 334
requests : d
Submit : Deliver my Food!


Which isn't what I want, what I want is this:

PROD_HeroBurrito_2_99 : 2
PROD_SpeltBread_4_99 : 1
PROD_SPMG_4_99 : 3
PROD_SPCR_4_99 : 4
PROD_SW_3_99 : 5
PROD_SWMG_3_99 : 3
PROD_RY_4_99 : 4

TOTAL : 97.78

name : a
address : b
address0 : a
mobile : 3434
email : 334
requests : d
Submit : Deliver my Food!
====================================

Can it be done??

JSHGROUP 0 Newbie Poster

Hi there

I'm having a problem with a script.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Language" content="en-gb" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Thank You for your order!</title>
<style type="text/css">
.style1 {
	text-align: center;
}
.style2 {
	font-size: x-large;
	font-family: Arial, Helvetica, sans-serif;
	color: #000080;
}
.style3 {
	text-align: center;
	font-family: Arial, Helvetica, sans-serif;
	color: #000080;
}
</style>
</head>

<body>
<script language="php">
$email = $POST[email];
$mailto = "emailme@youknowwhere.com";
$mailsubj = "Order from xxxx";
$mailhead = "From: xxxx\n";
reset ($HTTP_POST_VARS);
$mailbody = "Order from xxxx:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; }
if (!eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); }
</script>
<p class="style1"><span class="style2"><strong>Thanks for your order!</strong></span></p>
<p class="style1">&nbsp;</p>
<p class="style3"><strong>Sit back relax and your meal will be with you in 
45-60mins</strong></p>
<p class="style3">&nbsp;</p>
<p class="style3"><strong>Any problems give the store a call: 01772 888 888</strong></p>
</body>

</html>

Basically its going to allow people to order food via my website for a takeaway.

However upon testing the script its sending me the entire list of items with numbers next to the items that have been ordered...everything else on the form is fine, total amount, delivery details etc...thats perfect.

I simply don't want to see my menu being emailed to me everytime someone orders food, plus having the entire menu emailed and having to work out whats been ordered is going to be a nightmare.

Like I said the rest of the …