1shoppingcart is a great shopping cart solution for many marketers who have their own payment gateway, but don’t want to run a shopping cart script on their own server.
1SC has limited integration options, one of them being the ability to forward customer and sale data to your thank-you page after a purchase. The only problem is that the 1SC techs have so far failed (or have done a poor job at) documenting this feature, and how to access the data they pass along.
We have compiled a list of the common data set names that 1SC passes along with every order, and I’ll show you what they are, and how to harness them.
Forwarded Variables
Here is a complete listing of all the data 1shoppingcart send to your site. The names of the data sets are exactly as 1sc sends them, with some notes on their format:
Customer Details
name, company, email1, address1, address2, city, state, zip, country, fax, phone, secondaryphone
Notes:
- name is the full name of the customer, exactly as they entered it on the checkout page
- note the one (1) at the end of email1. I don’t know why they would not just call it email, but it is important to note
- country is the full name of the customer’s country, not an abbreviation
Shipping Details
shipname, shipCompany, shipAddress1, shipAddress2, shipCity, shipState, shipZip, shipCountry
Notes:
- Take note of the camel casing in most of the variable names. The 1shoppingcart engineers seem to be rather inconsistent with their formating, which is a big deal, since these variable names are case sensitive
- like name, shipname returns a full, complete name
- also, like country, shipCountry returns the full country name
Payment Details
cardtype, status
Notes:
- status tells you the status of the order. The value of this variable should be “Accepted” most, it not all the time
Order Details
skun, productn, quantityn, optionn, option1n, option2n, pricen, plist, Total, grandTotal, adtrack
Notes:
You can find a product ID right above a product's name field.
- The letter n represents a number. You will have have n number of unique variables, depending on the number of items the customer had in their shopping cart when checking out. (example: suppose your customer had 3 items in their cart, your variables will be sku1, sku2, sku3 and product1, product2, product3 etc.)
- sku gives you the item sku you specified under the product options (if any). productn gives you the product name.
- plist returns a comma-separated list of 1shoppingcart product ID’s for each of the products in your customer’s cart. This ID number should not be confused with the product’s sku, or the order’s ID number, both of which are totally different.
- adtrack returns the ad tracking id associated with the order. If you happened to set up any ad trackers for your products, and a customer clicked and eventually ordered a product through this ad, you will see adID for the ad in this variable
How To Use This Data
If you know some PHP, you can access this data using the $_POST variable array. For example, if you would want to print the customer’s name to the screen, you would use the following code:
1 2 | <?php echo $_POST['name']; |
For Your Reference
In case you need a little more guidance, here is a sample dataset that 1SC sends to you.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | <?php print_r($_POST); /* Printing the POST array like so returned the following during my testing: Array ( [orderID] => 148231700 [name] => Some Name [company] => [email1] => email@site.com [address1] => 123 Fake St. [address2] => [city] => Somewhere [state] => California [zip] => 90210 [country] => United States [fax] => [phone] => 123-456-7890 [secondaryphone] => [cardtype] => [shipname] => Some Name [shipCompany] => [shipAddress1] => 123 Fake St. [shipAddress2] => [shipCity] => Somewhere [shipState] => California [shipZip] => 90210 [shipCountry] => United States [status] => Accepted [sku1] => [product1] => Test Product [quantity1] => 1 [option1] => [option11] => [option21] => [price1] => 0.00 [sku2] => test [product2] => Test Product [quantity2] => 1 [option2] => [option12] => [option22] => [price2] => 0.00 [plist] => 5576292,5623692 [Total] => 0.00 [grandTotal] => 0.00 [adtrack] => 0 ) */ |
I Need Your Help
1shoppingcart may change the names of these variables at any time, or even add new ones or remove some entirely. If you notice or are aware of any changes, please leave a note in the comments.
One Comment
David D Ochoa
12:13 pm
Permalink
Thanks Andrew. This is exactly what I was looking for. Too bad you can’t pass subids to them. I need to know which ads are working, and capture email.