WooCommerce Multilingual – run WooCommerce with WPML - Version 3.9.3

Version Description

  • Fixed a bug that was causing the currency switcher to not be displayed on the cart and checkout pages in certain conditions
  • Fixed PHP notices on the backend when using PHP 7
  • Fixed a bug making the number of decimals for the default currency being overridden in the backend when the multi-currency was on
Download this release

Release Info

Developer mihaimihai
Plugin Icon 128x128 WooCommerce Multilingual – run WooCommerce with WPML
Version 3.9.3
Comparing to
See all releases

Code changes from version 3.9.2 to 3.9.3

compatibility/class-wcml-bookings.php CHANGED
@@ -172,7 +172,7 @@ class WCML_Bookings {
172
  ), 10, 4 );
173
  }
174
 
175
- add_filter( 'wpml_language_filter_extra_conditions_snippet', array( $this, 'extra_conditions_to_filter_bookings' ) );
176
 
177
  $this->clear_transient_fields();
178
 
172
  ), 10, 4 );
173
  }
174
 
175
+ add_filter( 'wpml_extra_conditions_snippet', array( $this, 'extra_conditions_to_filter_bookings' ) );
176
 
177
  $this->clear_transient_fields();
178
 
inc/class-wcml-install.php CHANGED
@@ -61,6 +61,11 @@ class WCML_Install{
61
  $woocommerce_wpml->update_settings();
62
  }
