• hs

    (@haradhansharma)


    add_action('init', function() {
    global $wpam_plugin;

    if (isset($wpam_plugin)) {
    // Remove the original hook.
    remove_action('woocommerce_checkout_update_order_meta', [$wpam_plugin, 'WooCheckoutUpdateOrderMeta'], 10, 2);

    // Add the new hook.
    add_action('woocommerce_new_order', [$wpam_plugin, 'WooCheckoutUpdateOrderMeta'], 10, 2);
    }
    });
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author affmngr

    (@affmngr)

    Hi, Thanks for the feedback. It’s been updated.

    Thread Starter hs

    (@haradhansharma)

    I made a pull request in the git repo, may be you did that. thanks.

    Thread Starter hs

    (@haradhansharma)

    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.
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.