This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function embed_ambassador_tracking_pixel($order) { | |
$email = $order->billing_email; | |
echo '<img src="https://mbsy.co/embed/v2/img/?mbsy_username=AFG&mbsy_campaign_uid=12765&mbsy_email='.$email.'&mbsy_revenue=0&mbsy_has_trial=1&mbsy_auto_create=0" style="border: none; display: none" alt="" />'; | |
echo '<img src="https://mbsy.co/embed/v2/img/?mbsy_username=AFG&mbsy_campaign_uid=_____&mbsy_email='.$email.'&mbsy_revenue=0&mbsy_has_trial=1&mbsy_auto_create=0" style="border: none; display: none" alt="" />'; | |
} | |
add_action('woocommerce_order_details_after_customer_details', 'embed_ambassador_tracking_pixel',10, 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery("#interpise-form").submit(function(e) { | |
e.preventDefault(); | |
ajax_optin_interpise_pap(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include 'PapApi.class.php'; | |
$aff = "a975"; | |
$ip = $_SERVER['REMOTE_ADDR']; | |
$saleTracker = new Pap_Api_SaleTracker('http://mobeoffice.com/affiliate/scripts/sale.php'); | |
$saleTracker->setAccountId('default1'); | |
$action = $saleTracker->createAction($action); | |
$action->setAffiliateID($aff); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// START OAP API | |
$data = "<purchase_history> | |
<contact_id>246029</contact_id> | |
</purchase_history>"; | |
$data = urlencode(urlencode($data)); | |
// Replace the strings with your API credentials located in Admin > OfficeAutoPilot API Instructions and Key Manager | |
$appid = "our-app-id"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getAffFromIP($ip) { | |
$papURL="http://mobeoffice.com/affiliate"; | |
$merchantUsername = "our-user-name"; | |
$merchantPassword = "our-pass-word"; | |
$session = new Gpf_Api_Session($papURL."/scripts/server.php"); | |
if(!$session->login($merchantUsername, $merchantPassword)) { | |
die("Cannot login. Message: ".$session->getMessage()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function woo_new_fields() { | |
?> | |
<p class="form-row"> | |
<label for="first_name"><?php _e( 'First Name', 'woocommerce' ); ?> <span class="required">*</span></label> | |
<input type="text" class="input-text" name="first_name" id="first_name" value="<?php if (isset($_POST['first_name'])) echo esc_attr($_POST['first_name']); ?>" /> | |
</p> | |
<p class="form-row"> | |
<label for="last_name"><?php _e( 'Last Name', 'woocommerce' ); ?> <span class="required">*</span></label> | |
<input type="text" class="input-text" name="last_name" id="last_name" value="<?php if (isset($_POST['last_name'])) echo esc_attr($_POST['last_name']); ?>" /> | |
</p> |