Setup Shopp eCommerce Plugin with zferral

by Lorenzo Orlando Caum on July 11, 2012

zferral is referral software that you can use with Shopp. If you want to increase sales in your online store, then you should definitely consider adding an affiliate program. We’ve written tutorials on setting up Shopp with ShareaSale and AffiliateRoyale. Your affiliates will boost your sales by driving traffic to your Shopp online store.

We’ll show you how to configure Shopp to work with zferral in under ten minutes.

zferral supports four methods of integration: IMG pixel, IMG pixel HTTPS, Javascript, and PHP pingback. In this tutorial we’ll discuss the IMG pixel HTTPS method.

The documentation for zferral states that a code snippet should placed on the “success” page. In Shopp, this is the confirmation or thanks page. There are a few variable values — only the first is required:

  1. $rev – the total value of the transaction
  2. $customerid – the customer id
  3. $uniqueid – unique order transaction id
  4. $info – other information about the order
  5. $coupon – affiliate coupon

Then there is one fixed value which is name of the login page (accountname). You can find yours by logging into your zferral account.

Here is an example ($info and $coupon are not used):

<img src="https://accountname.zferral.com/e/2?rev=24.00&customerId=hello@enzo12.com&uniqueId=2cll21ozne" style="border: none; display: none" alt=""/>
  • $rev = 24.00
  • $customerid = hello@enzo12.com
  • $uniqueid = 2cll21ozne

Now its time to swap in the example above with the Shopp API calls for order total, customer’s email, and order transaction id:

<img src="https://accountname.zferral.com/e/2?rev=<?php echo floatvalue(shopp('purchase.get-total')); ?>&customerID=<?php shopp('purchase','email'); ?>&uniqueID=<?php shopp('purchase','transactionid'); ?>" style="border: none; display: none" alt=""/>

The above code is now almost ready to use. You simply need to replace ‘accountname’ with your real zferral account name.

Here are the steps for inserting the code snippet in your Shopp thank you page.

  1. Login to your site with your favorite FTP client. We recommend Transmit (for Mac).
  2. Browse to the Shopp content templates folder (/wp-content/themes/yourthemefolder/shopp)
  3. Locate the thanks.php and create a backup of the file
  4. Open the file with a text editor
  5. Insert your code snippet towards the top of the file just after [php if (shopp('checkout','completed')] and save changes

Now run a test transaction and you should see the order data in your zferral account within a few minutes.

Notes: you can retrieve the order subtotal by using purchase.get-subtotal instead of purchase.get-total.

Related Posts Plugin for WordPress, Blogger...

Is your site slow? Find out right now with a free WordPress speedtest. You'll also receive professional recommendations for making your Shopp FAST.
Stop losing sales because of a slow site!

Author: Lorenzo Orlando Caum

Lorenzo Orlando Caum is an entrepreneur and a marketer.

Lorenzo contributes to the Shopp project as a member of the support team. He has written several WordPress extensions for Shopp. You should have a look at his latest project: Video tutorials for Shopp.

He is the founder of Enzo12 LLC, a web engineering firm in Tampa, FL. If you would like to know more about Lorenzo, you can follow @lorenzocaum on Twitter or check out his blog.

Previous post:

Next post: