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

rating

Display Size and Color in PayPal Description and Storing in Database

Thread began 7/21/2012 5:09 pm by bill173836 | Last modified 7/27/2012 11:14 am by Jason Byrnes | 1973 views | 17 replies |

bill173836

Display Size and Color in PayPal Description and Storing in Database

I'm using Paypal Express Checkout. I followed the tutorial for adding size and color options and it appears to be working although I had to modify things a little from the tutorial a little. Here is my issue I want the size and color to show up on the paypal site as a detail. I'm not sure now to make that work correctly. When I checkout and go to the paypal site the Name, Item Number, Price and Quantity show up but not the size or color. Also how do I store this in the database on the confirm page? Here is a link to my test product... products_detail.php?ProductID=2

Sign in to reply to this post

Jason ByrnesWebAssist

in the cart object, create a new calculation named "productName", set the data type to text and the calculation as:
[Name] .' Size '. [Size] .' Color '. [Color]

On the Check out page, open the server behaviors panel and double click the Authorize Transaction with PayPal express checkout, bind the item name setting the productName column from the cart.

the checkout wizard would add the Store Cart Summary and store Cart Details behaviors to the pp_confirm page. You can edit the store cart details behavior, and bind the Name column of the order details table to the productName cart column.

Sign in to reply to this post

bill173836

The Authorize Transaction isn't available on my checkout.php page. It was either Ray and You that had me make a change to make it work with my server and the Authorize Transaction disappeared whenever this was done. I don't remember exactly what he did. Here is the checkout and pp_confirm files for your reviews.
Thanks

Attached Files
checkout.zip
Sign in to reply to this post

Jason ByrnesWebAssist

to change the column used to pass the name, edit this line on the checkout page:

php:
$WA_PP_ECO_Do_itemized[0][$nextIndex] = "Name" . strval($cartIndex+1) . "";

    $WA_PP_ECO_Do_itemized[1][$nextIndex] = "".$siteCart->DisplayInfo("Name")  ."";





if you named the calculation "productName", change that code to:

php:
$WA_PP_ECO_Do_itemized[0][$nextIndex] = "Name" . strval($cartIndex+1) . "";

    $WA_PP_ECO_Do_itemized[1][$nextIndex] = "".$siteCart->DisplayInfo("productName")  ."";
Sign in to reply to this post

bill173836

We're making headway here. There still are a few issues.
On the pp_confirm.php page I changed the store details to store the productName instead of the Name and that works fine.

1. The receipt that is sent by paypal doesn't include the Color or Size information.
2. The receipt sent from my site returns the error reflected in the attachment.

I've uploaded the screen capture of the error and the 2 files involved in the error.

Thanks.

Attached Files
ErrorStuff.zip
Sign in to reply to this post

Jason ByrnesWebAssist

line 89:

php:
if ( $Color == "") echo ""; else echo "<strong>Color:</strong> $Color ";




should be:

php:
if ( $Color == "") $MailBody = $MailBody . ""; else $MailBody = $MailBody . "<strong>Color:</strong> $Color ";




line 94:

php:
if ( $Size == "") echo ""; else echo "<strong>Size:</strong> $Size";



should be:

php:
if ( $Size == "") $MailBody = $MailBody . ""; else $MailBody = $MailBody . "<strong>Size:</strong> $Size";
Sign in to reply to this post

bill173836

I switched out the code and I no longer get the error message.

But now the PayPal receipt (see image) isn't including the Color or Size information and the email from my site doesn't include the Order Number and there is a lot of space between the Description and the description text and the Color and Size. On the bright side everything seems to be going in the database correctly.

Attached Files
EmailIssue.zip
Sign in to reply to this post

bill173836

To go with my last post here is a copy of the receipt that gets sent from my site. You'll see there isn't a Order Number and there are gaps be Description: and the description text and the description tex and the Color and Size fields.

Sign in to reply to this post

Jason ByrnesWebAssist

for the paypal receipt, find the following code on the pp_confirm.php page:

