FOX - WooCommerce Currency Switcher Professional

DOKAN

From 28-09-2020 this code added to the Dokan plugin by its author(s)


Plugin: https://wedevs.com/dokan/

  • in functions.php of your current wp theme add next code:
    add_action('woocommerce_order_status_completed', 'woocs_payment_complete', 1);
    add_action('woocommerce_payment_complete', 'woocs_payment_complete');
    
    function so_payment_complete($order_id) {
        if (class_exists('WOOCS')) {
            global $WOOCS;
            $WOOCS->recalculate_order($order_id);
        }
    }
    
    add_filter('wp_head', function() {
        if (is_page('dashboard')) {
            if (class_exists('WOOCS')) {
                global $WOOCS;
                $WOOCS->reset_currency();
            }
        }
    });