Changeset 775383
- Timestamp:
- 09/19/2013 02:13:23 PM (13 years ago)
- Location:
- premise-idevaffiliate-integration
- Files:
-
- 1 added
- 2 edited
- 3 copied
-
tags/1.0 (added)
-
tags/1.0/admin.php (copied) (copied from premise-idevaffiliate-integration/trunk/admin.php)
-
tags/1.0/premise-idevaffiliate.php (copied) (copied from premise-idevaffiliate-integration/trunk/premise-idevaffiliate.php) (3 diffs)
-
tags/1.0/readme.txt (copied) (copied from premise-idevaffiliate-integration/trunk/readme.txt) (2 diffs)
-
trunk/premise-idevaffiliate.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
premise-idevaffiliate-integration/tags/1.0/premise-idevaffiliate.php
r775375 r775383 4 4 Plugin URI: http://www.eugenoprea.com/wordpress-plugins/premise-idevaffiliate-integration/?utm_source=wp_admin&utm_medium=plugin&utm_campaign=premise_idevaffiliate_integration 5 5 Description: Integrates Premise with iDevAffiliate to help you start your affiliate program. It passes the order details and if you activate Optional Variables it will also pass the customer name, email address and the purchased product to iDevAffiliate. 6 Version: 1.0 .16 Version: 1.0 7 7 Author: Eugen Oprea 8 8 Author URI: http://www.eugenoprea.com/?utm_source=wp_admin&utm_medium=plugin&utm_campaign=premise_idevaffiliate_integration … … 34 34 35 35 if (isset($this->options['enabled']) && $this->options['enabled']) { 36 add_action('premise_membership_create_order', array($this, 'get_order_data'), 10, 3);36 add_action('premise_membership_create_order', array($this, 'get_order_data'), 10, 4); 37 37 add_action('premise_checkout_complete_after', array($this, 'track'), 10); 38 38 } … … 46 46 } 47 47 48 function get_order_data($member_id, $order_details, $renewal ) {48 function get_order_data($member_id, $order_details, $renewal, $order_id) { 49 49 $this->order_data = array( 50 'ordernum' => $order_details['_acp_order_time'],50 'ordernum' => get_the_title($order_id), 51 51 'salemt' => $order_details['_acp_order_price'] ? $order_details['_acp_order_price'] : 0, 52 52 ); -
premise-idevaffiliate-integration/tags/1.0/readme.txt
r775375 r775383 2 2 Premise iDevAffiliate Integration 3 3 Contributors: echoelse 4 Donate link: http://www.eugenoprea.com/wordpress-plugins/premise-idevaffiliate-integration/5 4 Tags: affiliate, premise, idevaffiliate, affiliate marketing, affiliates, affiliate tool, wordpress, plugin 6 5 Requires at least: 3.0 7 6 Tested up to: 3.5.1 8 Stable tag: 1.0 .17 Stable tag: 1.0 9 8 License: GPLv2 or later 10 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 45 44 == Changelog == 46 45 47 = 1.0.1 =48 Remove deprecated 4th argument of premise_membership_create_order action49 50 46 = 1.0 = 51 47 -
premise-idevaffiliate-integration/trunk/premise-idevaffiliate.php
r701567 r775383 4 4 Plugin URI: http://www.eugenoprea.com/wordpress-plugins/premise-idevaffiliate-integration/?utm_source=wp_admin&utm_medium=plugin&utm_campaign=premise_idevaffiliate_integration 5 5 Description: Integrates Premise with iDevAffiliate to help you start your affiliate program. It passes the order details and if you activate Optional Variables it will also pass the customer name, email address and the purchased product to iDevAffiliate. 6 Version: 1.0. 16 Version: 1.0.2 7 7 Author: Eugen Oprea 8 8 Author URI: http://www.eugenoprea.com/?utm_source=wp_admin&utm_medium=plugin&utm_campaign=premise_idevaffiliate_integration … … 34 34 35 35 if (isset($this->options['enabled']) && $this->options['enabled']) { 36 add_action('premise_membership_create_order', array($this, 'get_order_data'), 10, 3); 37 add_action('premise_checkout_complete_after', array($this, 'track'), 10); 36 add_action('premise_membership_create_order', array($this, 'track'), 10, 3); 38 37 } 39 38 … … 46 45 } 47 46 48 function get_order_data($member_id, $order_details, $renewal) { 49 $this->order_data = array( 50 'ordernum' => $order_details['_acp_order_time'], 51 'salemt' => $order_details['_acp_order_price'] ? $order_details['_acp_order_price'] : 0, 52 ); 47 function track($member_id, $order_details, $renewal) { 48 $product = get_post($order_details['_acp_order_product_id']); 49 $customer = get_userdata($member_id); 53 50 54 $this->product = get_post($order_details['_acp_order_product_id']);55 $this->customer = get_userdata($member_id);56 }57 58 function track() {59 51 $url = trailingslashit($this->options['site_url']) . "sale.php"; 60 52 $url = add_query_arg(array( 61 53 'profile' => $this->options['profile'], 62 'idev_saleamt' => $ this->order_data['salemt'],63 'idev_ordernum' => $ this->order_data['ordernum'],54 'idev_saleamt' => $order_details['_acp_order_price'] ? $order_details['_acp_order_price'] : 0, 55 'idev_ordernum' => $order_details['_acp_order_time'], 64 56 'ip_address' => $_SERVER['REMOTE_ADDR'], 65 57 ), $url); … … 71 63 switch ($this->options['variable_' . $i]) { 72 64 case 'customer_name': 73 $var = $ this->customer->user_firstname . ' ' . $this->customer->user_lastname;65 $var = $customer->user_firstname . ' ' . $this->customer->user_lastname; 74 66 break; 75 67 case 'customer_username': 76 $var = $ this->customer->user_login;68 $var = $customer->user_login; 77 69 break; 78 70 case 'customer_email': 79 $var = $ this->customer->user_email;71 $var = $customer->user_email; 80 72 break; 81 73 case 'product_name': 82 $var = $ this->product->post_title;74 $var = $product->post_title; 83 75 break; 84 76 case 'product_id': 85 $var = $ this->product->ID;77 $var = $product->ID; 86 78 break; 87 79 case 'site_name': -
premise-idevaffiliate-integration/trunk/readme.txt
r701577 r775383 2 2 Premise iDevAffiliate Integration 3 3 Contributors: echoelse 4 Donate link: http://www.eugenoprea.com/wordpress-plugins/premise-idevaffiliate-integration/5 4 Tags: affiliate, premise, idevaffiliate, affiliate marketing, affiliates, affiliate tool, wordpress, plugin 6 5 Requires at least: 3.0 7 Tested up to: 3. 5.18 Stable tag: 1.0. 16 Tested up to: 3.6 7 Stable tag: 1.0.2 9 8 License: GPLv2 or later 10 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 45 44 == Changelog == 46 45 46 = 1.0.2 = 47 Track order data on create order 48 Code refactoring 49 47 50 = 1.0.1 = 48 51 Remove deprecated 4th argument of premise_membership_create_order action
Note: See TracChangeset
for help on using the changeset viewer.