{"id":224,"date":"2010-05-03T05:39:11","date_gmt":"2010-05-03T05:39:11","guid":{"rendered":"http:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/?p=224"},"modified":"2016-03-11T06:01:05","modified_gmt":"2016-03-11T06:01:05","slug":"integrating-the-cforms-plugin-with-the-wp-affiliate-software","status":"publish","type":"post","link":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/integrating-the-cforms-plugin-with-the-wp-affiliate-software-224","title":{"rendered":"Integrating the cForms plugin with the WP Affiliate Software"},"content":{"rendered":"<p>This page explains the cForms plugin integrating \u00a0with the <a href=\"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate-platform-plugin-simple-affiliate-program-for-wordpress-blogsite-1474\">WP Affiliate Software<\/a> to design a Pay Per Lead Affiliate Model.<\/p>\n<p>This instruction is best suited for someone with PHP Coding Knowledge.\u00a0Please follow one of the following integration instructions:<\/p>\n<h2>i) Integration Option 1<\/h2>\n<p>This integration was documented by Sean Conway from 499sitedesign.com<\/p>\n<p>All i needed to do was follow the instructions @ cform II for using the my-functions.php file (i used the override location) and include this code. To use this code you may need to change [&#8216;Email *&#8217;] and [&#8216;Your Name *&#8217;] to match the field titles in the form. I have included some comments to help.<\/p>\n<div id=\"_mcePaste\">\n<ul>\n<li><a href=\"http:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/wp-content\/uploads\/2010\/08\/cforms2-lead-capturing-integration-option1.txt\" target=\"_blank\"><strong>View Code<\/strong><\/a><\/li>\n<\/ul>\n<\/div>\n<h2>ii) Integration Option 2<\/h2>\n<p>This integration was done and documented by Yvette Kwei from magnumip.com.au<\/p>\n<h4>Little Background<\/h4>\n<p>I created a form with the popular Cforms II plugin (version 11.1).<\/p>\n<p>In my form, users enter their contact details and then choose between one of four packages that I offer (&#8220;Basic&#8221;, &#8220;Standard&#8221;, &#8220;Premium&#8221; and &#8220;Custom&#8221;). Each package has a different price (in this example, $95, $195, $295, and $395). I wanted to pay my Affiliates for sending me these leads. Further, I wanted the &#8220;Unique Transaction ID&#8221; in WP Affiliate to be the ID given by Cforms to the particular submission.<\/p>\n<h4>The Integration Steps<\/h4>\n<p><strong>1. <\/strong>Insert the following code into the &#8220;my-functions.php&#8221; file within cForms:<br \/>\n##### Start code here:<\/p>\n<pre>function my_cforms_action($cformsdata)\r\n{\r\nif (!empty($_SESSION['ap_id'])) $referrer = $_SESSION['ap_id'];\r\nelse if (isset($_COOKIE['ap_id'])) $referrer = $_COOKIE['ap_id'];\r\n\r\nif (!empty($referrer))\r\n{\r\n$email = $cformsdata['data']['Email'];\r\n$txnid = $cformsdata['subid'];\r\n$itemid = 'Unknown';\r\n$amount = 0.0;\r\n\r\n$item = $cformsdata['data']['Type of Service'];\r\nif (strpos($item, 'Basic') === 0) { $amount = 95.0; $itemid = 'Basic'; }\r\nelse if (strpos($item, 'Standard') === 0) { $amount = 195.0; $itemid = 'Standard'; }\r\nelse if (strpos($item, 'Premium') === 0) { $amount = 295.0; $itemid = 'Premium'; }\r\nelse if (strpos($item, 'Custom') === 0) { $amount = 395.0; $itemid = 'Custom'; }\r\n\r\nwp_aff_award_commission($referrer, $amount, $txnid, $itemid, $email);\r\n}\r\n}\r\n<\/pre>\n<p>##### End Code here.<\/p>\n<p><strong>2.<\/strong> Insert a single line of code in &#8220;..\/wp-content\/plugins\/cforms\/lib_nonajax.php&#8221;:<\/p>\n<pre>###\r\n### allow the user to use form data for other apps\r\n###\r\n$trackf['id'] = $no;\r\n$trackf['subid'] = $subID; ###### &lt;&lt;--- Insert this line here #####\r\n$trackf['data'] = $track;\r\nif( function_exists('my_cforms_action') )\r\nmy_cforms_action($trackf);\r\n<\/pre>\n<h3>Notes:<\/h3>\n<ul>\n<li>Cforms v.11.1 allows you to place the &#8220;my-functions.php&#8221; file in a folder called &#8220;cforms-custom&#8221; rather than &#8220;cforms&#8221; itself. This allows you to protect your custom scripts from being over-written when upgrading cforms. If you&#8217;ve taken advantage of this option (recommended) make sure the code you insert in step 1 is in the &#8220;..\/wp-content\/plugins\/cforms-custom\/lib_nonajax.php&#8221; file.<\/li>\n<li>Obviously, you can rename the packages to whatever you want, and set the prices to whatever you want, but if you change the packages, you&#8217;ll need to manually update the data in the &#8220;my-functions.php&#8221; file.<\/li>\n<li>If you upgrade Cforms, you&#8217;ll need to re-insert the code in the lib_nonajax.php file.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This page explains the cForms plugin integrating \u00a0with the WP Affiliate Software to design a Pay Per Lead Affiliate Model. This instruction is best suited for someone with PHP Coding Knowledge.\u00a0Please follow one of the following integration instructions: i) Integration Option 1 This integration was documented by Sean Conway from 499sitedesign.com All i needed to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[12],"tags":[16],"class_list":{"0":"post-224","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-3rd-party-cart-integration","7":"tag-pay-per-lead","8":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Integrating the cForms plugin with the WP Affiliate Software - WordPress Affiliate Platform<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/integrating-the-cforms-plugin-with-the-wp-affiliate-software-224\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/integrating-the-cforms-plugin-with-the-wp-affiliate-software-224#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/integrating-the-cforms-plugin-with-the-wp-affiliate-software-224\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/#\/schema\/person\/b3a690506213824832751de546a340fb\"},\"headline\":\"Integrating the cForms plugin with the WP Affiliate Software\",\"datePublished\":\"2010-05-03T05:39:11+00:00\",\"dateModified\":\"2016-03-11T06:01:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/integrating-the-cforms-plugin-with-the-wp-affiliate-software-224\"},\"wordCount\":359,\"commentCount\":1,\"keywords\":[\"Pay Per Lead\"],\"articleSection\":[\"3rd Party Cart Integration\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/integrating-the-cforms-plugin-with-the-wp-affiliate-software-224#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/integrating-the-cforms-plugin-with-the-wp-affiliate-software-224\",\"url\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/integrating-the-cforms-plugin-with-the-wp-affiliate-software-224\",\"name\":\"Integrating the cForms plugin with the WP Affiliate Software - WordPress Affiliate Platform\",\"isPartOf\":{\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/#website\"},\"datePublished\":\"2010-05-03T05:39:11+00:00\",\"dateModified\":\"2016-03-11T06:01:05+00:00\",\"author\":{\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/#\/schema\/person\/b3a690506213824832751de546a340fb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/integrating-the-cforms-plugin-with-the-wp-affiliate-software-224\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/#website\",\"url\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/\",\"name\":\"WordPress Affiliate Platform\",\"description\":\"Take control of your affiliates and drive more sales\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/#\/schema\/person\/b3a690506213824832751de546a340fb\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/3a21ab4072e533cf470d80fc2f0fd3639872824ade4e23709397e109b24f8857?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3a21ab4072e533cf470d80fc2f0fd3639872824ade4e23709397e109b24f8857?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3a21ab4072e533cf470d80fc2f0fd3639872824ade4e23709397e109b24f8857?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"url\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Integrating the cForms plugin with the WP Affiliate Software - WordPress Affiliate Platform","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/integrating-the-cforms-plugin-with-the-wp-affiliate-software-224","twitter_misc":{"Written by":"admin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/integrating-the-cforms-plugin-with-the-wp-affiliate-software-224#article","isPartOf":{"@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/integrating-the-cforms-plugin-with-the-wp-affiliate-software-224"},"author":{"name":"admin","@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/#\/schema\/person\/b3a690506213824832751de546a340fb"},"headline":"Integrating the cForms plugin with the WP Affiliate Software","datePublished":"2010-05-03T05:39:11+00:00","dateModified":"2016-03-11T06:01:05+00:00","mainEntityOfPage":{"@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/integrating-the-cforms-plugin-with-the-wp-affiliate-software-224"},"wordCount":359,"commentCount":1,"keywords":["Pay Per Lead"],"articleSection":["3rd Party Cart Integration"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/integrating-the-cforms-plugin-with-the-wp-affiliate-software-224#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/integrating-the-cforms-plugin-with-the-wp-affiliate-software-224","url":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/integrating-the-cforms-plugin-with-the-wp-affiliate-software-224","name":"Integrating the cForms plugin with the WP Affiliate Software - WordPress Affiliate Platform","isPartOf":{"@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/#website"},"datePublished":"2010-05-03T05:39:11+00:00","dateModified":"2016-03-11T06:01:05+00:00","author":{"@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/#\/schema\/person\/b3a690506213824832751de546a340fb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/integrating-the-cforms-plugin-with-the-wp-affiliate-software-224"]}]},{"@type":"WebSite","@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/#website","url":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/","name":"WordPress Affiliate Platform","description":"Take control of your affiliates and drive more sales","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/#\/schema\/person\/b3a690506213824832751de546a340fb","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3a21ab4072e533cf470d80fc2f0fd3639872824ade4e23709397e109b24f8857?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3a21ab4072e533cf470d80fc2f0fd3639872824ade4e23709397e109b24f8857?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3a21ab4072e533cf470d80fc2f0fd3639872824ade4e23709397e109b24f8857?s=96&d=mm&r=g","caption":"admin"},"url":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/wp-json\/wp\/v2\/posts\/224","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/wp-json\/wp\/v2\/comments?post=224"}],"version-history":[{"count":0,"href":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/wp-json\/wp\/v2\/posts\/224\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/wp-json\/wp\/v2\/media?parent=224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/wp-json\/wp\/v2\/categories?post=224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tipsandtricks-hq.com\/wordpress-affiliate\/wp-json\/wp\/v2\/tags?post=224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}