add_action('wp_enqueue_scripts', function () { if (!(function_exists('is_account_page') && is_account_page() && function_exists('is_wc_endpoint_url') && is_wc_endpoint_url('my-points'))) { return; } $currency = kaizer_curr(); // 1 USD in current currency (Curcy already includes your fees/rounding) $rate = function_exists('wmc_get_price') ? (float) wmc_get_price(1, $currency) : 1.0; $decimals = function_exists('wc_get_price_decimals') ? (int) wc_get_price_decimals() : 2; $points_usd = (int) apply_filters('kaizer_points_per_usd', 10); // 10 pts = $1 by default wp_enqueue_script('jquery-core'); $js = << maxTries){ clearInterval(tick); return; } attach(); recalc(); }, 300); // MutationObserver as an extra safety net var mo = new MutationObserver(function(){ attach(); recalc(); }); mo.observe(document.body, {childList:true, subtree:true}); })(); JS; wp_add_inline_script('jquery-core', $js, 'after'); }); // Override the points conversion (default is 10 pts = 1 USD) add_filter('kaizer_points_per_usd', function(){ return 10; });