WOOCS - WooCommerce Currency Switcher


WP Crowdfunding

The plugin URL: https://wordpress.org/plugins/wp-crowdfunding/

  • in file functions.php of your current child wp theme add code:
    add_filter('wp_head', function () {
        if (is_checkout() AND class_exists('WOOCS')) {
            global $WOOCS;
            $WOOCS->reset_currency();
        }
    });
    
  • In  file wp-content\plugins\wp-crowdfunding\wpcftemplate\woocommerce\basic\include\fund-raised.php change code:
    $amount = wpcf_function()->total_goal(get_the_ID());
    $raised = wpcf_function()->fund_raised();
    if (class_exists('WOOCS')) {
        global $WOOCS;
        if ($WOOCS->is_multiple_allowed) {
            $amount = $WOOCS->woocs_exchange_value(floatval($amount));
            $raised = $WOOCS->woocs_exchange_value(floatval($raised));
        }
    }

  • to file wp-content\plugins\wp-crowdfunding\includes\woocommerce\Woocommerce.php add  next code:
    if (class_exists('WOOCS')) {
        global $WOOCS;
        if ($WOOCS->is_multiple_allowed) {
            $currencies = $WOOCS->get_currencies();
            $conversion_rate = $currencies[$WOOCS->current_currency]['rate'];
            $donate_amount = $donate_amount / $conversion_rate;
        }
    }