Binding customers contact info (collected by getway) into eCart custom email receipt
Is it possible to include the customer's contact info, which is collected by Authorize.net, into my custom email receipt from ecart?
Is it possible to include the customer's contact info, which is collected by Authorize.net, into my custom email receipt from ecart?
Yes, Authorize.net will pass back the customer details to the success page. You can then refer to that information in the email. Including just information from authorize.net is simple because you can refer to it directly. If you want to also include shopping cart information from the Session, then it is more difficult because you have to forward the information you want from the success page to your site. If you can supply a copy of your current confirm and success pages I can give more precise details.
I already have the shopping cart information included (as you know from that previous and VERY long thread), but now the client likes it so much he wants to add the customer's details (name, address etc).
OK, on line 3 of the success page you are already passing the email address forward:
die('<script>document.location.href="http://www.bandofhonor.com/checkout_success.php?email='.$_POST['x_email'].'";</script>');
To get the other fields from authorize.net you would have to pass them forward as well like:
die('<script>document.location.href="http://www.bandofhonor.com/checkout_success.php?email='.$_POST['x_email'].'&firstname='.$_POST['x_first_name'].'';</script>');
Then you could refer to the first name in your email with <?php echo($_GET['firstname']); ?>
For a complete list of variables passed back to your page see: http://www.authorize.net/support/SIM_guide.pdf
so I would add all the fields I want from their list in that same script just by continuing to add '&nameoffield='.$_POST['x_nameoffield']." using the field names from Authorize? Or does each field need its own script?
Yes, append any fields you want passed with that syntax... they would not need their own script just appended to that one as you suggested.
So this is what I have done:
die('<script>document.location.href="http://www.bandofhonor.com/checkout_success.php?email='.$_POST['x_email'].'&firstname='.$_POST['x_first_name'].'&lastname='.$_POST['x_last_name'].'&address='.$_POST['x_address'].'&city='.$_POST['x_city'].'&state='.$_POST['x_state'].'&zip='.$_POST['x_zip'].'&country='.$_POST['x_country'].'&phone='.$_POST['x_phone'].'';</script>');
And now I need to add a php for each of these fields:
<?php echo($_GET['firstname']); ?>
<?php echo($_GET['lastname']); ?>
and so on thru all the fields.
Is there anywhere in particular i should put this php?
Anywhere you want it to appear in the email body. Just put it where it fits in your email page design.
So that part of the code goes on the email page (blank_2) instead of the checkout_success?
It could go on both... wherever you want to refer to the information collected by authorize.net once you get back to your page.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.