Setting backend prices in EUR/USD and displaying them as TRY on frontend
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page pleaseIf you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.
Quote from Fatih on August 12, 2026, 10:27Hello Support Team,
I recently purchased the WooCommerce Currency Switcher plugin and need some guidance for a specific setup.
About 90% of my products are priced in Turkish Lira (TRY), but the remaining products have base prices in USD or EUR. Previously, I had to manually calculate exchange rates and update the TRY prices.
My question is: Can I set the backend regular price of a specific product in USD or EUR, and have the plugin automatically convert and display it in TRY on the frontend using live exchange rates?
Could you provide a simple step-by-step on how to configure this if it's possible?
Thank you, Fatih
Hello Support Team,
I recently purchased the WooCommerce Currency Switcher plugin and need some guidance for a specific setup.
About 90% of my products are priced in Turkish Lira (TRY), but the remaining products have base prices in USD or EUR. Previously, I had to manually calculate exchange rates and update the TRY prices.
My question is: Can I set the backend regular price of a specific product in USD or EUR, and have the plugin automatically convert and display it in TRY on the frontend using live exchange rates?
Could you provide a simple step-by-step on how to configure this if it's possible?
Thank you, Fatih
Quote from Alex Dev on August 13, 2026, 21:16Hello Fatih
Thanks for the detailed question, it is a fair one and the honest answer needs a bit of context.
The plugin cannot do this out of the box, and it is worth explaining why. WooCommerce stores exactly one price per product, and that price is always in the shop base currency. The switcher works in one direction only: it takes the stored base price and converts it into the other currencies at the current rate. There is no concept of a per product source currency. In your case the base currency is TRY, so a product priced in TRY is already stored in its final form and there is nothing to convert.
The Individual fixed prices feature may look like the answer, but it works the other way round. It lets you pin a manual price in a given currency instead of the calculated one. It fixes values, it does not calculate them, so it would not save you from typing numbers by hand.
There are two ways to get what you want.
Option 1, no code, but a big change. Switch the shop base currency to USD. Everything then falls into place: the products whose real price is in USD or EUR are stored as such and are converted into TRY automatically at the live rate, while the TRY products get a fixed TRY price set once and never move again. This is exactly the behaviour you described.
The cost of this option is real and I would rather you hear it before you try it. The whole catalogue has to be re converted into USD, past orders and reports stay in the old currency, and you need to check what your payment gateway actually charges in and what your accounting requires for a Turkish shop. For many shops in Turkey this alone rules the option out. If you do go this way, setting fixed TRY prices across hundreds of products is a bulk editing job rather than a manual one.
Option 2, a small script, base currency stays TRY. I wrote one for you, it is attached to this reply. Install it as a normal plugin (put the file into wp-content/plugins/ and activate it, or add it as a must use plugin) and you get two extra fields on the General tab of the product data box: Source currency and Source price.
Set them to, for example, USD and 50, and the plugin converts that amount into TRY using the current rate from the currency switcher and writes the result into the regular price. From then on the price is refreshed automatically every time the switcher updates its rates, plus once a day as a fallback. Products where the field is left empty are never touched, so your 90 percent of TRY products keep working exactly as before.
A few things to know about it:
The price is recalculated on a schedule, not on every page view. This is deliberate. Sorting by price, price range filters, product feeds and page caching all read the stored price from the database, so a price that changed per request would break them.
It handles simple products. Variable products need a bit more code, tell me if you use them.
Products already sold are not affected, past orders keep their original amounts.
Please test it on a staging copy first and make a database backup before the first run, since it overwrites the regular price of the products you mark.
The rate auto update in the switcher settings has to be working for the prices to stay current, so it is worth checking that it is enabled and that your rate provider is returning data for TRY.
<?php /** * Plugin Name: FOX - Source Currency Prices * Description: Lets you enter a product price in a foreign currency (USD, EUR, ...) and keeps the WooCommerce base price in sync with the exchange rates of the FOX - Currency Switcher plugin. * Version: 1.0 * Requires PHP: 7.4 */ if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Meta keys used to store the source price of a product. */ define( 'PN_SRC_CURRENCY_KEY', '_pn_source_currency' ); define( 'PN_SRC_PRICE_KEY', '_pn_source_price' ); /** * Adds the two fields to the General tab of the product data box. * Simple products only. */ add_action( 'woocommerce_product_options_pricing', 'pn_src_price_fields' ); function pn_src_price_fields() { global $WOOCS; if ( empty( $WOOCS ) ) { return; } $options = array( '' => __( 'Disabled - use the price above', 'pn' ) ); foreach ( $WOOCS->get_currencies( true ) as $code => $data ) { if ( $code === $WOOCS->default_currency ) { continue; // The base currency needs no conversion. } $options[ $code ] = $code; } woocommerce_wp_select( array( 'id' => PN_SRC_CURRENCY_KEY, 'label' => __( 'Source currency', 'pn' ), 'options' => $options, 'description' => __( 'Enter this product price in another currency and let it be converted into the shop base currency automatically.', 'pn' ), 'desc_tip' => true, ) ); woocommerce_wp_text_input( array( 'id' => PN_SRC_PRICE_KEY, 'label' => __( 'Source price', 'pn' ), 'data_type' => 'decimal', 'description' => __( 'The amount in the source currency. The regular price above is overwritten from this value on every rate update.', 'pn' ), 'desc_tip' => true, ) ); } /** * Saves the fields and recalculates the price of this product right away. */ add_action( 'woocommerce_process_product_meta', 'pn_src_price_save', 20 ); function pn_src_price_save( $product_id ) { // Nonce is verified by WooCommerce before this hook runs. $currency = isset( $_POST[ PN_SRC_CURRENCY_KEY ] ) ? sanitize_text_field( wp_unslash( $_POST[ PN_SRC_CURRENCY_KEY ] ) ) : ''; $price = isset( $_POST[ PN_SRC_PRICE_KEY ] ) ? wc_format_decimal( wp_unslash( $_POST[ PN_SRC_PRICE_KEY ] ) ) : ''; update_post_meta( $product_id, PN_SRC_CURRENCY_KEY, $currency ); update_post_meta( $product_id, PN_SRC_PRICE_KEY, $price ); pn_src_price_sync_product( $product_id ); } /** * Converts an amount from a FOX currency into the shop base currency. * FOX stores rates relative to the base currency, so the base value is amount / rate. * * @return float|false */ function pn_src_price_to_base( $amount, $currency_code ) { global $WOOCS; if ( empty( $WOOCS ) || empty( $currency_code ) ) { return false; } // Filters are suppressed on purpose: geolocation rules may alter the rates // for the current visitor, and a stored price must not depend on that. $currencies = $WOOCS->get_currencies( true ); if ( empty( $currencies[ $currency_code ]['rate'] ) ) { return false; } $rate = floatval( $currencies[ $currency_code ]['rate'] ); if ( $rate <= 0 ) { return false; } return round( floatval( $amount ) / $rate, wc_get_price_decimals() ); } /** * Writes the converted price into a single product. */ function pn_src_price_sync_product( $product_id ) { $currency = get_post_meta( $product_id, PN_SRC_CURRENCY_KEY, true ); $amount = get_post_meta( $product_id, PN_SRC_PRICE_KEY, true ); if ( empty( $currency ) || '' === $amount ) { return false; } $base_price = pn_src_price_to_base( $amount, $currency ); if ( false === $base_price ) { return false; } $product = wc_get_product( $product_id ); if ( ! $product ) { return false; } $product->set_regular_price( $base_price ); // The active price is only touched when the product is not on sale. if ( '' === $product->get_sale_price( 'edit' ) ) { $product->set_price( $base_price ); } $product->save(); return true; } /** * Recalculates every product that has a source currency set. */ function pn_src_price_sync_all() { $ids = get_posts( array( 'post_type' => 'product', 'post_status' => 'any', 'posts_per_page' => -1, 'fields' => 'ids', 'meta_query' => array( array( 'key' => PN_SRC_CURRENCY_KEY, 'value' => '', 'compare' => '!=', ), ), ) ); foreach ( $ids as $id ) { pn_src_price_sync_product( $id ); } if ( function_exists( 'wc_delete_product_transients' ) ) { wc_delete_product_transients(); } return count( $ids ); } /** * Runs right after FOX has updated the exchange rates. */ add_action( 'woocs_sheduler_rates_updated', 'pn_src_price_sync_all' ); /** * A daily fallback in case the FOX rate auto update is switched off. */ add_action( 'init', 'pn_src_price_schedule' ); function pn_src_price_schedule() { if ( ! wp_next_scheduled( 'pn_src_price_daily' ) ) { wp_schedule_event( time() + 300, 'daily', 'pn_src_price_daily' ); } } add_action( 'pn_src_price_daily', 'pn_src_price_sync_all' );The script is free and yours to modify. If you later need something more involved, such as variable products, a margin on top of the converted rate, or rounding to psychological prices, that is customisation work and you can find the terms here: https://pluginus.net/custom-work/
Best regards,
Alex
Hello Fatih
Thanks for the detailed question, it is a fair one and the honest answer needs a bit of context.
The plugin cannot do this out of the box, and it is worth explaining why. WooCommerce stores exactly one price per product, and that price is always in the shop base currency. The switcher works in one direction only: it takes the stored base price and converts it into the other currencies at the current rate. There is no concept of a per product source currency. In your case the base currency is TRY, so a product priced in TRY is already stored in its final form and there is nothing to convert.
The Individual fixed prices feature may look like the answer, but it works the other way round. It lets you pin a manual price in a given currency instead of the calculated one. It fixes values, it does not calculate them, so it would not save you from typing numbers by hand.
There are two ways to get what you want.
Option 1, no code, but a big change. Switch the shop base currency to USD. Everything then falls into place: the products whose real price is in USD or EUR are stored as such and are converted into TRY automatically at the live rate, while the TRY products get a fixed TRY price set once and never move again. This is exactly the behaviour you described.
The cost of this option is real and I would rather you hear it before you try it. The whole catalogue has to be re converted into USD, past orders and reports stay in the old currency, and you need to check what your payment gateway actually charges in and what your accounting requires for a Turkish shop. For many shops in Turkey this alone rules the option out. If you do go this way, setting fixed TRY prices across hundreds of products is a bulk editing job rather than a manual one.
Option 2, a small script, base currency stays TRY. I wrote one for you, it is attached to this reply. Install it as a normal plugin (put the file into wp-content/plugins/ and activate it, or add it as a must use plugin) and you get two extra fields on the General tab of the product data box: Source currency and Source price.
Set them to, for example, USD and 50, and the plugin converts that amount into TRY using the current rate from the currency switcher and writes the result into the regular price. From then on the price is refreshed automatically every time the switcher updates its rates, plus once a day as a fallback. Products where the field is left empty are never touched, so your 90 percent of TRY products keep working exactly as before.
A few things to know about it:
The price is recalculated on a schedule, not on every page view. This is deliberate. Sorting by price, price range filters, product feeds and page caching all read the stored price from the database, so a price that changed per request would break them.
It handles simple products. Variable products need a bit more code, tell me if you use them.
Products already sold are not affected, past orders keep their original amounts.
Please test it on a staging copy first and make a database backup before the first run, since it overwrites the regular price of the products you mark.
The rate auto update in the switcher settings has to be working for the prices to stay current, so it is worth checking that it is enabled and that your rate provider is returning data for TRY.
<?php
/**
* Plugin Name: FOX - Source Currency Prices
* Description: Lets you enter a product price in a foreign currency (USD, EUR, ...) and keeps the WooCommerce base price in sync with the exchange rates of the FOX - Currency Switcher plugin.
* Version: 1.0
* Requires PHP: 7.4
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Meta keys used to store the source price of a product.
*/
define( 'PN_SRC_CURRENCY_KEY', '_pn_source_currency' );
define( 'PN_SRC_PRICE_KEY', '_pn_source_price' );
/**
* Adds the two fields to the General tab of the product data box.
* Simple products only.
*/
add_action( 'woocommerce_product_options_pricing', 'pn_src_price_fields' );
function pn_src_price_fields() {
global $WOOCS;
if ( empty( $WOOCS ) ) {
return;
}
$options = array( '' => __( 'Disabled - use the price above', 'pn' ) );
foreach ( $WOOCS->get_currencies( true ) as $code => $data ) {
if ( $code === $WOOCS->default_currency ) {
continue; // The base currency needs no conversion.
}
$options[ $code ] = $code;
}
woocommerce_wp_select(
array(
'id' => PN_SRC_CURRENCY_KEY,
'label' => __( 'Source currency', 'pn' ),
'options' => $options,
'description' => __( 'Enter this product price in another currency and let it be converted into the shop base currency automatically.', 'pn' ),
'desc_tip' => true,
)
);
woocommerce_wp_text_input(
array(
'id' => PN_SRC_PRICE_KEY,
'label' => __( 'Source price', 'pn' ),
'data_type' => 'decimal',
'description' => __( 'The amount in the source currency. The regular price above is overwritten from this value on every rate update.', 'pn' ),
'desc_tip' => true,
)
);
}
/**
* Saves the fields and recalculates the price of this product right away.
*/
add_action( 'woocommerce_process_product_meta', 'pn_src_price_save', 20 );
function pn_src_price_save( $product_id ) {
// Nonce is verified by WooCommerce before this hook runs.
$currency = isset( $_POST[ PN_SRC_CURRENCY_KEY ] ) ? sanitize_text_field( wp_unslash( $_POST[ PN_SRC_CURRENCY_KEY ] ) ) : '';
$price = isset( $_POST[ PN_SRC_PRICE_KEY ] ) ? wc_format_decimal( wp_unslash( $_POST[ PN_SRC_PRICE_KEY ] ) ) : '';
update_post_meta( $product_id, PN_SRC_CURRENCY_KEY, $currency );
update_post_meta( $product_id, PN_SRC_PRICE_KEY, $price );
pn_src_price_sync_product( $product_id );
}
/**
* Converts an amount from a FOX currency into the shop base currency.
* FOX stores rates relative to the base currency, so the base value is amount / rate.
*
* @return float|false
*/
function pn_src_price_to_base( $amount, $currency_code ) {
global $WOOCS;
if ( empty( $WOOCS ) || empty( $currency_code ) ) {
return false;
}
// Filters are suppressed on purpose: geolocation rules may alter the rates
// for the current visitor, and a stored price must not depend on that.
$currencies = $WOOCS->get_currencies( true );
if ( empty( $currencies[ $currency_code ]['rate'] ) ) {
return false;
}
$rate = floatval( $currencies[ $currency_code ]['rate'] );
if ( $rate <= 0 ) {
return false;
}
return round( floatval( $amount ) / $rate, wc_get_price_decimals() );
}
/**
* Writes the converted price into a single product.
*/
function pn_src_price_sync_product( $product_id ) {
$currency = get_post_meta( $product_id, PN_SRC_CURRENCY_KEY, true );
$amount = get_post_meta( $product_id, PN_SRC_PRICE_KEY, true );
if ( empty( $currency ) || '' === $amount ) {
return false;
}
$base_price = pn_src_price_to_base( $amount, $currency );
if ( false === $base_price ) {
return false;
}
$product = wc_get_product( $product_id );
if ( ! $product ) {
return false;
}
$product->set_regular_price( $base_price );
// The active price is only touched when the product is not on sale.
if ( '' === $product->get_sale_price( 'edit' ) ) {
$product->set_price( $base_price );
}
$product->save();
return true;
}
/**
* Recalculates every product that has a source currency set.
*/
function pn_src_price_sync_all() {
$ids = get_posts(
array(
'post_type' => 'product',
'post_status' => 'any',
'posts_per_page' => -1,
'fields' => 'ids',
'meta_query' => array(
array(
'key' => PN_SRC_CURRENCY_KEY,
'value' => '',
'compare' => '!=',
),
),
)
);
foreach ( $ids as $id ) {
pn_src_price_sync_product( $id );
}
if ( function_exists( 'wc_delete_product_transients' ) ) {
wc_delete_product_transients();
}
return count( $ids );
}
/**
* Runs right after FOX has updated the exchange rates.
*/
add_action( 'woocs_sheduler_rates_updated', 'pn_src_price_sync_all' );
/**
* A daily fallback in case the FOX rate auto update is switched off.
*/
add_action( 'init', 'pn_src_price_schedule' );
function pn_src_price_schedule() {
if ( ! wp_next_scheduled( 'pn_src_price_daily' ) ) {
wp_schedule_event( time() + 300, 'daily', 'pn_src_price_daily' );
}
}
add_action( 'pn_src_price_daily', 'pn_src_price_sync_all' );The script is free and yours to modify. If you later need something more involved, such as variable products, a margin on top of the converted rate, or rounding to psychological prices, that is customisation work and you can find the terms here: https://pluginus.net/custom-work/
Best regards,
Alex
