close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Integrating Constant Contact into PayPal checkout

Thread began 10/19/2017 1:52 pm by jlowery | Last modified 11/01/2017 3:11 pm by Ray Borduin | 31 views | 9 replies |

jlowery

Integrating Constant Contact into PayPal checkout

I'm trying to reintegrate a call to Constant Contact if the "add me to your newsletter" checkbox is selected during checkout. I had it working in the previous version that was local checkout, so I have all the Constant Contact routines to put on the checkout success page. I just need to trigger that if the checkbox is selected. How do I check (or store and check) a cookie or session variable since I'm going to PayPal and back?

This is the code I have for my newsletter checkbox:

<input name="emailList" type="checkbox" id="emailList" value="1" >
<label for="emailList" class="sublabel">Please add me to your email list.</label>
Sign in to reply to this post

Ray BorduinWebAssist

Just save the checkbox value into the session using the posted checkbox form field as the trigger. That will only save it when it is checked and you can check the session variable value on the paypal confirm page.

Sign in to reply to this post

jlowery

What server behavior do I use to save the session and on which page do I put it?

Sign in to reply to this post

Ray BorduinWebAssist

You could use the "Set Session Value" server behavior in the cookies section and set it on the confirm_cart.php page.

Sign in to reply to this post

jlowery

Getting closer. I can't see a way to use the posted checkbox form as the trigger. My options are: any form post, before page load, eCart is empty/not empty. Could I use before page load? And further - what value do I specify?

Sign in to reply to this post

Ray BorduinWebAssist

If you add the checkout form to the bindings for the confirm_cart page from the bindings panel first, then you can use the lightning bolt to set the trigger to the form element.

Come to think of it since you are using the latest version of eCart the entire checkout form is automatically saved in the persistent form, so you can just reference it from the pp_confirm page already from the persisted value.

Sign in to reply to this post

jlowery

Not working yet. I think it might be because the session variables I'm using to get the info for Constant Contact (first & last name, email) are using the eCart 5 syntax instead of eCart 6. This is what I now have:

$theEmail = ((isset($_SESSION["eCartCheckoutForm_email"]))?$_SESSION["eCartCheckoutForm_email"]:"");
$theFirstName = "";
$theLastName = ((isset($_SESSION["eCartCheckoutForm_firstname"]))?$_SESSION["eCartCheckoutForm_firstname"]:"")." ".((isset($_SESSION["eCartCheckoutForm_lastname"]))?$_SESSION["eCartCheckoutForm_lastname"]:"");



I'm not sure of the workflow and couldn't find where sessions are set. I've attached my checkout, confirm, confirm_cart, and pp_confirm pages for your review.

Sign in to reply to this post

Ray BorduinWebAssist

You should be able to refer to whether the email checkbox was checked or not with:
WA_getSavedFormValue("CheckoutWizard_Sharp_Default","emailList");

and then the email address would be:
WA_getSavedFormValue("CheckoutWizard_Sharp_Default","Email_Address")

and the name would be:
WA_getSavedFormValue("CheckoutWizard_Sharp_Default","First_Name")
WA_getSavedFormValue("CheckoutWizard_Sharp_Default","Last_Name")

So your code might look like:

php:
<?php

if (WA_getSavedFormValue("CheckoutWizard_Sharp_Default","emailList")) {
    
$theEmail WA_getSavedFormValue("CheckoutWizard_Sharp_Default","Email_Address");
    
$theFirstName WA_getSavedFormValue("CheckoutWizard_Sharp_Default","First_Name");
    
$theLastName WA_getSavedFormValue("CheckoutWizard_Sharp_Default","Last_Name");
    
$theFullName $theFirstName " " $theLastName;
   
// constant contact code here
}
?>
Sign in to reply to this post

jlowery

After applying those changes, I now get the message "Column 'email_list' cannot be null" on the pp_confirm page. The email is being stored in the database in the Customers table. I've attached that page.

Any ideas on what's going wrong?

Sign in to reply to this post

Ray BorduinWebAssist

I'll contact you for a premier support ticket to look into what is going on and get it fixed.

Sign in to reply to this post
loading

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

Content

rating

Layout

rating

Ease of use

rating

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...