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- Convert the merchantโs prices through
wc_nyp_raw_minimum_price,wc_nyp_raw_maximum_price,wc_nyp_raw_suggested_priceandwc_nyp_suggested_prices. The cart checks the entered price against these, so they must be in the customerโs currency. - Leave the entered price alone. Itโs stored in the cart itemโs
nypkey and set on the itemโs product withset_price(). Skip cart items that have annypkey when you convert cart prices. - 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. - 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. - 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 topOn woocommerce_product_get_price, for a Name Your Price cart item:
| Priority | What runs |
|---|---|
| Below 99 | Extensions that set their own price, such as bundle and composite discounts |
| 99 | Name Your Priceโs tax adjustment |
| 100 | WooCommerce 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