Business Bloomer website sells in USD only for the time being, as that seems to be the standard for WordPress plugin / products stores.
However, I prefer to invoice clients in EUR (I also switch PayPal and Stripe keys on the go). Which means, I needed to find a way to “set” a different currency whenever I create a manual order (which, by default, is in USD). So, here’s the fix!
1. Important Note
As soon as you click on the “Add order” button from the WordPress dashboard, the order will use the default currency. Therefore, the only way to make the below snippet work is to click on the blue “Create” button BEFORE adding products to the order. In this way the new currency will be set, and you can then add products in your custom currency and even adjust prices if needed.
2. PHP Snippet: Set Custom Currency For WooCommerce Manual Orders
/**
* @snippet Custom Currency for Woo Manual Orders
* @tutorial Get CustomizeWoo.com FREE
* @author Rodolfo Melogli, Business Bloomer
* @compatible WooCommerce 8
* @community Join https://businessbloomer.com/club/
*/
add_action( 'woocommerce_new_order', 'bbloomer_update_order_currency_on_creation', 9999, 2 );
function bbloomer_update_order_currency_on_creation( $order_id, $order ) {
if ( $order && $order->is_created_via( 'admin' ) ) {
$order->set_currency( 'EUR' );
$order->save();
}
}
add_filter( 'woocommerce_currency', 'bbloomer_switch_currency' );
function bbloomer_switch_currency( $currency ) {
if ( is_wc_endpoint_url( 'order-pay' ) ) {
return 'EUR';
}
return $currency;
}