WooCommerce Multilingual – run WooCommerce with WPML - Version 3.9.2

Version Description

  • Bug fix: User with the Shop Manager role was could not access WooCommerce Multilingual menu
  • Bug fix: the shipping tax was not applied correctly when using a WooCommerce version prior 2.6
  • Bug fix: Translations for variaiton descriptions were not saved correctly
  • Bug fix: New order emails sent to admins included incorrectly translated strings
  • Bug fix: A fatal error was occurring when upgrading from WooCommerce Multilingual 3.3 (or older)
  • Product add-on titles were missing from order pages and emails
Download this release

Release Info

Developer sergey.r
Plugin Icon 128x128 WooCommerce Multilingual – run WooCommerce with WPML
Version 3.9.2
Comparing to
See all releases

Code changes from version 3.9.1.1 to 3.9.2

compatibility/class-wcml-aurum.php CHANGED
@@ -4,7 +4,7 @@ class WCML_Aurum{
4
 
5
  function __construct(){
6
 
7
- add_filter( 'wcml_multi_currency_is_ajax', array( $this,'add_ajax_action' ) );
8
  }
9
 
10
  function add_ajax_action( $actions ){
4
 
5
  function __construct(){
6
 
7
+ add_filter( 'wcml_multi_currency_ajax_actions', array( $this,'add_ajax_action' ) );
8
  }
9
 
10
  function add_ajax_action( $actions ){
compatibility/class-wcml-bookings.php CHANGED
@@ -83,7 +83,7 @@ class WCML_Bookings {
83
  'wc_bookings_process_cost_rules_override_block_cost'
84
  ), 10, 3 );
85
 
86
- add_filter( 'wcml_multi_currency_is_ajax', array( $this, 'wcml_multi_currency_is_ajax' ) );
87
 
88
  add_filter( 'wcml_cart_contents_not_changed', array(
89
  $this,
@@ -172,9 +172,12 @@ class WCML_Bookings {
172
  ), 10, 4 );
173
  }
174
 
 
175
 
176
  $this->clear_transient_fields();
177
 
 
 
178
  }
179
 
180
  function wcml_price_field_after_booking_base_cost( $post_id ) {
@@ -2215,4 +2218,18 @@ class WCML_Bookings {
2215
 
2216
  }
2217
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2218
  }
83
  'wc_bookings_process_cost_rules_override_block_cost'
84
  ), 10, 3 );
85
 
86
+ add_filter( 'wcml_multi_currency_ajax_actions', array( $this, 'wcml_multi_currency_is_ajax' ) );
87
 
88
  add_filter( 'wcml_cart_contents_not_changed', array(
89
  $this,
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
 
179
+ add_filter( 'wpml_tm_dashboard_translatable_types', array( $this, 'hide_bookings_type_on_tm_dashboard' ) );
180
+
181
  }
182
 
183
  function wcml_price_field_after_booking_base_cost( $post_id ) {
2218
 
2219
  }
2220
 
2221
+ public function extra_conditions_to_filter_bookings( $extra_conditions ){
2222
+
2223
+ if( isset( $_GET[ 'post_type' ] ) && $_GET[ 'post_type' ] == 'wc_booking' && !isset( $_GET[ 'post_status' ] ) ){
2224
+ $extra_conditions = str_replace( "GROUP BY", " AND post_status = 'confirmed' GROUP BY", $extra_conditions );
2225
+ }
2226
+
2227
+ return $extra_conditions;
2228
+ }
2229
+
2230
+ public function hide_bookings_type_on_tm_dashboard( $types ){
2231
+ unset( $types[ 'wc_booking' ] );
2232
+ return $types;
2233
+ }
2234
+
2235
  }