php:
$WA_PP_ECO_Do_itemized[0][$nextIndex] = "Name" . strval($cartIndex+1) . "";
  $WA_PP_ECO_Do_itemized[1][$nextIndex] = "".$siteCart->DisplayInfo("Name")  ."";



and change it to:

php:
$WA_PP_ECO_Do_itemized[0][$nextIndex] = "Name" . strval($cartIndex+1) . "";
  $WA_PP_ECO_Do_itemized[1][$nextIndex] = "".$siteCart->DisplayInfo("productName")  ."";




for the receipt on your page, the order number does not show because of code order.

The email code block is at lines 433 - 521 of the pp_confirm.php page 522 - 635 is the code block for storing the order information in the database. The order ID is created by the store order summary behavior. The email code block needs to be moved to line 635 so it happens after the order is saved to the database and the ID is created.


The spaces between the description and the options are happening because you have each block in a separate paragraph in the email message.

the code for the name dfescription and options in the email is:

php:
$MailBody = $MailBody . "<p style=\"font-weight:bold; margin:0 0 2px 0;\"><strong>";
$MailBody = $MailBody .  $siteCart->DisplayInfo("Name");
$MailBody = $MailBody . "</strong></span></p>\r\n";
$MailBody = $MailBody . "<p style=\"margin:0 0 2px 0;\"><strong>Description:</strong>&nbsp;";
$MailBody = $MailBody .  $siteCart->DisplayInfo("Description");
$MailBody = $MailBody . "</span></p>\r\n";
$MailBody = $MailBody . "<p style=\"margin:0 0 2px 0;\">";
 $Color = $siteCart->DisplayInfo("Color"); 
$MailBody = $MailBody . "";
 if ( $Color == "") $MailBody = $MailBody . ""; else $MailBody = $MailBody . "<strong>Color:</strong> $Color "; 
$MailBody = $MailBody . "</span></p>\r\n";
$MailBody = $MailBody . "<p style=\"margin:0 0 2px 0;\">";
 $Size = $siteCart->DisplayInfo("Size"); 
$MailBody = $MailBody . "";
 if ( $Size == "") $MailBody = $MailBody . ""; else $MailBody = $MailBody . "<strong>Size:</strong> $Size"; 
$MailBody = $MailBody . "</span></p>\r\n";



change that to:

php:
$MailBody = $MailBody . "<p style=\"font-weight:bold; margin:0 0 2px 0;\"><strong>";
$MailBody = $MailBody .  $siteCart->DisplayInfo("Name");
$MailBody = $MailBody . "</strong></span></p>\r\n";
$MailBody = $MailBody . "<strong>Description:</strong>&nbsp;";
$MailBody = $MailBody .  $siteCart->DisplayInfo("Description");
$MailBody = $MailBody . "</span>\r\n";
$MailBody = $MailBody . "";
 $Color = $siteCart->DisplayInfo("Color"); 
$MailBody = $MailBody . "";
 if ( $Color == "") $MailBody = $MailBody . ""; else $MailBody = $MailBody . "<strong>Color:</strong> $Color "; 
$MailBody = $MailBody . "</span>\r\n";
$MailBody = $MailBody . "";
 $Size = $siteCart->DisplayInfo("Size"); 
$MailBody = $MailBody . "";
 if ( $Size == "") $MailBody = $MailBody . ""; else $MailBody = $MailBody . "<strong>Size:</strong> $Size"; 
$MailBody = $MailBody . "</span></p>\r\n";



So that only one paragraph is used.

Sign in to reply to this post

bill173836

If I change the eCart calculation for productName to (((( ' Product: '.[Name] .' Size: '. [Size] .' Color: '. [Color] ))))) instead of (((( [Name] .' Size '. [Size] .' Color '. [Color] )))) will the : show up with the Size and Color like Size: Large Color: Black on Paypal or will it cause an error in the code? As it currently is it's showing Product Name Size Large Color Black where as I'd prefer Product: Product Name Size: Large Color: Black

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