FOX - Currency Switcher for WooCommerce

woocs_back_convert_price

The woocs_back_convert_price filter is an entry point into the plugin: you call it, FOX answers. It takes an amount already expressed in the currently selected currency and converts it back into the shop's base currency, using that currency's rate and its own decimals setting. This is the counterpart of woocs_convert_price and it is what you need whenever a third-party plugin compares a converted cart amount against a threshold that is stored in the base currency — free shipping minimums, gift rules, tiered discounts. Comparing a converted number against a base-currency threshold is the single most common cause of "the rule works in USD but not in EUR".
$amount_in_base = apply_filters('woocs_back_convert_price', $amount, false);
Parameters:
  • $amount - the amount in the current currency
  • $is_cond_multi (bool) - false by default. When true, the conversion only happens if the "Is multiple allowed" option is enabled, so the call becomes a no-op on shops that charge in the base currency only
Returns:
  • the amount in the base currency
Note: because it is a filter, this works from any plugin without a hard dependency on FOX. If FOX is not installed the value simply passes through unchanged, which is exactly the behaviour you want in compatibility code.