Skip to content

Instantly share code, notes, and snippets.

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);
jQuery("#interpise-form").submit(function(e) {
e.preventDefault();
ajax_optin_interpise_pap();
});
<?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);
<?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";
<?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());
@infusedmj
infusedmj / gist:5836280
Created June 22, 2013 08:00
Add this to your theme's function.php to show first name and last name fields on woocommerce's registration page.
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>