handleCheckoutWithRefKey( $purchaseLogId, $purchaseAmount, $strRefKey); WPAM_Logger::log_debug('WP eStore Integration - Commission tracked for transaction ID: '.$purchaseLogId.'. Purchase amt: '.$purchaseAmount); } } add_action("eStore_product_database_updated_after_payment", "wpam_eStore_database_updated_after_payment", 10, 2); function wpam_eStore_add_custom_parameters($custom_field_val) { if(isset($_COOKIE['wpam_id'])) { $name = 'wpam_tracking'; $value = $_COOKIE['wpam_id']; $new_val = $name.'='.$value; $current_val = $custom_field_val; if(empty($current_val)){ $custom_field_val = $new_val; } else{ $custom_field_val = $current_val.'&'.$new_val; } WPAM_Logger::log_debug('WP eStore Integration - Adding custom field value. New value: '.$custom_field_val); } else if(isset($_COOKIE[WPAM_PluginConfig::$RefKey])) { $name = 'wpam_tracking'; $value = $_COOKIE[WPAM_PluginConfig::$RefKey]; $new_val = $name.'='.$value; $current_val = $custom_field_val; if(empty($current_val)){ $custom_field_val = $new_val; } else{ $custom_field_val = $current_val.'&'.$new_val; } WPAM_Logger::log_debug('WP eStore Integration - Adding custom field value. New value: '.$custom_field_val); } return $custom_field_val; } add_filter("eStore_custom_field_value_filter", "wpam_eStore_add_custom_parameters");