1. Home
  2. ReHub Theme
  3. Affiliate settings
  4. Multi currency and Multi locales

Multi currency and Multi locales

it’s possible to have several currencies on site and even show different offers for each language. Theme will convert all prices on the fly.

Currently, this option is working for Woocommerce Products and requires enabled Content Egg (free or PRO version).

This option is working for all Price Comparison Blocks and Prices of woocommerce products.

To use this option – go to Woocommerce – Settings and set main currency of your site. This will be basic currency. If currency of offer from Content Egg is the same as basic currency – nothing will change.

Now, there are several possible cases.

Imagine, that you want to create affiliate website with Chinese shops like Gearbest, Aliexpress, Banggood but for Europe region. You use Content Egg or Affiliate Egg and add different offers, but, you see that different shops can return different currencies and you want to convert all prices into euro. How to do this fast? It’s easy, go to  Theme option – Affiliate – Custom Currency  and add code of your desired currency in ISO 4217 format. You can easily find all currency codes of this format in google.

Do you need more advanced and complex solutions? What if you need to show totally different offers and add currency and language switcher? Of course, you can create different sub-domains for each locale, but with our theme you can do everything on one site.

So, to add also multi locales and language and currency switcher, you must also install on your site WPML (paid, but the best) and Polylang (free)

Both plugins have the same logic. After enabling plugin, you can make different theme option values for different languages. For example, in Polylang, after you created your languages, go to Languages – String translation and find next option. As You see, I added different options for different languages.

Also, when you create any post, Polylang will allow you to make different content of each post and add different offers.

The same option is available in WPML WPML even better because it has much more different options, like different menu per language, autodetection, etc

Automatic price conversion is working only for global popular currencies from stock market. Some local currencies will not work as they don’t have exchange rate. You can add them with custom function
function my_content_egg_currency_rate ($rate, $from, $to)
    if ($from == 'USD' && $to == 'KES')
        return 100.15; // <--- rate
    if ($from == 'KES' && $to == 'USD')
        return 0.01; // <--- rate
add_filter( 'content_egg_currency_rate', 'my_content_egg_currency_rate', 0, 3 );

How to add customization to theme functions