Title: Polylang Integration
Last modified: September 1, 2016

---

# Polylang Integration

 *  Resolved [biko004](https://wordpress.org/support/users/biko004/)
 * (@biko004)
 * [10 years ago](https://wordpress.org/support/topic/polylang-integration-2/)
 * Hey guys,
 * I’ve just purchased the plugin.
 * I have an Hebrew online shop which I translated using Polylang.
    As it’s Israeli
   shop – I use NIS I want to automatically switch currency to USD when the custumer
   move tothe English site.
 * I’ve found this:
    [https://wordpress.org/support/topic/switch-currency-with-language-change-polylang?replies=11](https://wordpress.org/support/topic/switch-currency-with-language-change-polylang?replies=11)
 * But didn’t found the way to make it work,
 * I tried to add this code to the bottom of the header.php (child theme)
    <?php
   $lang=get_locale(); global $WOOCS; switch($lang){ case ‘il_BG’: $WOOCS->current_currency
   =’NIS’; $WOOCS->storage->set_val(‘woocs_current_currency’, ‘NIS’); break; case‘
   en_GB’: $WOOCS->current_currency=’USD’; $WOOCS->storage->set_val(‘woocs_current_currency’,‘
   USD’); break; default: $WOOCS->current_currency=’NIS’; $WOOCS->storage->set_val(‘
   woocs_current_currency’, ‘NIS’); break; } ?>
 * What’s the right way to do that?
    Thanks!
 * [https://wordpress.org/plugins/woocommerce-currency-switcher/](https://wordpress.org/plugins/woocommerce-currency-switcher/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [RealMag777](https://wordpress.org/support/users/realmag777/)
 * (@realmag777)
 * [10 years ago](https://wordpress.org/support/topic/polylang-integration-2/#post-7462544)
 * Hello
 * Yes, code is right, but better use hook wp_head in funcions.php
 *     ```
       add_filter('wp_head',function(){
   
       $lang=get_locale();
       global $WOOCS;
       switch($lang){
       case 'il_BG':
       $WOOCS->current_currency='NIS';
       $WOOCS->storage->set_val('woocs_current_currency', 'NIS');
       break;
       case 'en_GB':
       $WOOCS->current_currency='USD';
       $WOOCS->storage->set_val('woocs_current_currency', 'USD');
       break;
       default:
       $WOOCS->current_currency='NIS';
       $WOOCS->storage->set_val('woocs_current_currency', 'NIS');
       break;
       }
   
       });
       ```
   
 * and be sure that ‘il_BG’ and ‘en_GB’ is right lang code in Polylang …
 * As you bought the plugin write on its support here please: [http://codecanyon.net/item/woocommerce-currency-switcher/8085217/support](http://codecanyon.net/item/woocommerce-currency-switcher/8085217/support)

Viewing 1 replies (of 1 total)

The topic ‘Polylang Integration’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-currency-switcher/assets/icon-256x256.png?rev
   =2844633)
 * [FOX - Currency Switcher Professional for WooCommerce](https://wordpress.org/plugins/woocommerce-currency-switcher/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-currency-switcher/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-currency-switcher/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-currency-switcher/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-currency-switcher/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-currency-switcher/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [RealMag777](https://wordpress.org/support/users/realmag777/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/polylang-integration-2/#post-7462544)
 * Status: resolved