compatibility/class-wcml-flatsome.php CHANGED
@@ -3,7 +3,7 @@
3
  class WCML_Flatsome{
4
 
5
  function __construct(){
6
- add_filter( 'wcml_multi_currency_is_ajax', array( $this, 'add_action_to_multi_currency_ajax' ) );
7
  }
8
 
9
  function add_action_to_multi_currency_ajax($actions){
3
  class WCML_Flatsome{
4
 
5
  function __construct(){
6
+ add_filter( 'wcml_multi_currency_ajax_actions', array( $this, 'add_action_to_multi_currency_ajax' ) );
7
  }
8
 
9
  function add_action_to_multi_currency_ajax($actions){
compatibility/class-wcml-gravityforms.php CHANGED
@@ -3,8 +3,8 @@
3
  class WCML_gravityforms{
4
 
5
  function __construct(){
6
- add_filter('gform_formatted_money',array($this,'wcml_convert_price'),10,2);
7
- add_filter('wcml_multi_currency_is_ajax',array($this,'add_ajax_action'));
8
 
9
  add_action( 'wcml_after_duplicate_product_post_meta', array( $this, 'sync_gf_data'), 10, 3 );
10
  }
3
  class WCML_gravityforms{
4
 
5
  function __construct(){
6
+ add_filter( 'gform_formatted_money', array( $this, 'wcml_convert_price' ), 10, 2 );
7
+ add_filter( 'wcml_multi_currency_ajax_actions', array( $this, 'add_ajax_action' ) );
8
 
9
  add_action( 'wcml_after_duplicate_product_post_meta', array( $this, 'sync_gf_data'), 10, 3 );
10
  }
compatibility/class-wcml-product-bundles.php CHANGED
@@ -65,46 +65,44 @@ class WCML_Product_Bundles{
65
  if( $bundle_data_array ){
66
  $lang = $this->sitepress->get_language_for_element( $trnsl_product_id, 'post_product' );
67
  $tr_bundle_meta = maybe_unserialize( get_post_meta( $trnsl_product_id, '_bundle_data', true ) );
68
- $tr_ids = array();
69
  $i = 2;
70
- foreach( $bundle_data_array as $id => $bundle_data ){
71
- $tr_id = apply_filters( 'translate_object_id', $id, get_post_type( $id ), true, $lang );
72
- if( isset( $tr_bundle_meta[ $tr_id ] ) ){
73
- $bundle_key = $tr_id.'_'.$i;
74
- $i++;
75
- }else{
76
- $bundle_key = $tr_id;
77
- }
78
- $tr_bundle[ $bundle_key ] = $bundle_data;
79
- $tr_bundle[ $bundle_key ][ 'product_id' ] = $tr_id;
80
  if( isset( $bundle_data[ 'product_title' ] ) ){
81
  if( $bundle_data[ 'override_title' ] == 'yes' ){
82
- $tr_bundle[ $bundle_key ][ 'product_title' ] =
83
- isset( $tr_bundle_meta[ $bundle_key ][ 'product_title' ] ) ?
84
- $tr_bundle_meta[ $bundle_key ][ 'product_title' ] :
85
  '';
86
  }else{
87
  $tr_title= get_the_title( $tr_id );
88
- $tr_bundle[ $bundle_key ][ 'product_title' ] = $tr_title;
89
  }
90
  }
91
  if( isset( $bundle_data[ 'product_description' ] ) ){
92
  if( $bundle_data[ 'override_description' ] == 'yes' ){
93
- $tr_bundle[ $bundle_key ][ 'product_description' ] =
94
- isset( $tr_bundle_meta[ $bundle_key ][ 'product_description' ] ) ?
95
- $tr_bundle_meta[ $bundle_key ][ 'product_description' ] :
96
  '';
97
  }else{
98
  $tr_prod = get_post( $tr_id );
99
  $tr_desc = $tr_prod->post_excerpt;
100
- $tr_bundle[ $bundle_key ][ 'product_description' ] = $tr_desc;
101
  }
102
  }
103
  if( isset( $bundle_data[ 'filter_variations' ] ) && $bundle_data[ 'filter_variations' ] == 'yes' ){
104
  $allowed_var = $bundle_data[ 'allowed_variations' ];
105
  foreach( $allowed_var as $key => $var_id ){
106
  $tr_var_id = apply_filters( 'translate_object_id', $var_id, get_post_type( $var_id ), true, $lang );
107
- $tr_bundle[ $bundle_key ][ 'allowed_variations' ][ $key ] = $tr_var_id;
108
  }
109
  }
110
  if( isset( $bundle_data[ 'bundle_defaults' ] ) && !empty( $bundle_data[ 'bundle_defaults' ] ) ){
@@ -115,7 +113,7 @@ class WCML_Product_Bundles{
115
  // Global Attribute
116
  $tr_def_id = apply_filters( 'translate_object_id', $term_id, $tax, true, $lang );
117
  $tr_term = $this->woocommerce_wpml->terms->wcml_get_term_by_id( $tr_def_id, $tax );
118
- $tr_bundle[ $bundle_key ][ 'bundle_defaults' ][ $tax ] = $tr_term->slug;
119
  }else{
120
  // Custom Attribute
121
  $args = array(
@@ -128,7 +126,7 @@ class WCML_Product_Bundles{
128
  while ( $variationloop->have_posts() ) : $variationloop->the_post();
129
  $tr_var_id = apply_filters( 'translate_object_id', get_the_ID(), 'product_variation', true, $lang );
130
  $tr_meta = get_post_meta( $tr_var_id, 'attribute_'.$tax , true );
131
- $tr_bundle[ $bundle_key ][ 'bundle_defaults' ][ $tax ] = $tr_meta;
132
  endwhile;
133
  }
134
  }
@@ -140,6 +138,20 @@ class WCML_Product_Bundles{
140
  }
141
 
142
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  // Update Bundled products title and descritpion after saving the translation
144
  function bundle_update( $original_product_id, $tr_id, $data, $lang ){
145
 
@@ -154,11 +166,14 @@ class WCML_Product_Bundles{
154
 
155
  $product_bundles = array_keys( $bundle_data );
156
 
157
- foreach ( $product_bundles as $key => $bundle_id ) {
158
- $bundle_product_tr_id = apply_filters( 'translate_object_id', $bundle_id, get_post_type( $bundle_id ), true, $lang );
159
- if( isset( $tr_bundle_data[ $bundle_product_tr_id ] ) ){
160
- $tr_bundle_data[ $bundle_product_tr_id ][ 'product_title' ] = $data[ md5( 'bundle_'.$bundle_id.'_title' ) ];
161
- $tr_bundle_data[ $bundle_product_tr_id ][ 'product_description' ] = $data[ md5( 'bundle_'.$bundle_id.'_desc' ) ];
 
 
 
162
  }
163
  }
164
  update_post_meta( $tr_id, '_bundle_data', $tr_bundle_data );
@@ -237,25 +252,26 @@ class WCML_Product_Bundles{
237
 
238
  $product_bundles = array_keys( $bundle_data );
239
 
240
- foreach ( $product_bundles as $bundle_id ) {
241
 
242
- $curr_bundle_id = apply_filters( 'translate_object_id', $bundle_id, 'product', false, $lang );
 
243
 
244
- if( $bundle_data[ $bundle_id ][ 'override_title' ] == 'yes' ){
245
- $data[ 'bundle_'.$bundle_id.'_title' ] = array( 'original' => $bundle_data[ $bundle_id ][ 'product_title' ] );
246
- if( isset( $tr_bundle_data[ $curr_bundle_id ][ 'override_title' ] ) ){
247
- $data[ 'bundle_'.$bundle_id.'_title' ][ 'translation' ] = $tr_bundle_data[ $curr_bundle_id ][ 'product_title' ];
248
  }else{
249
- $data[ 'bundle_'.$bundle_id.'_title' ][ 'translation' ] = '';
250
  }
251
  }
252
 
253
- if( $bundle_data[ $bundle_id ][ 'override_description' ] == 'yes' ){
254
- $data[ 'bundle_'.$bundle_id.'_desc' ] = array( 'original' => $bundle_data[ $bundle_id ][ 'product_description' ] );
255
- if( isset( $tr_bundle_data[ $curr_bundle_id ][ 'override_description' ] ) ){
256
- $data[ 'bundle_'.$bundle_id.'_desc' ][ 'translation' ] = $tr_bundle_data[ $curr_bundle_id ][ 'product_description' ];
257
  }else{
258
- $data[ 'bundle_'.$bundle_id.'_desc' ][ 'translation' ] = '';
259
  }
260
  }
261
  }
@@ -329,12 +345,12 @@ class WCML_Product_Bundles{
329
 
330
  $fields = array( 'title', 'description' );
331
 
332
- foreach( $bundle_data as $product ){
333
 
334
  foreach( $fields as $field ) {
335
  if ( $product[ 'override_' . $field ] == 'yes' && !empty( $product[ 'product_' . $field ] ) ) {
336
 
337
- $package[ 'contents' ][ 'product_bundles:' . $product['product_id'] . ':' . $field ] = array(
338
  'translate' => 1,
339
  'data' => $this->tp->encode_field_data( $product[ 'product_' . $field ], 'base64' ),
340
  'format' => 'base64'
@@ -364,42 +380,29 @@ class WCML_Product_Bundles{
364
 
365
  if( preg_match( '/product_bundles:([0-9]+):(.+)/', $value[ 'field_type' ], $matches ) ){
366
 
367
- $product_id = $matches[1];
368
  $field = $matches[2];
369
 
370
- $translated_product_id = apply_filters( 'translate_object_id', $product_id, 'product', true, $job->language_code );
371
-
372
- $products_translation_map[ $translated_product_id ] = $product_id;
373
-
374
- if( $translated_product_id ){
375
-
376
- $translated_bundle_pieces[ $translated_product_id ][ $field ] = $value[ 'data' ];
377
-
 
 
 
 
 
 
 
 
378
  }
379
- }
380
- }
381
-
382
- if( $translated_bundle_pieces ){
383
- foreach( $translated_bundle_pieces as $product_id => $piece ){
384
-
385
- if( isset( $products_translation_map[ $product_id ] ) ) {
386
 
387
- $bundle_data[ $product_id ] = array(
388
 
389
- 'product_id' => $product_id,
390
- 'hide_thumbnail' => $bundle_data_original[ $products_translation_map[ $product_id ] ][ 'hide_thumbnail' ],
391
- 'override_title' => $bundle_data_original[ $products_translation_map[ $product_id ] ][ 'override_title' ],
392
- 'product_title' => isset( $piece[ 'title' ] ) ? $piece[ 'title' ] : '',
393
- 'override_description' => $bundle_data_original[ $products_translation_map[ $product_id ] ][ 'override_description' ],
394
- 'product_description' => isset( $piece[ 'description' ] ) ? $piece[ 'description' ] : '',
395
- 'optional' => $bundle_data_original[ $products_translation_map[ $product_id ] ][ 'optional' ],
396
- 'bundle_quantity' => $bundle_data_original[ $products_translation_map[ $product_id ] ][ 'bundle_quantity' ],
397
- 'bundle_quantity_max' => $bundle_data_original[ $products_translation_map[ $product_id ] ][ 'bundle_quantity_max' ],
398
- 'bundle_discount' => $bundle_data_original[ $products_translation_map[ $product_id ] ][ 'bundle_discount' ],
399
- 'visibility' => $bundle_data_original[ $products_translation_map[ $product_id ] ][ 'visibility' ],
400
-
401
- );
402
- }
403
  }
404
  }
405
 
65
  if( $bundle_data_array ){
66
  $lang = $this->sitepress->get_language_for_element( $trnsl_product_id, 'post_product' );
67
  $tr_bundle_meta = maybe_unserialize( get_post_meta( $trnsl_product_id, '_bundle_data', true ) );
68
+
69
  $i = 2;
70
+ foreach( $bundle_data_array as $bundle_key => $bundle_data ){
71
+
72
+ $key_data = $this->translate_bundle_key( $bundle_key, $lang );
73
+ $tr_id = $key_data->tr_id;
74
+ $tr_bundle_key = $key_data->tr_key;
75
+
76
+ $tr_bundle[ $tr_bundle_key ] = $bundle_data;
77
+ $tr_bundle[ $tr_bundle_key ][ 'product_id' ] = $tr_id;
 
 
78
  if( isset( $bundle_data[ 'product_title' ] ) ){
79
  if( $bundle_data[ 'override_title' ] == 'yes' ){
80
+ $tr_bundle[ $tr_bundle_key ][ 'product_title' ] =
81
+ isset( $tr_bundle_meta[ $tr_bundle_key ][ 'product_title' ] ) ?
82
+ $tr_bundle_meta[ $tr_bundle_key ][ 'product_title' ] :
83
  '';
84
  }else{
85
  $tr_title= get_the_title( $tr_id );
86
+ $tr_bundle[ $tr_bundle_key ][ 'product_title' ] = $tr_title;
87
  }
88
  }
89
  if( isset( $bundle_data[ 'product_description' ] ) ){
90
  if( $bundle_data[ 'override_description' ] == 'yes' ){
91
+ $tr_bundle[ $tr_bundle_key ][ 'product_description' ] =
92
+ isset( $tr_bundle_meta[ $tr_bundle_key ][ 'product_description' ] ) ?
93
+ $tr_bundle_meta[ $tr_bundle_key ][ 'product_description' ] :
94
  '';
95
  }else{
96
  $tr_prod = get_post( $tr_id );
97
  $tr_desc = $tr_prod->post_excerpt;
98
+ $tr_bundle[ $tr_bundle_key ][ 'product_description' ] = $tr_desc;
99
  }
100
  }
101
  if( isset( $bundle_data[ 'filter_variations' ] ) && $bundle_data[ 'filter_variations' ] == 'yes' ){
102
  $allowed_var = $bundle_data[ 'allowed_variations' ];
103
  foreach( $allowed_var as $key => $var_id ){
104
  $tr_var_id = apply_filters( 'translate_object_id', $var_id, get_post_type( $var_id ), true, $lang );
105
+ $tr_bundle[ $tr_bundle_key ][ 'allowed_variations' ][ $key ] = $tr_var_id;
106
  }
107
  }
108
  if( isset( $bundle_data[ 'bundle_defaults' ] ) && !empty( $bundle_data[ 'bundle_defaults' ] ) ){
113
  // Global Attribute
114
  $tr_def_id = apply_filters( 'translate_object_id', $term_id, $tax, true, $lang );
115
  $tr_term = $this->woocommerce_wpml->terms->wcml_get_term_by_id( $tr_def_id, $tax );
116
+ $tr_bundle[ $tr_bundle_key ][ 'bundle_defaults' ][ $tax ] = $tr_term->slug;
117
  }else{
118
  // Custom Attribute
119
  $args = array(
126
  while ( $variationloop->have_posts() ) : $variationloop->the_post();
127
  $tr_var_id = apply_filters( 'translate_object_id', get_the_ID(), 'product_variation', true, $lang );
128
  $tr_meta = get_post_meta( $tr_var_id, 'attribute_'.$tax , true );
129
+ $tr_bundle[ $tr_bundle_key ][ 'bundle_defaults' ][ $tax ] = $tr_meta;
130
  endwhile;
131
  }
132
  }
138
  }
139
 
140
  }
141
+
142
+
143
+ public function translate_bundle_key( $key, $lang, $return_original_if_missing = true ) {
144
+ $key_parts = explode( '_', $key );
145
+ $has_multiple_products = count( $key_parts ) > 1;
146
+
147
+ $data = new stdClass;
148
+ $data->id = $has_multiple_products ? $key_parts[ 0 ] : $key;
149
+ $data->tr_id = apply_filters( 'translate_object_id', $data->id, get_post_type( $data->id ), $return_original_if_missing, $lang );
150
+ $data->tr_key = $data->tr_id . ( $has_multiple_products ? '_' . $key_parts[ 1 ] : '' );
151
+
152
+ return $data;
153
+ }
154
+
155
  // Update Bundled products title and descritpion after saving the translation
156
  function bundle_update( $original_product_id, $tr_id, $data, $lang ){
157
 
166
 
167
  $product_bundles = array_keys( $bundle_data );
168
 
169
+ foreach ( $product_bundles as $key => $bundle_key ) {
170
+
171
+ $key_data = $this->translate_bundle_key( $bundle_key, $lang );
172
+ $tr_bundle_key = $key_data->tr_key;
173
+
174
+ if( isset( $tr_bundle_data[ $tr_bundle_key ] ) ){
175
+ $tr_bundle_data[ $tr_bundle_key ][ 'product_title' ] = $data[ md5( 'bundle_'.$bundle_key.'_title' ) ];
176
+ $tr_bundle_data[ $tr_bundle_key ][ 'product_description' ] = $data[ md5( 'bundle_'.$bundle_key.'_desc' ) ];
177
  }
178
  }
179
  update_post_meta( $tr_id, '_bundle_data', $tr_bundle_data );
252
 
253
  $product_bundles = array_keys( $bundle_data );
254
 
255
+ foreach ( $product_bundles as $bundle_key ) {
256
 
257
+ $key_data = $this->translate_bundle_key( $bundle_key, $lang );
258
+ $tr_bundle_key = $key_data->tr_key;
259
 
260
+ if( $bundle_data[ $bundle_key ][ 'override_title' ] == 'yes' ){
261
+ $data[ 'bundle_'.$bundle_key.'_title' ] = array( 'original' => $bundle_data[ $bundle_key ][ 'product_title' ] );
262
+ if( isset( $tr_bundle_data[ $tr_bundle_key ][ 'override_title' ] ) ){
263
+ $data[ 'bundle_'.$bundle_key.'_title' ][ 'translation' ] = $tr_bundle_data[ $tr_bundle_key ][ 'product_title' ];
264
  }else{
265
+ $data[ 'bundle_'.$bundle_key.'_title' ][ 'translation' ] = '';
266
  }
267
  }
268
 
269
+ if( $bundle_data[ $bundle_key ][ 'override_description' ] == 'yes' ){
270
+ $data[ 'bundle_'.$bundle_key.'_desc' ] = array( 'original' => $bundle_data[ $bundle_key ][ 'product_description' ] );
271
+ if( isset( $tr_bundle_data[ $tr_bundle_key ][ 'override_description' ] ) ){
272
+ $data[ 'bundle_'.$bundle_key.'_desc' ][ 'translation' ] = $tr_bundle_data[ $tr_bundle_key ][ 'product_description' ];
273
  }else{
274
+ $data[ 'bundle_'.$bundle_key.'_desc' ][ 'translation' ] = '';
275
  }
276
  }
277
  }
345
 
346
  $fields = array( 'title', 'description' );
347
 
348
+ foreach( $bundle_data as $bundle_key => $product ){
349
 
350
  foreach( $fields as $field ) {
351
  if ( $product[ 'override_' . $field ] == 'yes' && !empty( $product[ 'product_' . $field ] ) ) {
352
 
353
+ $package[ 'contents' ][ 'product_bundles:' . $bundle_key . ':' . $field ] = array(
354
  'translate' => 1,
355
  'data' => $this->tp->encode_field_data( $product[ 'product_' . $field ], 'base64' ),
356
  'format' => 'base64'
380
 
381
  if( preg_match( '/product_bundles:([0-9]+):(.+)/', $value[ 'field_type' ], $matches ) ){
382
 
383
+ $bundle_key = $matches[1];
384
  $field = $matches[2];
385
 
386
+ $key_data = $this->translate_bundle_key( $bundle_key, $job->language_code );
387
+
388
+ if( !isset( $bundle_data[ $key_data->tr_key ] ) ){
389
+ $bundle_data[ $key_data->tr_key ] = array(
390
+ 'product_id' => $key_data->tr_id,
391
+ 'hide_thumbnail' => $bundle_data_original[ $bundle_key ][ 'hide_thumbnail' ],
392
+ 'override_title' => $bundle_data_original[ $bundle_key ][ 'override_title' ],
393
+ 'product_title' => '',
394
+ 'override_description' => $bundle_data_original[ $bundle_key ][ 'override_description' ],
395
+ 'product_description' => '',
396
+ 'optional' => $bundle_data_original[ $bundle_key ][ 'optional' ],
397
+ 'bundle_quantity' => $bundle_data_original[ $bundle_key ][ 'bundle_quantity' ],
398
+ 'bundle_quantity_max' => $bundle_data_original[ $bundle_key ][ 'bundle_quantity_max' ],
399
+ 'bundle_discount' => $bundle_data_original[ $bundle_key ][ 'bundle_discount' ],
400
+ 'visibility' => $bundle_data_original[ $bundle_key ][ 'visibility' ],
401
+ );
402
  }
 
 
 
 
 
 
 
403
 
404
+ $bundle_data[ $key_data->tr_key ][ 'product_'.$field ] = $value[ 'data' ];
405
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
406
  }
407
  }
408
 
inc/admin-menus/class-wcml-admin-menus.php CHANGED
@@ -37,7 +37,7 @@ class WCML_Admin_Menus{
37
  'woocommerce',
38
  __( 'WooCommerce Multilingual', 'woocommerce-multilingual' ),
39
  __( 'WooCommerce Multilingual', 'woocommerce-multilingual' ),
40
- 'wpml_manage_woocommerce_multilingual',
41
  'wpml-wcml',
42
  array( __CLASS__, 'render_menus' )
43
  );
@@ -234,16 +234,21 @@ class WCML_Admin_Menus{
234
  }
235
 
236
  public static function inf_editing_product_in_non_default_lang(){
237
- $message = '<div class="message error"><p>';
238
- $message .= sprintf(
239
- __( 'The recommended way to translate WooCommerce products is using the
 
 
 
240
  %sWooCommerce Multilingual products translation%s page.
241
  Please use this page only for translating elements that are not available in the WooCommerce Multilingual products translation table.',
242
- 'woocommerce-multilingual' ),
243
- '<strong><a href="' .admin_url( 'admin.php?page=wpml-wcml&tab=products' ) . '">', '</a></strong>' );
244
- $message .= '</p></div>';
 
245
 
246
- echo $message;
 
247
  }
248
 
249
  public static function check_user_admin_access( $prevent_access ){
37
  'woocommerce',
38
  __( 'WooCommerce Multilingual', 'woocommerce-multilingual' ),
39
  __( 'WooCommerce Multilingual', 'woocommerce-multilingual' ),
40
+ 'wpml_operate_woocommerce_multilingual',
41
  'wpml-wcml',
42
  array( __CLASS__, 'render_menus' )
43
  );
234
  }
235
 
236
  public static function inf_editing_product_in_non_default_lang(){
237
+ if( !self::$woocommerce_wpml->settings[ 'dismiss_tm_warning' ] ) {
238
+ $url = $_SERVER['REQUEST_URI'];
239
+
240
+ $message = '<div class="message error otgs-is-dismissible"><p>';
241
+ $message .= sprintf(
242
+ __('The recommended way to translate WooCommerce products is using the
243
  %sWooCommerce Multilingual products translation%s page.
244
  Please use this page only for translating elements that are not available in the WooCommerce Multilingual products translation table.',
245
+ 'woocommerce-multilingual'),
246
+ '<strong><a href="' . admin_url('admin.php?page=wpml-wcml&tab=products') . '">', '</a></strong>');
247
+ $message .= '</p><a class="notice-dismiss" href="' . $url . '&wcml_action=dismiss_tm_warning"><span class="screen-reader-text">' . __('Dismiss', 'woocommerce-multilingual') . '</a>';
248
+ $message .= '</div>';
249
 
250
+ echo $message;
251
+ }
252
  }
253
 
254
  public static function check_user_admin_access( $prevent_access ){
inc/class-wcml-ajax-setup.php CHANGED
@@ -2,18 +2,26 @@
2
 
3
 
4
  class WCML_Ajax_Setup{
5
-
6
- function __construct(){
7
-
 
 
 
 
 
 
 
8
  add_action( 'init', array( $this, 'init' ) );
9
  add_action( 'wcml_localize_woocommerce_on_ajax', array( $this, 'wcml_localize_woocommerce_on_ajax' ) );
10
 
11
  //@deprecated 3.9
12
  add_action( 'localize_woocommerce_on_ajax', array( $this, 'localize_woocommerce_on_ajax' ) );
13
 
 
14
  }
15
-
16
- function init(){
17
  if (wpml_is_ajax()){
18
  do_action('wcml_localize_woocommerce_on_ajax');
19
  }
@@ -119,8 +127,28 @@ class WCML_Ajax_Setup{
119
  $sitepress->switch_lang($current_language, true);
120
  }
121
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
 
123
- /**
124
  * @deprecated 3.9
125
  */
126
  function localize_woocommerce_on_ajax(){
2
 
3
 
4
  class WCML_Ajax_Setup{
5
+
6
+ /**
7
+ * @var SitePress
8
+ */
9
+ private $sitepress;
10
+
11
+ public function __construct( $sitepres ){
12
+
13
+ $this->sitepress =& $sitepres;
14
+
15
  add_action( 'init', array( $this, 'init' ) );
16
  add_action( 'wcml_localize_woocommerce_on_ajax', array( $this, 'wcml_localize_woocommerce_on_ajax' ) );
17
 
18
  //@deprecated 3.9
19
  add_action( 'localize_woocommerce_on_ajax', array( $this, 'localize_woocommerce_on_ajax' ) );
20
 
21
+ add_action( 'woocommerce_ajax_get_endpoint', array( $this, 'add_language_to_endpoint' ) );
22
  }
23
+
24
+ public function init(){
25
  if (wpml_is_ajax()){
26
  do_action('wcml_localize_woocommerce_on_ajax');
27
  }
127
  $sitepress->switch_lang($current_language, true);
128
  }
129
 
130
+ /**
131
+ * @param $endpoint string
132
+ *
133
+ * Adds a language parameter to the url when different domains for each language are used
134
+ *
135
+ * @return string
136
+ */
137
+ public function add_language_to_endpoint( $endpoint ){
138
+
139
+ $is_per_domain = WPML_LANGUAGE_NEGOTIATION_TYPE_DOMAIN === (int) $this->sitepress->get_setting( 'language_negotiation_type' );
140
+ if( $is_per_domain && $this->sitepress->get_current_language() != $this->sitepress->get_default_language() ){
141
+
142
+ $endpoint = add_query_arg('lang', $this->sitepress->get_current_language(), remove_query_arg( 'lang', $endpoint ) );
143
+ $endpoint = urldecode($endpoint);
144
+
145
+ }
146
+
147
+ return $endpoint;
148
+ }
149
+
150
 
151
+ /**
152
  * @deprecated 3.9
153
  */
154
  function localize_woocommerce_on_ajax(){
inc/class-wcml-emails.php CHANGED
@@ -71,18 +71,17 @@ class WCML_Emails{
71
  }
72
 
73
  function email_refresh_in_ajax(){
74
- if(isset($_GET['order_id'])){
75
- $this->refresh_email_lang($_GET['order_id']);
76
- $this->email_heading_completed($_GET['order_id'],true);
77
  }
78
  }
79
 
80
  function refresh_email_lang_complete( $order_id ){
81
 
82
  $this->order_id = $order_id;
83
- $this->refresh_email_lang($order_id);
84
- $this->email_heading_completed($order_id,true);
85
-
86
  }
87
 
88
  /**
@@ -92,34 +91,31 @@ class WCML_Emails{
92
  * @global type $order_id
93
  * @return type
94
  */
95
- function email_header($order) {
96
-
97
 
98
- if (is_array($order)) {
99
- $order = $order['order_id'];
100
- } elseif (is_object($order)) {
101
  $order = $order->id;
102
  }
103
 
104
- $this->refresh_email_lang($order);
105
-
106
  }
107
 
108
 
109
- function refresh_email_lang($order_id){
110
 
111
  if ( is_array( $order_id ) ) {
112
- if ( isset($order_id['order_id']) ) {
113
- $order_id = $order_id['order_id'];
114
  } else {
115
  return;
116
  }
117
-
118
  }
119
 
120
- $lang = get_post_meta($order_id, 'wpml_language', TRUE);
121
- if(!empty($lang)){
122
- $this->change_email_language($lang);
123
  }
124
  }
125
 
@@ -127,7 +123,7 @@ class WCML_Emails{
127
  * After email translation switch language to default.
128
  */
129
  function email_footer() {
130
- $this->sitepress->switch_lang($this->sitepress->get_default_language());
131
  }
132
 
133
  function comments_language(){
@@ -207,17 +203,17 @@ class WCML_Emails{
207
 
208
  function new_order_admin_email($order_id){
209
  global $woocommerce;
210
- if( class_exists( 'WC_Email_New_Order' ) && isset( $woocommerce->mailer()->emails['WC_Email_New_Order'] ) ){
211
  $recipients = explode(',',$woocommerce->mailer()->emails['WC_Email_New_Order']->get_recipient());
212
  foreach($recipients as $recipient){
213
  $user = get_user_by('email',$recipient);
214
  if($user){
215
- $user_lang = $this->sitepress->get_user_admin_language($user->ID, true);
216
  }else{
217
- $user_lang = get_post_meta($order_id, 'wpml_language', TRUE);
218
  }
219
 
220
- $this->change_email_language($user_lang);
221
 
222
  $woocommerce->mailer()->emails['WC_Email_New_Order']->heading = $this->wcml_get_translated_email_string( 'admin_texts_woocommerce_new_order_settings', '[woocommerce_new_order_settings]heading' );
223
 
@@ -285,7 +281,9 @@ class WCML_Emails{
285
 
286
  $custom_attr_trnsl = $this->woocommerce_wpml->attributes->get_custom_attribute_translation( $object->product->id, $formatted_var[ 'key' ], array('is_taxonomy' => false), $this->sitepress->get_current_language() );
287
 
288
- $formatted_meta[ $key ][ 'label' ] = $custom_attr_trnsl['name'];
 
 
289
  }
290
  }
291
  }
@@ -301,11 +299,12 @@ class WCML_Emails{
301
  $this->sitepress->switch_lang($lang,true);
302
  $this->locale = $this->sitepress->get_locale( $lang );
303
  unload_textdomain('woocommerce');
304
- unload_textdomain('default');
305
- $woocommerce->load_plugin_textdomain();
306
- load_default_textdomain();
307
  global $wp_locale;
308
  $wp_locale = new WP_Locale();
 
 
 
309
  }
310
 
311
  function admin_string_return_cached( $value, $option ){
71
  }
72
 
73
  function email_refresh_in_ajax(){
74
+ if( isset( $_GET[ 'order_id' ] ) ){
75
+ $this->refresh_email_lang( $_GET[ 'order_id' ] );
76
+ $this->email_heading_completed( $_GET[ 'order_id' ], true );
77
  }
78
  }
79
 
80
  function refresh_email_lang_complete( $order_id ){
81
 
82
  $this->order_id = $order_id;
83
+ $this->refresh_email_lang( $order_id );
84
+ $this->email_heading_completed( $order_id, true );
 
85
  }
86
 
87
  /**
91
  * @global type $order_id
92
  * @return type
93
  */
94
+ function email_header( $order ) {
 
95
 
96
+ if( is_array( $order ) ) {
97
+ $order = $order[ 'order_id' ];
98
+ } elseif( is_object( $order ) ) {
99
  $order = $order->id;
100
  }
101
 
102
+ $this->refresh_email_lang( $order );
 
103
  }
104
 
105
 
106
+ function refresh_email_lang( $order_id ){
107
 
108
  if ( is_array( $order_id ) ) {
109
+ if ( isset( $order_id[ 'order_id' ] ) ) {
110
+ $order_id = $order_id[ 'order_id' ];
111
  } else {
112
  return;
113
  }
 
114
  }
115
 
116
+ $lang = get_post_meta( $order_id, 'wpml_language', true );
117
+ if( !empty( $lang ) ){
118
+ $this->change_email_language( $lang );
119
  }
120
  }
121
 
123
  * After email translation switch language to default.
124
  */
125
  function email_footer() {
126
+ $this->sitepress->switch_lang( $this->sitepress->get_default_language() );
127
  }
128
 
129
  function comments_language(){
203
 
204
  function new_order_admin_email($order_id){
205
  global $woocommerce;
206
+ if( isset( $woocommerce->mailer()->emails[ 'WC_Email_New_Order' ] ) ){
207
  $recipients = explode(',',$woocommerce->mailer()->emails['WC_Email_New_Order']->get_recipient());
208
  foreach($recipients as $recipient){
209
  $user = get_user_by('email',$recipient);
210
  if($user){
211
+ $user_lang = $this->sitepress->get_user_admin_language($user->ID, true );
212
  }else{
213
+ $user_lang = get_post_meta($order_id, 'wpml_language', true );
214
  }
215
 
216
+ $this->change_email_language( $user_lang );
217
 
218
  $woocommerce->mailer()->emails['WC_Email_New_Order']->heading = $this->wcml_get_translated_email_string( 'admin_texts_woocommerce_new_order_settings', '[woocommerce_new_order_settings]heading' );
219
 
281
 
282
  $custom_attr_trnsl = $this->woocommerce_wpml->attributes->get_custom_attribute_translation( $object->product->id, $formatted_var[ 'key' ], array('is_taxonomy' => false), $this->sitepress->get_current_language() );
283
 
284
+ if ( false !== $custom_attr_trnsl ) {
285
+ $formatted_meta[ $key ][ 'label' ] = $custom_attr_trnsl['name'];
286
+ }
287
  }
288
  }
289
  }
299
  $this->sitepress->switch_lang($lang,true);
300
  $this->locale = $this->sitepress->get_locale( $lang );
301
  unload_textdomain('woocommerce');
302
+ unload_textdomain( 'default' );
 
 
303
  global $wp_locale;
304
  $wp_locale = new WP_Locale();
305
+
306
+ $woocommerce->load_plugin_textdomain();
307
+ load_default_textdomain( $this->locale );
308
  }
309
 
310
  function admin_string_return_cached( $value, $option ){
inc/class-wcml-languages-upgrader.php CHANGED
@@ -52,8 +52,17 @@ class WCML_Languages_Upgrader{
52
  $upgr_object[0]->package = $this->get_language_pack_uri( $locale, $wc_version );
53
  $upgr_object[0]->autoupdate = 1;
54
 
 
 
55
  $upgrader->bulk_upgrade( $upgr_object );
56
 
 
 
 
 
 
 
 
57
  $this->save_translation_version( $locale, false, $wc_version );
58
  }
59
 
52
  $upgr_object[0]->package = $this->get_language_pack_uri( $locale, $wc_version );
53
  $upgr_object[0]->autoupdate = 1;
54
 
55
+ $ob_level_before = ob_get_level();
56
+
57
  $upgrader->bulk_upgrade( $upgr_object );
58
 
59
+ // Close a potential unclosed output buffer
60
+ $ob_level_after = ob_get_level();
61
+ if( $ob_level_after > $ob_level_before ){
62
+ ob_end_clean();
63
+ }
64
+
65
+
66
  $this->save_translation_version( $locale, false, $wc_version );
67
  }
68
 
inc/class-wcml-requests.php CHANGED
@@ -32,12 +32,15 @@ class WCML_Requests{
32
  $sitepress->save_settings($sitepress_settings);
33
  }
34
 
35
- if(isset($_GET['wcml_action']) && $_GET['wcml_action'] = 'dismiss'){
36
- $woocommerce_wpml->settings['dismiss_doc_main'] = 1;
 
 
 
 
37
  $woocommerce_wpml->update_settings();
38
  }
39
 
40
-
41
  add_action('wp_ajax_wcml_ignore_warning', array( $this, 'update_settings_from_warning') );
42
 
43
  // Override cached widget id
32
  $sitepress->save_settings($sitepress_settings);
33
  }
34
 
35
+ if( isset( $_GET[ 'wcml_action' ] ) ){
36
+ if( $_GET['wcml_action'] == 'dismiss' ){
37
+ $woocommerce_wpml->settings['dismiss_doc_main'] = 1;
38
+ }elseif( $_GET['wcml_action'] == 'dismiss_tm_warning' ){
39
+ $woocommerce_wpml->settings['dismiss_tm_warning'] = 1;
40
+ }
41
  $woocommerce_wpml->update_settings();
42
  }
43
 
 
44
  add_action('wp_ajax_wcml_ignore_warning', array( $this, 'update_settings_from_warning') );
45
 
46
  // Override cached widget id
inc/class-wcml-upgrade.php CHANGED
@@ -252,8 +252,8 @@ class WCML_Upgrade{
252
  }
253
 
254
  function upgrade_3_2(){
255
-
256
- woocommerce_wpml::set_up_capabilities();
257
 
258
  //delete not existing currencies in WC
259
  global $wpdb;
@@ -269,8 +269,8 @@ class WCML_Upgrade{
269
 
270
  function upgrade_3_3(){
271
  global $wpdb, $woocommerce_wpml;
272
-
273
- woocommerce_wpml::set_up_capabilities();
274
 
275
  $currencies = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "icl_currencies ORDER BY `id` ASC", OBJECT);
276
  if($currencies)
@@ -517,5 +517,10 @@ class WCML_Upgrade{
517
  }
518
  }
519
 
 
 
 
 
 
520
 
521
  }
252
  }
253
 
254
  function upgrade_3_2(){
255
+
256
+ WCML_Capabilities::set_up_capabilities();
257
 
258
  //delete not existing currencies in WC
259
  global $wpdb;
269
 
270
  function upgrade_3_3(){
271
  global $wpdb, $woocommerce_wpml;
272
+
273
+ WCML_Capabilities::set_up_capabilities();
274
 
275
  $currencies = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "icl_currencies ORDER BY `id` ASC", OBJECT);
276
  if($currencies)
517
  }
518
  }
519
 
520
+ function upgrade_3_10(){
521
+ $wcml_settings = get_option( '_wcml_settings' );
522
+ $wcml_settings[ 'dismiss_tm_warning' ] = 0;
523
+ update_option( '_wcml_settings', $wcml_settings );
524
+ }
525
 
526
  }
inc/class-wcml-wc-shipping.php CHANGED
@@ -219,7 +219,8 @@ class WCML_WC_Shipping{
219
  }
220
 
221
  $updated_costs_settings = $this->update_woocommerce_shipping_settings_for_class_costs( $settings );
222
- $inst_settings = array_replace( $inst_settings, $updated_costs_settings );
 
223
 
224
  return $inst_settings;
225
  }
219
  }
220
 
221
  $updated_costs_settings = $this->update_woocommerce_shipping_settings_for_class_costs( $settings );
222
+
223
+ $inst_settings = is_array( $inst_settings ) ? array_replace( $inst_settings, $updated_costs_settings ) : $updated_costs_settings;
224
 
225
  return $inst_settings;
226
  }
inc/class-woocommerce-wpml.php CHANGED
@@ -171,7 +171,7 @@ class woocommerce_wpml {
171
  $this->wcml_products_screen = new WCML_Products_Screen_Options();
172
  $this->wcml_products_screen->init();
173
 
174
- new WCML_Ajax_Setup;
175
  new WCML_Fix_Copied_Custom_Fields_WPML353();
176
 
177
  if ( 'yes' == get_option( 'woocommerce_api_enabled' ) ){
@@ -198,7 +198,8 @@ class woocommerce_wpml {
198
  'dismiss_doc_main' => 0,
199
  'trnsl_interface' => 1,
200
  'currency_options' => array(),
201
- 'currency_switcher_product_visibility' => 1
 
202
  );
203
 
204
  if(empty($this->settings)){
171
  $this->wcml_products_screen = new WCML_Products_Screen_Options();
172
  $this->wcml_products_screen->init();
173
 
174
+ new WCML_Ajax_Setup( $sitepress );
175
  new WCML_Fix_Copied_Custom_Fields_WPML353();
176
 
177
  if ( 'yes' == get_option( 'woocommerce_api_enabled' ) ){
198
  'dismiss_doc_main' => 0,
199
  'trnsl_interface' => 1,
200
  'currency_options' => array(),
201
+ 'currency_switcher_product_visibility' => 1,
202
+ 'dismiss_tm_warning' => 0
203
  );
204
 
205
  if(empty($this->settings)){
inc/currencies/class-wcml-currency-switcher.php CHANGED
@@ -93,23 +93,27 @@ class WCML_Currency_Switcher {
93
  $wcml_settings['wcml_curr_template'] : '%name% (%symbol%) - %code%';
94
  }
95
 
 
 
96
 
97
- if ( isset($wcml_settings['display_custom_prices']) && $wcml_settings['display_custom_prices'] ) {
98
 
99
- if ( is_page( wc_get_page_id( 'cart' ) ) ||
100
- is_page( wc_get_page_id( 'checkout' ) )
101
- ) {
102
- $preview = '';
103
- } elseif ( 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
- if ( !get_post_meta( apply_filters( 'translate_object_id', $current_product_id, get_post_type( $current_product_id ), true, $original_product_language ), '_wcml_custom_prices_status', true ) ) {
108
- $preview = '';
109
- }
110
- }
111
 
112
- } else {
 
 
 
 
 
 
 
 
 
113
 
114
  $currencies = isset($wcml_settings['currencies_order']) ?
115
  $wcml_settings['currencies_order'] :
93
  $wcml_settings['wcml_curr_template'] : '%name% (%symbol%) - %code%';
94
  }
95
 
96
+ $preview = '';
97
+ $show_currency_switcher = true;
98
 
99
+ $display_custom_prices = isset( $wcml_settings[ 'display_custom_prices' ] ) && $wcml_settings[ 'display_custom_prices' ];
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'] :
inc/currencies/class-wcml-multi-currency-prices.php CHANGED
@@ -576,9 +576,10 @@ class WCML_Multi_Currency_Prices{
576
 
577
  public function filter_currency_thousand_sep_option($value){
578
 
 
579
  $currency_code = $this->check_admin_order_currency_code();
580
 
581
- if(isset($this->multi_currency->currencies[$currency_code]['thousand_sep']) ){
582
  $value = $this->multi_currency->currencies[$currency_code]['thousand_sep'];
583
  }
584
  return $value;
@@ -586,9 +587,10 @@ class WCML_Multi_Currency_Prices{
586
 
587
  public function filter_currency_decimal_sep_option($value){
588
 
 
589
  $currency_code = $this->check_admin_order_currency_code();
590
 
591
- if(isset($this->multi_currency->currencies[$currency_code]['decimal_sep']) ){
592
  $value = $this->multi_currency->currencies[$currency_code]['decimal_sep'];
593
 
594
  }
@@ -617,9 +619,11 @@ class WCML_Multi_Currency_Prices{
617
 
618
  public function filter_currency_position_option($value){
619
 
 
620
  $currency_code = $this->get_admin_order_currency_code();
621
 
622
- if(isset($this->multi_currency->currencies[$currency_code]['position']) && get_option('woocommerce_currency') != $currency_code &&
 
623
  in_array($this->multi_currency->currencies[$currency_code]['position'], array('left', 'right', 'left_space', 'right_space'))){
624
  $value = $this->multi_currency->currencies[$currency_code]['position'];
625
  }
576
 
577
  public function filter_currency_thousand_sep_option($value){
578
 
579
+ $default_currency = $this->multi_currency->get_default_currency();
580
  $currency_code = $this->check_admin_order_currency_code();
581
 
582
+ if( $currency_code !== $default_currency && isset( $this->multi_currency->currencies[$currency_code]['thousand_sep'] ) ){
583
  $value = $this->multi_currency->currencies[$currency_code]['thousand_sep'];
584
  }
585
  return $value;
587
 
588
  public function filter_currency_decimal_sep_option($value){
589
 
590
+ $default_currency = $this->multi_currency->get_default_currency();
591
  $currency_code = $this->check_admin_order_currency_code();
592
 
593
+ if( $currency_code !== $default_currency && isset( $this->multi_currency->currencies[$currency_code]['decimal_sep'] ) ){
594
  $value = $this->multi_currency->currencies[$currency_code]['decimal_sep'];
595
 
596
  }
619
 
620
  public function filter_currency_position_option($value){
621
 
622
+ $default_currency = $this->multi_currency->get_default_currency();
623
  $currency_code = $this->get_admin_order_currency_code();
624
 
625
+ if( $currency_code !== $default_currency &&
626
+ isset($this->multi_currency->currencies[$currency_code]['position']) && get_option('woocommerce_currency') != $currency_code &&
627
  in_array($this->multi_currency->currencies[$currency_code]['position'], array('left', 'right', 'left_space', 'right_space'))){
628
  $value = $this->multi_currency->currencies[$currency_code]['position'];
629
  }
inc/currencies/class-wcml-multi-currency-shipping-legacy.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class WCML_Multi_Currency_Shipping_Legacy
5
+ *
6
+ * This code is only required for versions of WooCommerce prior 2.6.0
7
+ *
8
+ */
9
+ class WCML_Multi_Currency_Shipping_Legacy{
10
+
11
+ public function __construct() {
12
+
13
+ add_filter( 'option_woocommerce_free_shipping_settings', array( $this, 'adjust_min_amount_required' ) );
14
+ add_filter( 'woocommerce_package_rates', array($this, 'shipping_taxes_filter'));
15
+
16
+ }
17
+
18
+ public function shipping_taxes_filter($methods){
19
+
20
+ global $woocommerce;
21
+ $woocommerce->shipping->load_shipping_methods();
22
+ $shipping_methods = $woocommerce->shipping->get_shipping_methods();
23
+
24
+ foreach($methods as $k => $method){
25
+
26
+ // exceptions
27
+ if(
28
+ isset($shipping_methods[$method->id]) &&
29
+ isset($shipping_methods[$method->id]->settings['type']) &&
30
+ $shipping_methods[$method->id]->settings['type'] == 'percent'
31
+ || preg_match('/^table_rate-[0-9]+ : [0-9]+$/', $k)
32
+ ){
33
+ continue;
34
+ }
35
+
36
+
37
+ foreach($method->taxes as $j => $tax){
38
+
39
+ $methods[$k]->taxes[$j] = apply_filters('wcml_shipping_price_amount', $methods[$k]->taxes[$j]);
40
+
41
+ }
42
+
43
+ }
44
+
45
+ return $methods;
46
+ }
47
+
48
+ // Before WooCommerce 2.6
49
+ public function adjust_min_amount_required($options){
50
+
51
+ if( !empty( $options['min_amount'] ) ){
52
+ $options['min_amount'] = apply_filters( 'wcml_shipping_free_min_amount', $options['min_amount'] );
53
+ }
54
+
55
+ return $options;
56
+ }
57
+
58
+ }
inc/currencies/class-wcml-multi-currency-shipping.php CHANGED
@@ -13,10 +13,12 @@ class WCML_Multi_Currency_Shipping{
13
  $this->multi_currency =& $multi_currency;
14
 
15
  // shipping method cost settings
16
- $rates = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}woocommerce_shipping_zone_methods WHERE method_id IN('flat_rate', 'local_pickup', 'free_shipping')" );
17
- foreach( $rates as $method ){
18
- $option_name = sprintf('woocommerce_%s_%d_settings', $method->method_id, $method->instance_id );
19
- add_filter('option_' . $option_name, array($this, 'convert_shipping_method_cost_settings'));
 
 
20
  }
21
 
22
  // Used for table rate shipping compatibility class
@@ -27,10 +29,13 @@ class WCML_Multi_Currency_Shipping{
27
 
28
  add_filter( 'woocommerce_shipping_packages', array( $this, 'convert_shipping_taxes'), 10 );
29
 
 
 
30
  // Before WooCommerce 2.6
31
- add_filter( 'option_woocommerce_free_shipping_settings', array( $this, 'adjust_min_amount_required' ) );
 
 
32
 
33
- add_filter( 'woocommerce_package_rates', array($this, 'convert_shipping_costs_in_package_rates'), 10, 2 );
34
 
35
  }
36
 
@@ -129,14 +134,5 @@ class WCML_Multi_Currency_Shipping{
129
 
130
  }
131
 
132
- // Before WooCommerce 2.6
133
- public function adjust_min_amount_required($options){
134
-
135
- if( !empty( $options['min_amount'] ) ){
136
- $options['min_amount'] = apply_filters( 'wcml_shipping_free_min_amount', $options['min_amount'] );
137
- }
138
-
139
- return $options;
140
- }
141
 
142
  }
13
  $this->multi_currency =& $multi_currency;
14
 
15
  // shipping method cost settings
16
+ if( version_compare( WC()->version, '2.6.0', '>=' ) ) {
17
+ $rates = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}woocommerce_shipping_zone_methods WHERE method_id IN('flat_rate', 'local_pickup', 'free_shipping')" );
18
+ foreach ( $rates as $method ) {
19
+ $option_name = sprintf( 'woocommerce_%s_%d_settings', $method->method_id, $method->instance_id );
20
+ add_filter( 'option_' . $option_name, array($this, 'convert_shipping_method_cost_settings') );
21
+ }
22
  }
23
 
24
  // Used for table rate shipping compatibility class
29
 
30
  add_filter( 'woocommerce_shipping_packages', array( $this, 'convert_shipping_taxes'), 10 );
31
 
32
+ add_filter( 'woocommerce_package_rates', array($this, 'convert_shipping_costs_in_package_rates'), 10, 2 );
33
+
34
  // Before WooCommerce 2.6
35
+ if( version_compare( WC()->version, '2.6.0', '<' ) ){
36
+ new WCML_Multi_Currency_Shipping_Legacy();
37
+ }
38
 
 
39
 
40
  }
41
 
134
 
135
  }
136
 
 
 
 
 
 
 
 
 
 
137
 
138
  }
inc/currencies/class-wcml-multi-currency.php CHANGED
@@ -7,13 +7,18 @@
7
 
8
  class WCML_Multi_Currency{
9
 
 
10
  public $currencies = array();
 
11
  public $currency_codes = array();
12
 
 
 
 
13
  private $client_currency;
14
-
15
  private $exchange_rates = array();
16
-
17
  public $currencies_without_cents = array('JPY', 'TWD', 'KRW', 'BIF', 'BYR', 'CLP', 'GNF', 'ISK', 'KMF', 'PYG', 'RWF', 'VUV', 'XAF', 'XOF', 'XPF');
18
 
19
  /**
@@ -95,7 +100,6 @@ class WCML_Multi_Currency{
95
  add_action('wp_ajax_nopriv_wcml_switch_currency', array($this, 'switch_currency'));
96
  add_action('wp_ajax_wcml_switch_currency', array($this, 'switch_currency'));
97
  }
98
-
99
  }
100
 
101
  private function _load_filters(){
@@ -106,7 +110,7 @@ class WCML_Multi_Currency{
106
  }else{
107
  if(is_ajax() && $this->get_client_currency() != get_option('woocommerce_currency')){
108
 
109
- $ajax_actions = apply_filters('wcml_multi_currency_is_ajax',
110
  array(
111
  'woocommerce_get_refreshed_fragments',
112
  'woocommerce_update_order_review',
@@ -126,7 +130,14 @@ class WCML_Multi_Currency{
126
  }
127
  }
128
 
129
- return apply_filters('wcml_load_multi_currency', $load);
 
 
 
 
 
 
 
130
  }
131
 
132
  public function init() {
@@ -148,12 +159,12 @@ class WCML_Multi_Currency{
148
  public function init_currencies(){
149
  global $sitepress;
150
 
 
151
  $this->currencies =& $this->woocommerce_wpml->settings['currency_options'];
152
 
153
  // Add default currency if missing (set when MC is off)
154
- $default_currency = get_option( 'woocommerce_currency' );
155
- if( !empty( $default_currency ) && !isset( $this->currencies[ $default_currency ] ) ){
156
- $this->currencies[ $default_currency ] = array();
157
  }
158
 
159
  $save_to_db = false;
@@ -226,12 +237,21 @@ class WCML_Multi_Currency{
226
  }
227
 
228
  // force disable multi-currency when the default currency is empty
229
- if( empty( $default_currency ) ){
230
  $this->woocommerce_wpml->settings['enable_multi_currency'] = WCML_MULTI_CURRENCIES_DISABLED;
231
  }
232
 
233
  }
234
 
 
 
 
 
 
 
 
 
 
235
  public function get_currencies( $include_default = false ){
236
 
237
  // by default, exclude default currency
7
 
8
  class WCML_Multi_Currency{
9
 
10
+ /** @var array */
11
  public $currencies = array();
12
+ /** @var array */
13
  public $currency_codes = array();
14
 
15
+ /** @var string */
16
+ private $default_currency;
17
+ /** @var string */
18
  private $client_currency;
19
+ /** @var array */
20
  private $exchange_rates = array();
21
+ /** @var array */
22
  public $currencies_without_cents = array('JPY', 'TWD', 'KRW', 'BIF', 'BYR', 'CLP', 'GNF', 'ISK', 'KMF', 'PYG', 'RWF', 'VUV', 'XAF', 'XOF', 'XPF');
23
 
24
  /**
100
  add_action('wp_ajax_nopriv_wcml_switch_currency', array($this, 'switch_currency'));
101
  add_action('wp_ajax_wcml_switch_currency', array($this, 'switch_currency'));
102
  }
 
103
  }
104
 
105
  private function _load_filters(){
110
  }else{
111
  if(is_ajax() && $this->get_client_currency() != get_option('woocommerce_currency')){
112
 
113
+ $ajax_actions = apply_filters( 'wcml_multi_currency_ajax_actions',
114
  array(
115
  'woocommerce_get_refreshed_fragments',
116
  'woocommerce_update_order_review',
130
  }
131
  }
132
 
133
+ /**
134
+ * @deprecated 3.9.2
135
+ */
136
+ $load = apply_filters( 'wcml_load_multi_currency', $load );
137
+
138
+ $load = apply_filters( 'wcml_load_multi_currency_in_ajax', $load );
139
+
140
+ return $load;
141
  }
142
 
143
  public function init() {
159
  public function init_currencies(){
160
  global $sitepress;
161
 
162
+ $this->default_currency = get_option( 'woocommerce_currency' );
163
  $this->currencies =& $this->woocommerce_wpml->settings['currency_options'];
164
 
165
  // Add default currency if missing (set when MC is off)
166
+ if( !empty( $this->default_currency ) && !isset( $this->currencies[ $this->default_currency ] ) ){
167
+ $this->currencies[ $this->default_currency ] = array();
 
168
  }
169
 
170
  $save_to_db = false;
237
  }
238
 
239
  // force disable multi-currency when the default currency is empty
240
+ if( empty( $this->default_currency ) ){
241
  $this->woocommerce_wpml->settings['enable_multi_currency'] = WCML_MULTI_CURRENCIES_DISABLED;
242
  }
243
 
244
  }
245
 
246
+ /**
247
+ *
248
+ * @since 3.9.2
249
+ * @return string
250
+ */
251
+ public function get_default_currency(){
252
+ return $this->default_currency;
253
+ }
254
+
255
  public function get_currencies( $include_default = false ){
256
 
257
  // by default, exclude default currency
inc/installer-loader.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $installer_path = 'embedded/otgs/installer';
3
  if( file_exists( WCML_PLUGIN_PATH . '/' . $installer_path . '/loader.php' ) ){
4
 
5
  include WCML_PLUGIN_PATH . '/' . $installer_path . '/loader.php' ;
1
  <?php
2
+ $installer_path = 'vendor/otgs/installer';
3
  if( file_exists( WCML_PLUGIN_PATH . '/' . $installer_path . '/loader.php' ) ){
4
 
5
  include WCML_PLUGIN_PATH . '/' . $installer_path . '/loader.php' ;
inc/template-classes/class-wcml-menus-wrap.php CHANGED
@@ -215,7 +215,7 @@ class WCML_Menus_Wrap extends WPML_Templates_Factory {
215
  break;
216
 
217
  case 'multi-currency':
218
- if( current_user_can('wpml_manage_woocommerce_multilingual') ){
219
  $wcml_mc_ui = new WCML_Multi_Currency_UI( $woocommerce_wpml, $sitepress );
220
  $content = $wcml_mc_ui->get_view();
221
  }
215
  break;
216
 
217
  case 'multi-currency':
218
+ if( current_user_can('wpml_operate_woocommerce_multilingual') ){
219
  $wcml_mc_ui = new WCML_Multi_Currency_UI( $woocommerce_wpml, $sitepress );
220
  $content = $wcml_mc_ui->get_view();
221
  }
inc/translation-editor/class-wcml-editor-ui-product-job.php CHANGED
@@ -299,9 +299,9 @@ class WCML_Editor_UI_Product_Job extends WPML_Editor_UI_Job {
299
 
300
  if( !empty( $variations ) ){
301
  foreach( $variations as $variation ){
302
- $element_data[ 'variation_desc'.$variation[ 'variation_id' ] ] = array( 'original' => strip_tags( $variation[ 'variation_description' ] ) );
303
  $translated_variation_id = apply_filters( 'translate_object_id', $variation[ 'variation_id' ], 'product_variation', false, $this->get_target_language() );
304
- $element_data[ 'variation_desc'.$variation[ 'variation_id' ] ][ 'translation' ] = $translated_variation_id ? get_post_meta( $translated_variation_id, '_variation_description', true ) : '';
305
 
306
  $element_data = $this->add_custom_field_to_element_data( $element_data, $variation[ 'variation_id' ], $translated_variation_id, true );
307
  }
299
 
300
  if( !empty( $variations ) ){
301
  foreach( $variations as $variation ){
302
+ $element_data[ '_variation_description'.$variation[ 'variation_id' ] ] = array( 'original' => strip_tags( $variation[ 'variation_description' ] ) );
303
  $translated_variation_id = apply_filters( 'translate_object_id', $variation[ 'variation_id' ], 'product_variation', false, $this->get_target_language() );
304
+ $element_data[ '_variation_description'.$variation[ 'variation_id' ] ][ 'translation' ] = $translated_variation_id ? get_post_meta( $translated_variation_id, '_variation_description', true ) : '';
305
 
306
  $element_data = $this->add_custom_field_to_element_data( $element_data, $variation[ 'variation_id' ], $translated_variation_id, true );
307
  }
inc/translation-editor/class-wcml-synchronize-variations-data.php CHANGED
@@ -158,8 +158,8 @@ class WCML_Synchronize_Variations_Data{
158
  //sync file_paths
159
  $this->woocommerce_wpml->downloadable->sync_files_to_translations( $original_variation_id, $variation_id, $data );
160
  //sync description
161
- if( isset( $data[ md5( 'variation_desc'.$original_variation_id ) ] ) ){
162
- update_post_meta( $variation_id, '_variation_description', $data[ md5( 'variation_desc'.$original_variation_id ) ] );
163
  }
164
  // sync taxonomies
165
  if ( !empty( $all_taxs ) ) {
158
  //sync file_paths
159
  $this->woocommerce_wpml->downloadable->sync_files_to_translations( $original_variation_id, $variation_id, $data );
160
  //sync description
161
+ if( isset( $data[ md5( '_variation_description'.$original_variation_id ) ] ) ){
162
+ update_post_meta( $variation_id, '_variation_description', $data[ md5( '_variation_description'.$original_variation_id ) ] );
163
  }
164
  // sync taxonomies
165
  if ( !empty( $all_taxs ) ) {
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.1.1
9
 
10
  Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
11
 
@@ -142,6 +142,14 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
142
 
143
  == Changelog ==
144
 
 
 
 
 
 
 
 
 
145
  = 3.9.1.1 =
146
  * Bug fix: Fixed a bug causing fatal error on older PHP versions (before 5.6)
147
 
@@ -420,7 +428,7 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
420
  * Bug fix: After a product translation was edited in the standard product editor, the WooCommerce custom attribute translations were lost
421
  * Bug fix: The product variations failed to sync when the term_id was different than the term_taxonomy_id for the terms used to create the variations
422
  * Bug fix: Some product translations were showing non existing discounted prices
423
- * Fixed a couple of compatibility issues with WooCommerce Product Bundles (e.g. with using the Flatsome theme)
424
  * Fixed a small usability issue related to Sensei
425
  * Bug fix: Stock quantity not synchronized when items were used in orders created in the backend
426
  * Bug fix: Payment gateways strings were not registered for string translation
@@ -454,7 +462,7 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
454
  * Bug fix: The product category template was not working correctly in secondary languages
455
  * Bug fix: Fixed a problem with sanitize_title for variations in Danish and German
456
  * Moved the Tab manager settings to separate file from the WCML config
457
- * Duplicates for media are now being created, if missing, when product translations are created.
458
  * Bug fix: Fixed a fatal error that was occurring when the WPML was not updated to version 3.2 while the WPML addons were updated to the latest versions.
459
 
460
  = 3.6.1 =
@@ -681,7 +689,7 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
681
  * Bug: Emails not sent in the correct language when uses bulk action on orders list page
682
  * Bug: Order notes email in wrong language in certain circumstances
683
  * Bug: Shipping method names are being registered in the wrong language
684
- * Bug: WooCommerce Multilingual menu doesn't display for translators
685
  * Bug: Using 'category' for products cat slug conflicts with posts 'category'
686
  * Bug: Paypal rejects payments with decimals on certain currencies
687
 
@@ -717,7 +725,7 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
717
 
718
  = 3.0 =
719
  * Brand new GUI and workflow
720
- * Support for easy taxonomy translation
721
  * Variations synchronization
722
  * Product images synchronization
723
 
@@ -806,7 +814,7 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
806
  * Fixed all custom fields synchronization between translations
807
  * Fixed the stock issue for translations
808
  * Fixed the price filter widget for multiple currencies feature
809
- * Fixed product duplication to a second language
810
  * Payment gateways texts now are translatable
811
  * Custom variables translations now will be shown in the correct language
812
 
@@ -820,7 +828,7 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
820
 
821
  = 1.1 =
822
  * Added multi-currency feature
823
- * Fixed synchronization of attributes and variations
824
  * Fixed translation of attributes
825
  * Fixed JS error in the checkout page
826
  * Fixed enable guest checkout (no account required) issue
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
 
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
148
+ * Bug fix: Translations for variaiton descriptions were not saved correctly
149
+ * Bug fix: New order emails sent to admins included incorrectly translated strings
150
+ * Bug fix: A fatal error was occurring when upgrading from WooCommerce Multilingual 3.3 (or older)
151
+ * Product add-on titles were missing from order pages and emails
152
+
153
  = 3.9.1.1 =
154
  * Bug fix: Fixed a bug causing fatal error on older PHP versions (before 5.6)
155
 
428
  * Bug fix: After a product translation was edited in the standard product editor, the WooCommerce custom attribute translations were lost
429
  * Bug fix: The product variations failed to sync when the term_id was different than the term_taxonomy_id for the terms used to create the variations
430
  * Bug fix: Some product translations were showing non existing discounted prices
431
+ * Fixed a couple of compatibility issues with WooCommerce Product Bundles (e.g. with using the Flatsome theme)
432
  * Fixed a small usability issue related to Sensei
433
  * Bug fix: Stock quantity not synchronized when items were used in orders created in the backend
434
  * Bug fix: Payment gateways strings were not registered for string translation
462
  * Bug fix: The product category template was not working correctly in secondary languages
463
  * Bug fix: Fixed a problem with sanitize_title for variations in Danish and German
464
  * Moved the Tab manager settings to separate file from the WCML config
465
+ * Duplicates for media are now being created, if missing, when product translations are created.
466
  * Bug fix: Fixed a fatal error that was occurring when the WPML was not updated to version 3.2 while the WPML addons were updated to the latest versions.
467
 
468
  = 3.6.1 =
689
  * Bug: Emails not sent in the correct language when uses bulk action on orders list page
690
  * Bug: Order notes email in wrong language in certain circumstances
691
  * Bug: Shipping method names are being registered in the wrong language
692
+ * Bug: WooCommerce Multilingual menu doesn't display for translators
693
  * Bug: Using 'category' for products cat slug conflicts with posts 'category'
694
  * Bug: Paypal rejects payments with decimals on certain currencies
695
 
725
 
726
  = 3.0 =
727
  * Brand new GUI and workflow
728
+ * Support for easy taxonomy translation
729
  * Variations synchronization
730
  * Product images synchronization
731
 
814
  * Fixed all custom fields synchronization between translations
815
  * Fixed the stock issue for translations
816
  * Fixed the price filter widget for multiple currencies feature
817
+ * Fixed product duplication to a second language
818
  * Payment gateways texts now are translatable
819
  * Custom variables translations now will be shown in the correct language
820
 
828
 
829
  = 1.1 =
830
  * Added multi-currency feature
831
+ * Fixed synchronization of attributes and variations
832
  * Fixed translation of attributes
833
  * Fixed JS error in the checkout page
834
  * Fixed enable guest checkout (no account required) issue
templates/menus-wrap.twig CHANGED
@@ -28,9 +28,9 @@
28
 
29
  {% if can_manage_options %}
30
  <a class="nav-tab {{ menu.settings.active }}" href="{{ menu.settings.url }}">{{ menu.settings.name }}</a>
31
- <a class="nav-tab {{ menu.multi_currency.active }}" href="{{ menu.multi_currency.url }}">{{ menu.multi_currency.name }}</a>
32
  {% endif %}
33
  {% if can_operate_options %}
 
34
  <a class="nav-tab {{ menu.slugs.active }}" href="{{ menu.slugs.url }}">{{ menu.slugs.name }}</a>
35
  {% endif %}
36
  {% if can_manage_options %}
28
 
29
  {% if can_manage_options %}
30
  <a class="nav-tab {{ menu.settings.active }}" href="{{ menu.settings.url }}">{{ menu.settings.name }}</a>
 
31
  {% endif %}
32
  {% if can_operate_options %}
33
+ <a class="nav-tab {{ menu.multi_currency.active }}" href="{{ menu.multi_currency.url }}">{{ menu.multi_currency.name }}</a>
34
  <a class="nav-tab {{ menu.slugs.active }}" href="{{ menu.slugs.url }}">{{ menu.slugs.name }}</a>
35
  {% endif %}
36
  {% if can_manage_options %}
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitea5526f224e4d65c1f284250e90538a6::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitc30053a51ee5263452335210f259eb3c::getLoader();
vendor/autoload_52.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
- return ComposerAutoloaderInit722263f42137f6d10769c87c0c845ff7::getLoader();
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
+ return ComposerAutoloaderInit6b46ab8ff4e2eb9c99174b776d4d0c14::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -62,6 +62,7 @@ return array(
62
  'WCML_Multi_Currency_Reports' => $baseDir . '/inc/currencies/class-wcml-multi-currency-reports.php',
63
  'WCML_Multi_Currency_Resources' => $baseDir . '/inc/currencies/class-wcml-multi-currency-resources.php',
64
  'WCML_Multi_Currency_Shipping' => $baseDir . '/inc/currencies/class-wcml-multi-currency-shipping.php',
 
65
  'WCML_Multi_Currency_Table_Rate_Shipping' => $baseDir . '/inc/currencies/class-wcml-multi-currency-table-rate-shipping.php',
66
  'WCML_Multi_Currency_UI' => $baseDir . '/inc/template-classes/multi-currency/class-wcml-multi-currency-ui.php',
67
  'WCML_Not_Translatable_Attributes' => $baseDir . '/inc/template-classes/class-wcml-not-translatable-attributes.php',
62
  'WCML_Multi_Currency_Reports' => $baseDir . '/inc/currencies/class-wcml-multi-currency-reports.php',
63
  'WCML_Multi_Currency_Resources' => $baseDir . '/inc/currencies/class-wcml-multi-currency-resources.php',
64
  'WCML_Multi_Currency_Shipping' => $baseDir . '/inc/currencies/class-wcml-multi-currency-shipping.php',
65
+ 'WCML_Multi_Currency_Shipping_Legacy' => $baseDir . '/inc/currencies/class-wcml-multi-currency-shipping-legacy.php',
66
  'WCML_Multi_Currency_Table_Rate_Shipping' => $baseDir . '/inc/currencies/class-wcml-multi-currency-table-rate-shipping.php',
67
  'WCML_Multi_Currency_UI' => $baseDir . '/inc/template-classes/multi-currency/class-wcml-multi-currency-ui.php',
68
  'WCML_Not_Translatable_Attributes' => $baseDir . '/inc/template-classes/class-wcml-not-translatable-attributes.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitea5526f224e4d65c1f284250e90538a6
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInitea5526f224e4d65c1f284250e90538a6
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) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitc30053a51ee5263452335210f259eb3c
6
  {
7
  private static $loader;
8
 
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) {
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 ComposerAutoloaderInit722263f42137f6d10769c87c0c845ff7 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit722263f42137f6d10769c87c0c845ff7 {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit722263f42137f6d10769c87c0c845ff7', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit722263f42137f6d10769c87c0c845ff7', '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 ComposerAutoloaderInit6b46ab8ff4e2eb9c99174b776d4d0c14 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
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);
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitea5526f224e4d65c1f284250e90538a6
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'C' =>
@@ -87,6 +87,7 @@ class ComposerStaticInitea5526f224e4d65c1f284250e90538a6
87
  'WCML_Multi_Currency_Reports' => __DIR__ . '/../..' . '/inc/currencies/class-wcml-multi-currency-reports.php',
88
  'WCML_Multi_Currency_Resources' => __DIR__ . '/../..' . '/inc/currencies/class-wcml-multi-currency-resources.php',
89
  'WCML_Multi_Currency_Shipping' => __DIR__ . '/../..' . '/inc/currencies/class-wcml-multi-currency-shipping.php',
 
90
  'WCML_Multi_Currency_Table_Rate_Shipping' => __DIR__ . '/../..' . '/inc/currencies/class-wcml-multi-currency-table-rate-shipping.php',
91
  'WCML_Multi_Currency_UI' => __DIR__ . '/../..' . '/inc/template-classes/multi-currency/class-wcml-multi-currency-ui.php',
92
  'WCML_Not_Translatable_Attributes' => __DIR__ . '/../..' . '/inc/template-classes/class-wcml-not-translatable-attributes.php',
@@ -154,10 +155,10 @@ class ComposerStaticInitea5526f224e4d65c1f284250e90538a6
154
  public static function getInitializer(ClassLoader $loader)
155
  {
156
  return \Closure::bind(function () use ($loader) {
157
- $loader->prefixLengthsPsr4 = ComposerStaticInitea5526f224e4d65c1f284250e90538a6::$prefixLengthsPsr4;
158
- $loader->prefixDirsPsr4 = ComposerStaticInitea5526f224e4d65c1f284250e90538a6::$prefixDirsPsr4;
159
- $loader->prefixesPsr0 = ComposerStaticInitea5526f224e4d65c1f284250e90538a6::$prefixesPsr0;
160
- $loader->classMap = ComposerStaticInitea5526f224e4d65c1f284250e90538a6::$classMap;
161
 
162
  }, null, ClassLoader::class);
163
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitc30053a51ee5263452335210f259eb3c
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'C' =>
87
  'WCML_Multi_Currency_Reports' => __DIR__ . '/../..' . '/inc/currencies/class-wcml-multi-currency-reports.php',
88
  'WCML_Multi_Currency_Resources' => __DIR__ . '/../..' . '/inc/currencies/class-wcml-multi-currency-resources.php',
89
  'WCML_Multi_Currency_Shipping' => __DIR__ . '/../..' . '/inc/currencies/class-wcml-multi-currency-shipping.php',
90
+ 'WCML_Multi_Currency_Shipping_Legacy' => __DIR__ . '/../..' . '/inc/currencies/class-wcml-multi-currency-shipping-legacy.php',
91
  'WCML_Multi_Currency_Table_Rate_Shipping' => __DIR__ . '/../..' . '/inc/currencies/class-wcml-multi-currency-table-rate-shipping.php',
92
  'WCML_Multi_Currency_UI' => __DIR__ . '/../..' . '/inc/template-classes/multi-currency/class-wcml-multi-currency-ui.php',
93
  'WCML_Not_Translatable_Attributes' => __DIR__ . '/../..' . '/inc/template-classes/class-wcml-not-translatable-attributes.php',
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
  }
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.1.1
10
  */
11
 
12
  if( defined( 'WCML_VERSION' ) ) return;
13
 
14
- define( 'WCML_VERSION', '3.9.1.1' );
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.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' );