close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

adding a custom element to paypal direct checkout

Thread began 4/16/2009 12:21 pm by russell_m89943 | Last modified 4/17/2009 2:15 pm by Ray Borduin | 7440 views | 10 replies |

russell_m89943

adding a custom element to paypal direct checkout

This is a bit of a hack I realize but I'd like to add an extra field to the data being sent to paypal that would hold a reference to where the shopper found the store (magazine ad, website, search engine, etc). I was thinking I could somehow tack it on to the end of the merchandise loop in the checkout page where the user is filling out their billing/shipping info. I'm also quite happy to throw it into any existing optional fields paypal direct payment pro has available if that makes it easier.

Anyone out there have enough experience with paypal pro and eCart to guide me through something like this? If possible I'd prefer to just hand code the change in there, I find changing existing eCart configs tends to mysteriously break things.

Sign in to reply to this post

Ray BorduinWebAssist

You could probably find the description on the confirm page and add it by hand fairly easily. Just find a logical field to append it to and add it there.

Sign in to reply to this post
Did this help? Tips are appreciated...

russell_m89943

I'm not actually using the confirm page at the moment but if that's the easiest way to do it then I'm happy to add that in. I should mention I'm adding the eCart functionality one page at a time, as I found the wizard did all sorts of weird things for me. (mac on CS4 is anyone is keeping track)

Sign in to reply to this post

Ray BorduinWebAssist

It is wherever your local checkout server behavior is applied. That is the page where the wizard applies it.

Sign in to reply to this post
Did this help? Tips are appreciated...

russell_m89943

I'm trying the following:

$PP_DirectPayment_itemized[0][0] = "OrderTotal";
$PP_DirectPayment_itemized[1][0] = "".$bellaCart->GrandTotal() ."";
$PP_DirectPayment_itemized[0][1] = "OrderDescription";
$PP_DirectPayment_itemized[1][1] = "".((isset($_POST["country"]))?$_POST["reference"]:"") ."";
while ( !$bellaCart->EOF() ) {

"reference" being the form field I want to grab the info from.
I purposely made the submission fail to look at the submission and lucky me, the request string contains that fields info. I'm assuming that data is present somewhere in the paypal records, even though it's not showing up anywhere in the email notification. (this is all sandbox right now)

Guess I replied to say thanks for the tip and to pass on some knowledge should anyone else need this hack.

Sorta related question: Let's say I wanted to add a confirmation page before sending to paypal. How would one go about doing that manually without breaking the eCart code?

Sign in to reply to this post

Ray BorduinWebAssist

This page would actually become the confirmation page. You would make all of the form elements hidden and then create another checkout page that has the visible form that is filled out.

Then populate the hidden form on this page with the values from the form on the previous page so that they are automatically the values in this form which you already have working.

PS although your code may work, the code would more properly be:
$PP_DirectPayment_itemized[1][1] = "".((isset($_POST["reference"]))?$_POST["reference"]:"") ."";

Sign in to reply to this post
Did this help? Tips are appreciated...

russell_m89943

Thanks, I changed the code to what you suggested, I'm a bit rusty at PHP at the moment, I'm just waking up from a long trip into objective-c and the syntax change is bending my brain ;-)

Sign in to reply to this post

russell_m89943

Hmmmm, new roadblock:

changed my original checkout page to a confirmation page by leaving everything alone with the exception of changing the forms to "hidden"

Created a new checkout form page that links to the above page. Weirdly enough when I point to this page it seems like the form is auto-submitting and the user gets no chance to review their information.

EDIT:
So I see what's going on, this line is running the minute the page is requested
if ($_SERVER["REQUEST_METHOD"] == "POST") {

Is there a way around this?

Sign in to reply to this post

Ray BorduinWebAssist

Use the button press trigger instead of the any form submit trigger...

something like:
if (((isset($_POST["yourButtonName"]))?$_POST["yourButtonName"]:"") != "") {

Sign in to reply to this post
Did this help? Tips are appreciated...

russell_m89943

Pretty close but that particular syntax didn't work, I had to add an _X to it like this:

if (((isset($_POST["paypal_x"]))?$_POST["paypal_x"]:"") != "") {

(where "paypal" is the name of my submit button)

Thanks for the lead though!

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