close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues


Custom Field bind to email

Thread began 3/01/2011 7:50 pm by adam106173 | Last modified 3/04/2011 2:30 pm by Jason Byrnes | 913 views | 3 replies |


Custom Field bind to email


I'm trying to add a custom field to my checkout page in eCart 4. I was able to add this select menu titled "howDidYouHear". I also validated it and it works perfectly. The problem is I can't get it to show up in the email. I think the problem is on the confirm page where I can't get it to show up under the ecart_checkout_form. I manual pasted the code from my checkout page into the confirm so it reads like this:

<p class="eC_OrderInfo"><span class="eC_OrderInfoLabel">Howdid I hear about Calmer, Easier, Happier Parenting:</span>**<?php echo((isset($_POST["howDidYouHear"]))?$_POST["howDidYouHear"]:"") ?></p>

This works in that it shows up on the confirm page perfectly. But I don't see the server behavior in DW and don't know how to get it there. In the WAUE_confirm_2.php page, I put this code (which doesn't work):

$MailBody = $MailBody . ((isset($_SESSION['howDidYouHear']))?$_SESSION['howDidYouHear']:"");

What am I missing?

Sign in to reply to this post

Jason ByrnesWebAssist

when you add a new form field to the checkout page, you will need to do 2 things for the data to persist on other pages.

1) on the confirm page, there is a collection of hidden form elements near the bottom of the page, add a new hidden form element with the name as the new element added to the checkout page, and set it to catch the value posted from the checkout page:

<input type="hidden" name="howDidYouHear" id="howDidYouHear" value="<?php echo ((isset($_POST["howDidYouHear"]))?$_POST["howDidYouHear"]:""?>" />

2) On the confirm page, add a set session value behavior to catch the value of the new form element. On the server behaviors panel, click the plus button and select eCart -> General -> Set Session Value.

Set the Trigger to any form post

set the name to the same name as the form element: howDidYouHear

click the lightning bolt next to value and select the howDidYouHear form element from the bindings collection.

Now the howDidYouHear session variable will be set so that it can be used in the email.

Sign in to reply to this post


I just got it to work and I did add that extra code on the bottom of the page as a hidden element. That added it to the server behavior list. Then I had to add to the code eCartCheckoutForm to the HowDidYouHear so it reads: eCartCheckoutForm_howDidYouHear

Now it seems to function all the way through. Maybe I did the same thing you suggested?

Sign in to reply to this post

Jason ByrnesWebAssist

glad to hear it is working.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

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.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...