Phone Orders For WooCommerce

WooCommerce Currency Switcher, by PluginUs.NET

WooCommerce Currency Switcher (WOOCS) by PluginUs.NET automatically changes the active currency based on the customer’s country. On the storefront this works via browser geolocation or customer account data. When an agent creates a backend order in Phone Orders for WooCommerce, the cart builds in the admin session where no customer country context exists yet — so WOOCS applies the store’s default currency regardless of the customer’s billing or shipping country.

This single-action snippet reads the selected customer’s country from the Phone Orders cart data and sets WOOCS to the correct currency for that country before the cart updates.


Code Sample

Code Explained (for Developers)

ElementDescription
wpo_before_update_cartA Phone Orders action that fires just before the plugin processes a cart update. At this point the full cart data — including the selected customer’s billing and shipping country — is available in $cart_data. This makes it the correct hook to set WOOCS’ active currency before prices calculate.
class_exists( 'WOOCS' )Safety check confirming WOOCS is active. The action exits cleanly without errors if the plugin is absent or deactivated.
global $WOOCSAccesses the WOOCS singleton instance that manages currency state for the current request.
wc_get_customer_default_location()Retrieves WooCommerce’s default customer location based on store settings (store base address or geolocation). Provides a safe fallback country when the Phone Orders customer has no billing or shipping country set yet.
$cart_data['customer']['billing_country']The billing country the agent entered or the customer’s saved billing address. Used as the primary country source for currency lookup.
$cart_data['customer']['shipping_country']The shipping country, which takes final precedence over the billing country if both are present. This matches how most currency switchers prioritise destination for currency selection.
$WOOCS->get_currency_by_country( $country_code )WOOCS internal method that returns the currency code configured for a given country in the WOOCS settings.
$WOOCS->set_currency(...)Switches WOOCS’ active currency for the current request to the resolved currency, ensuring all subsequent price calculations and formatting in this cart update use the correct currency.

How to Apply This Code

  1. Open Appearance → Theme File Editor or the Code Snippets plugin.
  2. Paste the snippet into your child theme’s functions.php or create a new dedicated snippet.
  3. Save and open Phone Orders.
  4. Create a test order for a customer whose billing or shipping country maps to a non-default currency in WOOCS settings.
  5. Add a product and verify the Phone Orders cart displays prices in the correct currency for that customer’s country.

⚠️ Always use a child theme or Code Snippets — parent theme files get overwritten on theme updates.


When Should You Use This Fix?

This fix applies when your store uses WOOCS for country-based automatic currency switching and agents create backend orders through Phone Orders PRO. Without it, all Phone Orders carts use the store default currency regardless of the customer’s location — agents see and record incorrect prices for international customers.

Have questions? Please submit a support request. We're always happy to help!

Phone Orders
for WooCommerce
PRO

From $120
Buy
✓ 30-day money-back guarantee