Name Your Price: Currency switchers

This is a developer-level doc. Itโ€™s written for developers who are comfortable with PHP, JavaScript and WordPress hooks. If you arenโ€™t, a Woo agency partner or developer can help. Custom code isnโ€™t covered by our Support Policy, so we canโ€™t write, debug or maintain customizations for you.

Name Your Price has built-in support for several currency switchers, listed on the Compatibility page. With those, the prices convert without any code. This page is for developers of other currency plugins: it explains how Name Your Price prices a cart item, and what a currency plugin needs to do so a customer is charged exactly what they entered.

Two kinds of price

↑ Back to top
  • The merchantโ€™s prices: the minimum, maximum and suggested prices. Theyโ€™re saved in the store currency, like any product price, and should be converted.
  • The entered price: the amount the customer typed, in the currency they were shopping in. Itโ€™s already in the right currency and must not be converted again.

Rules for a currency plugin

↑ Back to top
  1. Convert the merchantโ€™s prices through wc_nyp_raw_minimum_price, wc_nyp_raw_maximum_price, wc_nyp_raw_suggested_price and wc_nyp_suggested_prices. The cart checks the entered price against these, so they must be in the customerโ€™s currency.
  2. Leave the entered price alone. Itโ€™s stored in the cart itemโ€™s nyp key and set on the itemโ€™s product with set_price(). Skip cart items that have an nyp key when you convert cart prices.
  3. If customers can switch currency with items in the cart, store the amount and the currency it was entered in on the cart item (woocommerce_add_cart_item_data). Convert from those each time the cart loads, not from the last conversion, so switching back restores the exact amount.
  4. Donโ€™t replace the price after priority 99 on woocommerce_product_get_price. Name Your Price adjusts the tax at priority 99 so the customer pays the amount they entered. If you must change the price after that, multiply it rather than returning your own value.
  5. Order again: convert the orderโ€™s price from the orderโ€™s currency before the item goes back in the cart.

Order of price filters

↑ Back to top

On woocommerce_product_get_price, for a Name Your Price cart item:

PriorityWhat runs
Below 99Extensions that set their own price, such as bundle and composite discounts
99Name Your Priceโ€™s tax adjustment
100WooCommerce Subscriptions: the sign-up fee, or 0 during a free trial

The tax adjustment is a ratio of tax rates, so it gives the same result before or after a currency conversion.


Document Version: 1.0.0
Last Updated: November 9th, 2026
NYP Version Covered: 4.0.0

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.