I made some more adjustment. Hope that will help others also.
remove_action('woocommerce_order_status_processing', [$wpam_plugin, 'WooCommerceProcessTransaction']);// to ensure commission after order completed
add_action('woocommerce_order_status_processing', [$wpam_plugin, 'WooCommerceRefundTransaction']); // to ensure if order marked is proccessing from completed
add_action('woocommerce_order_status_on-hold', [$wpam_plugin, 'WooCommerceRefundTransaction']); // to ensure if order marked is on-hold from completed or any status
// below shortcode for terms and condition page:
// Add Shortcode for Affiliate Rate
function wpam_affiliate_rate_shortcode() {
$bountyType = get_option(WPAM_PluginConfig::$AffBountyType);
$bountyAmount = get_option(WPAM_PluginConfig::$AffBountyAmount);
$currencySymbol = get_option(WPAM_PluginConfig::$AffCurrencySymbol);
if ($bountyType === 'percent') {
return $bountyAmount . '% of Sale';
} else {
return $currencySymbol . $bountyAmount . ' per Sale';
}
}
add_shortcode('affiliate_rate', 'wpam_affiliate_rate_shortcode');
// Add Shortcode for Minimum Payout
function wpam_minimum_payout_shortcode() {
$minPayout = get_option(WPAM_PluginConfig::$MinPayoutAmountOption);
$currencySymbol = get_option(WPAM_PluginConfig::$AffCurrencySymbol);
return $currencySymbol . $minPayout;
}
add_shortcode('minimum_payout', 'wpam_minimum_payout_shortcode');
// Add Shortcode for Tracking Lifetime
function wpam_tracking_lifetime_shortcode() {
$cookieExpire = get_option(WPAM_PluginConfig::$CookieExpireOption);
return $cookieExpire . ' days';
}
add_shortcode('tracking_lifetime', 'wpam_tracking_lifetime_shortcode');
Suggestion: Please do something to work with multi currency as it is works now only on one currency.