63
 
 
 
 
 
 
64
  add_filter( 'wpml_tm_dashboard_translatable_types', array(
65
  __CLASS__,
66
  'hide_variation_type_on_tm_dashboard'
61
  $woocommerce_wpml->update_settings();
62
  }
63
 
64
+ if ( empty( $woocommerce_wpml->settings[ 'rewrite_rules_flashed' ] ) ) {
65
+ flush_rewrite_rules();
66
+ $woocommerce_wpml->settings['rewrite_rules_flashed'] = 1;
67
+ }
68
+
69
  add_filter( 'wpml_tm_dashboard_translatable_types', array(
70
  __CLASS__,
71
  'hide_variation_type_on_tm_dashboard'
inc/currencies/class-wcml-currency-switcher.php CHANGED
@@ -100,20 +100,24 @@ class WCML_Currency_Switcher {
100
 
101
  $is_cart_or_checkout = is_page( wc_get_page_id( 'cart' ) ) || is_page( wc_get_page_id( 'checkout' ) );
102
 
103
- if ( $display_custom_prices && is_product() ) {
104
- $current_product_id = wc_get_product()->id;
105
- $original_product_language = $this->woocommerce_wpml->products->get_original_product_language( $current_product_id );
106
-
107
- $use_custom_prices = get_post_meta(
108
- apply_filters( 'translate_object_id', $current_product_id, get_post_type( $current_product_id ), true, $original_product_language ),
109
- '_wcml_custom_prices_status',
110
- true
111
- );
112
-
113
- if ( !$use_custom_prices ) $show_currency_switcher = false;
 
 
 
 
114
  }
115
 
116
- if ( $show_currency_switcher && !$is_cart_or_checkout ) {
117
 
118
  $currencies = isset($wcml_settings['currencies_order']) ?
119
  $wcml_settings['currencies_order'] :
100
 
101
  $is_cart_or_checkout = is_page( wc_get_page_id( 'cart' ) ) || is_page( wc_get_page_id( 'checkout' ) );
102
 
103
+ if ( $display_custom_prices ) {
104
+ if( $is_cart_or_checkout ){
105
+ $show_currency_switcher = false;
106
+ }elseif( is_product() ){
107
+ $current_product_id = wc_get_product()->id;
108
+ $original_product_language = $this->woocommerce_wpml->products->get_original_product_language( $current_product_id );
109
+
110
+ $use_custom_prices = get_post_meta(
111
+ apply_filters( 'translate_object_id', $current_product_id, get_post_type( $current_product_id ), true, $original_product_language ),
112
+ '_wcml_custom_prices_status',
113
+ true
114
+ );
115
+
116
+ if ( !$use_custom_prices ) $show_currency_switcher = false;
117
+ }
118
  }
119
 
120
+ if ( $show_currency_switcher ) {
121
 
122
  $currencies = isset($wcml_settings['currencies_order']) ?
123
  $wcml_settings['currencies_order'] :
inc/currencies/class-wcml-custom-prices.php CHANGED
@@ -353,7 +353,7 @@ class WCML_Custom_Prices{
353
 
354
  if( isset( $_POST[ '_wcml_custom_prices' ] ) && isset( $nonce ) && wp_verify_nonce( $nonce, 'wcml_save_custom_prices' ) && !$this->woocommerce_wpml->products->is_variable_product( $post_id ) ){
355
  if( isset( $_POST[ '_wcml_custom_prices' ][ $post_id ] ) || isset( $_POST[ '_wcml_custom_prices' ][ 'new' ] ) ) {
356
- $wcml_custom_prices_option = isset( $_POST[ '_wcml_custom_prices' ][ $post_id ] ) ? $_POST[ '_wcml_custom_prices' ][ $post_id ] : isset( $_POST[ '_wcml_custom_prices' ][ 'new' ] );
357
  }else{
358
  $current_option = get_post_meta( $post_id, '_wcml_custom_prices_status', true );
359
  $wcml_custom_prices_option = $current_option ? $current_option : 0;
353
 
354
  if( isset( $_POST[ '_wcml_custom_prices' ] ) && isset( $nonce ) && wp_verify_nonce( $nonce, 'wcml_save_custom_prices' ) && !$this->woocommerce_wpml->products->is_variable_product( $post_id ) ){
355
  if( isset( $_POST[ '_wcml_custom_prices' ][ $post_id ] ) || isset( $_POST[ '_wcml_custom_prices' ][ 'new' ] ) ) {
356
+ $wcml_custom_prices_option = isset( $_POST[ '_wcml_custom_prices' ][ $post_id ] ) ? $_POST[ '_wcml_custom_prices' ][ $post_id ] : $_POST[ '_wcml_custom_prices' ][ 'new' ];
357
  }else{
358
  $current_option = get_post_meta( $post_id, '_wcml_custom_prices_status', true );
359
  $wcml_custom_prices_option = $current_option ? $current_option : 0;
inc/currencies/class-wcml-multi-currency-prices.php CHANGED
@@ -61,9 +61,9 @@ class WCML_Multi_Currency_Prices{
61
 
62
  // formatting options
63
  add_filter('option_woocommerce_price_thousand_sep', array($this, 'filter_currency_thousand_sep_option'));
64
- add_filter('option_woocommerce_price_decimal_sep', array($this, 'filter_currency_decimal_sep_option'));
65
  add_filter('option_woocommerce_price_num_decimals', array($this, 'filter_currency_num_decimals_option'));
66
- add_filter('option_woocommerce_currency_pos', array($this, 'filter_currency_position_option'));
67
 
68
  //need for display correct price format for order on orders list page
69
  add_filter( 'get_post_metadata', array( $this, 'save_order_currency_for_filter' ), 10, 4);
@@ -599,18 +599,23 @@ class WCML_Multi_Currency_Prices{
599
  }
600
 
601
  public function filter_currency_num_decimals_option($value){
 
 
602
 
603
  $db = debug_backtrace();
604
  if(
605
- $db['8']['function'] == 'calculate_shipping_for_package' && $db['5']['function'] == 'add_rate' ||
 
 
 
606
  $db['7']['function'] == 'calculate_shipping_for_package' && $db['4']['function'] == 'add_rate'
607
  ){
608
- $currency_code = get_option( 'woocommerce_currency' );
609
  }else{
610
  $currency_code = $this->check_admin_order_currency_code();
611
  }
612
 
613
- if(isset($this->multi_currency->currencies[$currency_code]['num_decimals']) ){
614
  $value = $this->multi_currency->currencies[$currency_code]['num_decimals'];
615
  }
616
 
61
 
62
  // formatting options
63
  add_filter('option_woocommerce_price_thousand_sep', array($this, 'filter_currency_thousand_sep_option'));
64
+ add_filter('option_woocommerce_price_decimal_sep', array($this, 'filter_currency_decimal_sep_option'));
65
  add_filter('option_woocommerce_price_num_decimals', array($this, 'filter_currency_num_decimals_option'));
66
+ add_filter('option_woocommerce_currency_pos', array($this, 'filter_currency_position_option'));
67
 
68
  //need for display correct price format for order on orders list page
69
  add_filter( 'get_post_metadata', array( $this, 'save_order_currency_for_filter' ), 10, 4);
599
  }
600
 
601
  public function filter_currency_num_decimals_option($value){
602
+ // no other way available (at the moment) to filter currency_num_decimals_option
603
+ $default_currency = $this->multi_currency->get_default_currency();
604
 
605
  $db = debug_backtrace();
606
  if(
607
+ isset( $db['8']['function'] ) && isset( $db['5']['function'] ) &&
608
+ $db['8']['function'] == 'calculate_shipping_for_package' && $db['5']['function'] == 'add_rate'
609
+ ||
610
+ isset( $db['7']['function'] ) && isset( $db['4']['function'] ) &&
611
  $db['7']['function'] == 'calculate_shipping_for_package' && $db['4']['function'] == 'add_rate'
612
  ){
613
+ $currency_code = $default_currency;
614
  }else{
615
  $currency_code = $this->check_admin_order_currency_code();
616
  }
617
 
618
+ if( $currency_code !== $default_currency && isset($this->multi_currency->currencies[$currency_code]['num_decimals']) ){
619
  $value = $this->multi_currency->currencies[$currency_code]['num_decimals'];
620
  }
621
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: CMS, woocommerce, commerce, ecommerce, e-commerce, products, WPML, multili
5
  License: GPLv2
6
  Requires at least: 3.9
7
  Tested up to: 4.6.1
8
- Stable tag: 3.9.2
9
 
10
  Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
11
 
@@ -142,6 +142,11 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
142
 
143
  == Changelog ==
144
 
 
 
 
 
 
145
  = 3.9.2 =
146
  * Bug fix: User with the Shop Manager role was could not access WooCommerce Multilingual menu
147
  * Bug fix: the shipping tax was not applied correctly when using a WooCommerce version prior 2.6
5
  License: GPLv2
6
  Requires at least: 3.9
7
  Tested up to: 4.6.1
8
+ Stable tag: 3.9.3
9
 
10
  Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
11
 
142
 
143
  == Changelog ==
144
 
145
+ = 3.9.3 =
146
+ * Fixed a bug that was causing the currency switcher to not be displayed on the cart and checkout pages in certain conditions
147
+ * Fixed PHP notices on the backend when using PHP 7
148
+ * Fixed a bug making the number of decimals for the default currency being overridden in the backend when the multi-currency was on
149
+
150
  = 3.9.2 =
151
  * Bug fix: User with the Shop Manager role was could not access WooCommerce Multilingual menu
152
  * Bug fix: the shipping tax was not applied correctly when using a WooCommerce version prior 2.6
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitc30053a51ee5263452335210f259eb3c::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitea5526f224e4d65c1f284250e90538a6::getLoader();
vendor/autoload_52.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
- return ComposerAutoloaderInit6b46ab8ff4e2eb9c99174b776d4d0c14::getLoader();
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
+ return ComposerAutoloaderIniteb00ba46a84925a61ba362aaff49ce77::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitc30053a51ee5263452335210f259eb3c
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInitc30053a51ee5263452335210f259eb3c
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitc30053a51ee5263452335210f259eb3c', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitc30053a51ee5263452335210f259eb3c', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInitc30053a51ee5263452335210f259eb3c::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitea5526f224e4d65c1f284250e90538a6
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitea5526f224e4d65c1f284250e90538a6', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitea5526f224e4d65c1f284250e90538a6', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInitea5526f224e4d65c1f284250e90538a6::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_real_52.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
- class ComposerAutoloaderInit6b46ab8ff4e2eb9c99174b776d4d0c14 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit6b46ab8ff4e2eb9c99174b776d4d0c14 {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit6b46ab8ff4e2eb9c99174b776d4d0c14', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit6b46ab8ff4e2eb9c99174b776d4d0c14', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
+ class ComposerAutoloaderIniteb00ba46a84925a61ba362aaff49ce77 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderIniteb00ba46a84925a61ba362aaff49ce77', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderIniteb00ba46a84925a61ba362aaff49ce77', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitc30053a51ee5263452335210f259eb3c
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'C' =>
@@ -155,10 +155,10 @@ class ComposerStaticInitc30053a51ee5263452335210f259eb3c
155
  public static function getInitializer(ClassLoader $loader)
156
  {
157
  return \Closure::bind(function () use ($loader) {
158
- $loader->prefixLengthsPsr4 = ComposerStaticInitc30053a51ee5263452335210f259eb3c::$prefixLengthsPsr4;
159
- $loader->prefixDirsPsr4 = ComposerStaticInitc30053a51ee5263452335210f259eb3c::$prefixDirsPsr4;
160
- $loader->prefixesPsr0 = ComposerStaticInitc30053a51ee5263452335210f259eb3c::$prefixesPsr0;
161
- $loader->classMap = ComposerStaticInitc30053a51ee5263452335210f259eb3c::$classMap;
162
 
163
  }, null, ClassLoader::class);
164
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitea5526f224e4d65c1f284250e90538a6
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'C' =>
155
  public static function getInitializer(ClassLoader $loader)
156
  {
157
  return \Closure::bind(function () use ($loader) {
158
+ $loader->prefixLengthsPsr4 = ComposerStaticInitea5526f224e4d65c1f284250e90538a6::$prefixLengthsPsr4;
159
+ $loader->prefixDirsPsr4 = ComposerStaticInitea5526f224e4d65c1f284250e90538a6::$prefixDirsPsr4;
160
+ $loader->prefixesPsr0 = ComposerStaticInitea5526f224e4d65c1f284250e90538a6::$prefixesPsr0;
161
+ $loader->classMap = ComposerStaticInitea5526f224e4d65c1f284250e90538a6::$classMap;
162
 
163
  }, null, ClassLoader::class);
164
  }
wpml-woocommerce.php CHANGED
@@ -6,12 +6,12 @@
6
  Author: OnTheGoSystems
7
  Author URI: http://www.onthegosystems.com/
8
  Text Domain: woocommerce-multilingual
9
- Version: 3.9.2
10
  */
11
 
12
  if( defined( 'WCML_VERSION' ) ) return;
13
 
14
- define( 'WCML_VERSION', '3.9.2' );
15
  define( 'WCML_PLUGIN_PATH', dirname( __FILE__ ) );
16
  define( 'WCML_PLUGIN_FOLDER', basename( WCML_PLUGIN_PATH ) );
17
  define( 'WCML_LOCALE_PATH', WCML_PLUGIN_PATH . '/locale' );
6
  Author: OnTheGoSystems
7
  Author URI: http://www.onthegosystems.com/
8
  Text Domain: woocommerce-multilingual
9
+ Version: 3.9.3
10
  */
11
 
12
  if( defined( 'WCML_VERSION' ) ) return;
13
 
14
+ define( 'WCML_VERSION', '3.9.3' );
15
  define( 'WCML_PLUGIN_PATH', dirname( __FILE__ ) );
16
  define( 'WCML_PLUGIN_FOLDER', basename( WCML_PLUGIN_PATH ) );
17
  define( 'WCML_LOCALE_PATH', WCML_PLUGIN_PATH . '/locale' );