WooCommerce Multilingual – run WooCommerce with WPML - Version 4.2.6

Version Description

  • WooCommerce Tab Manager categories aren't copied to translated tabs
  • Endpoint translation issue when submitting a job post on secondary languages [WP Job Manager]
  • After changing the payment method, the information is sent incorrectly in the email
  • WooCommerce Subscriptions plugin fatal error on the secondary language
  • Fix for Woocommerce Dynamic Pricing
  • WooCommerce subscriptions > Manually set sign-up fee is not respected
  • WoooCommerce Subscriptions -> changing currency and re-subscribing produces wrong price in the cart
  • Total sales not synced when not managing stocks
  • Adding to cart German product with custom attribute results in improper sanitized custom attribute name after the action is complete
  • WooCommerce Multilingual Translation editor -> Missing Custom Field label
  • WooCommerce Product Add-ons - Admin edit global addon screen shows previous value for name/descripton after update
  • Filtering by variation does not work for product bundle
  • Fix responsiveness of reset cart prompt
Download this release

Release Info

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

Code changes from version 4.2.5 to 4.2.6

Files changed (42) hide show
  1. changelog/4.2.5.md +4 -3
  2. changelog/4.2.6.md +16 -0
  3. classes/order-property-filter/class-wcml-payment-method-filter.php +7 -0
  4. compatibility/class-wcml-dynamic-pricing.php +1 -2
  5. compatibility/class-wcml-gravityforms.php +6 -0
  6. compatibility/class-wcml-product-addons.php +2 -1
  7. compatibility/class-wcml-product-bundles.php +42 -25
  8. compatibility/class-wcml-tab-manager.php +28 -0
  9. compatibility/class-wcml-wc-subscriptions.php +41 -3
  10. inc/admin-menus/class-wcml-setup.php +43 -5
  11. inc/class-wcml-attributes.php +3 -1
  12. inc/class-wcml-cart.php +67 -46
  13. inc/class-wcml-compatibility.php +1 -1
  14. inc/class-wcml-endpoints.php +2 -1
  15. inc/class-wcml-resources.php +16 -8
  16. inc/class-wcml-store-pages.php +2 -3
  17. inc/class-wcml-terms.php +2 -1
  18. inc/class-wcml-url-translation.php +1 -0
  19. inc/class-woocommerce-wpml.php +1 -0
  20. inc/template-classes/class-wcml-settings-ui.php +3 -1
  21. inc/template-classes/setup/class-wcml-setup-translation-options-ui.php +54 -0
  22. inc/translation-editor/class-wcml-editor-ui-product-job.php +3 -3
  23. inc/translation-editor/class-wcml-synchronize-product-data.php +28 -15
  24. inc/translation-editor/class-wcml-synchronize-variations-data.php +33 -0
  25. inc/translation-editor/class-wcml-translation-editor.php +32 -10
  26. readme.txt +18 -29
  27. res/js/scripts.js +0 -167
  28. res/js/scripts.min.js +1 -1
  29. res/js/taxonomy_translation.js +172 -0
  30. res/js/taxonomy_translation.min.js +1 -0
  31. res/js/trnsl_interface_dialog_warning.js +41 -0
  32. res/js/trnsl_interface_dialog_warning.min.js +1 -0
  33. templates/settings-ui.twig +6 -0
  34. templates/setup/translation-options.twig +24 -0
  35. vendor/autoload.php +1 -1
  36. vendor/autoload_52.php +1 -1
  37. vendor/composer/autoload_classmap.php +1 -0
  38. vendor/composer/autoload_real.php +4 -4
  39. vendor/composer/autoload_real_52.php +3 -3
  40. vendor/composer/autoload_static.php +6 -5
  41. wpml-config.xml +1 -0
  42. wpml-woocommerce.php +4 -4
changelog/4.2.5.md CHANGED
@@ -1,3 +1,6 @@
 
 
 
1
  # Fixes
2
  * [wcml-2196] Cannot update Purchase note (any other custom field) once the job is completed
3
  * [wcml-2189] New order admin emails have un-translated heading and subject when admin language is different of default
@@ -12,6 +15,4 @@
12
  * [wcml-2165] Un-trashing product results of redirect to post listing in WCML
13
  * [wcml-2161] Fix a bug that the price calculation is not correct in combination with WC Bookings and WC Deposit plugin
14
  * [wcml-2149] MaxStore Pro theme compatibility for mini cart
15
- * [wcml-2127] Product price was doubled on cart in combination with Booking and Product Addons
16
- # New filters
17
- * [wcml-2091] Added 'wcml_hide_cart_alert_dialog' filter to support hide cart alert switching dialog
1
+ # Features
2
+ * [wcml-2091] Added 'wcml_hide_cart_alert_dialog' filter to support hide cart alert switching dialog
3
+
4
  # Fixes
5
  * [wcml-2196] Cannot update Purchase note (any other custom field) once the job is completed
6
  * [wcml-2189] New order admin emails have un-translated heading and subject when admin language is different of default
15
  * [wcml-2165] Un-trashing product results of redirect to post listing in WCML
16
  * [wcml-2161] Fix a bug that the price calculation is not correct in combination with WC Bookings and WC Deposit plugin
17
  * [wcml-2149] MaxStore Pro theme compatibility for mini cart
18
+ * [wcml-2127] Product price was doubled on cart in combination with Booking and Product Addons
 
 
changelog/4.2.6.md ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Features
2
+ * [wcml-2162] WooCommerce Tab Manager categories aren't copied to translated tabs
3
+
4
+ # Fixes
5
+ * [wcml-2235] Endpoint translation issue when submitting a job post on secondary languages [WP Job Manager]
6
+ * [wcml-2233] After changing the payment method, the information is sent incorrectly in the email
7
+ * [wcml-2230] WooCommerce Subscriptions plugin fatal error on the secondary language
8
+ * [wcml-2224] Fix for Woocommerce Dynamic Pricing
9
+ * [wcml-2223] WooCommerce subscriptions > Manually set sign-up fee is not respected
10
+ * [wcml-2221] WoooCommerce Subscriptions -> changing currency and re-subscribing produces wrong price in the cart
11
+ * [wcml-2213] Total sales not synced when not managing stocks
12
+ * [wcml-2212] Adding to cart German product with custom attribute results in improper sanitized custom attribute name after the action is complete
13
+ * [wcml-2211] WooCommerce Multilingual Translation editor -> Missing Custom Field label
14
+ * [wcml-2209] WooCommerce Product Add-ons - Admin edit global addon screen shows previous value for name/descripton after update
15
+ * [wcml-2204] Filtering by variation does not work for product bundle
16
+ * [wcml-2199] Fix responsiveness of reset cart prompt
classes/order-property-filter/class-wcml-payment-method-filter.php CHANGED
@@ -15,6 +15,13 @@ class WCML_Payment_Method_Filter {
15
  if ( '_payment_method_title' === $meta_key && '' !== $title && $object_id && 'shop_order' === $this->get_post_type( $object_id ) ) {
16
  $payment_gateway = $this->get_payment_gateway( $object_id );
17
 
 
 
 
 
 
 
 
18
  if( $payment_gateway ){
19
  $title = icl_translate( 'woocommerce', $payment_gateway->id . '_gateway_title', $payment_gateway->title );
20
  }
15
  if ( '_payment_method_title' === $meta_key && '' !== $title && $object_id && 'shop_order' === $this->get_post_type( $object_id ) ) {
16
  $payment_gateway = $this->get_payment_gateway( $object_id );
17
 
18
+ if( isset( $_POST['payment_method'] ) && $payment_gateway->id !== $_POST['payment_method'] && WC()->payment_gateways() ){
19
+ $payment_gateways = WC()->payment_gateways->payment_gateways();
20
+ if( isset( $payment_gateways[ $_POST['payment_method'] ] ) ){
21
+ $payment_gateway = $payment_gateways[ $_POST['payment_method'] ];
22
+ }
23
+ }
24
+
25
  if( $payment_gateway ){
26
  $title = icl_translate( 'woocommerce', $payment_gateway->id . '_gateway_title', $payment_gateway->title );
27
  }
compatibility/class-wcml-dynamic-pricing.php CHANGED
@@ -19,9 +19,8 @@ class WCML_Dynamic_Pricing {
19
  ), 10, 2 );
20
  add_filter( 'dynamic_pricing_product_rules', array( $this, 'dynamic_pricing_product_rules' ) );
21
  add_filter( 'wcml_calculate_totals_exception', array( $this, 'calculate_totals_exception' ) );
22
- } else {
23
- add_filter( 'woocommerce_product_get__pricing_rules', array( $this, 'translate_variations_in_rules' ) );
24
  }
 
25
 
26
  }
27
 
19
  ), 10, 2 );
20
  add_filter( 'dynamic_pricing_product_rules', array( $this, 'dynamic_pricing_product_rules' ) );
21
  add_filter( 'wcml_calculate_totals_exception', array( $this, 'calculate_totals_exception' ) );
 
 
22
  }
23
+ add_filter( 'woocommerce_product_get__pricing_rules', array( $this, 'translate_variations_in_rules' ) );
24
 
25
  }
26
 
compatibility/class-wcml-gravityforms.php CHANGED
@@ -24,6 +24,12 @@ class WCML_gravityforms{
24
  }
25
 
26
  function sync_gf_data($original_product_id, $trnsl_product_id, $data){
 
 
 
 
 
 
27
  $orig_gf = maybe_unserialize( get_post_meta( $original_product_id, '_gravity_form_data' , true ) );
28
  $trnsl_gf = maybe_unserialize( get_post_meta( $trnsl_product_id, '_gravity_form_data' , true ) );
29
 
24
  }
25
 
26
  function sync_gf_data($original_product_id, $trnsl_product_id, $data){
27
+ // sync only if WCML editor is in use
28
+ $wcml_settings = get_option('_wcml_settings');
29
+ if ($wcml_settings['trnsl_interface'] != 1) {
30
+ return;
31
+ }
32
+
33
  $orig_gf = maybe_unserialize( get_post_meta( $original_product_id, '_gravity_form_data' , true ) );
34
  $trnsl_gf = maybe_unserialize( get_post_meta( $trnsl_product_id, '_gravity_form_data' , true ) );
35
 
compatibility/class-wcml-product-addons.php CHANGED
@@ -30,7 +30,6 @@ class WCML_Product_Addons {
30
 
31
  add_action( 'updated_post_meta', array( $this, 'register_addons_strings' ), 10, 4 );
32
  add_action( 'added_post_meta', array( $this, 'register_addons_strings' ), 10, 4 );
33
- add_filter( 'get_post_metadata', array( $this, 'translate_addons_strings' ), 10, 4 );
34
 
35
  global $pagenow;
36
  if ( 'edit.php' === $pagenow &&
@@ -54,6 +53,8 @@ class WCML_Product_Addons {
54
  add_action( 'woocommerce_product_data_panels', array( $this, 'show_pointer_info' ) );
55
 
56
  add_filter( 'wcml_do_not_display_custom_fields_for_product', array( $this, 'replace_tm_editor_custom_fields_with_own_sections' ) );
 
 
57
  }
58
 
59
  add_filter( 'wcml_cart_contents_not_changed', array(
30
 
31
  add_action( 'updated_post_meta', array( $this, 'register_addons_strings' ), 10, 4 );
32
  add_action( 'added_post_meta', array( $this, 'register_addons_strings' ), 10, 4 );
 
33
 
34
  global $pagenow;
35
  if ( 'edit.php' === $pagenow &&
53
  add_action( 'woocommerce_product_data_panels', array( $this, 'show_pointer_info' ) );
54
 
55
  add_filter( 'wcml_do_not_display_custom_fields_for_product', array( $this, 'replace_tm_editor_custom_fields_with_own_sections' ) );
56
+ }else{
57
+ add_filter( 'get_post_metadata', array( $this, 'translate_addons_strings' ), 10, 4 );
58
  }
59
 
60
  add_filter( 'wcml_cart_contents_not_changed', array(
compatibility/class-wcml-product-bundles.php CHANGED
@@ -22,14 +22,20 @@ class WCML_Product_Bundles {
22
  */
23
  private $product_bundles_items;
24
 
 
 
 
 
 
25
  /**
26
  * WCML_Product_Bundles constructor.
27
  */
28
- function __construct( &$sitepress, &$woocommerce_wpml, &$product_bundles_items ) {
29
 
30
  $this->sitepress = $sitepress;
31
  $this->woocommerce_wpml = $woocommerce_wpml;
32
  $this->product_bundles_items = $product_bundles_items;
 
33
 
34
  add_action( 'woocommerce_get_cart_item_from_session', array( $this, 'resync_bundle' ), 5, 3 );
35
  add_filter( 'woocommerce_cart_loaded_from_session', array( $this, 'resync_bundle_clean' ), 10 );
@@ -88,7 +94,7 @@ class WCML_Product_Bundles {
88
 
89
  }
90
 
91
- private function sync_product_bundle_meta( $bundle_id, $translated_bundle_id ) {
92
 
93
  $bundle_items = $this->product_bundles_items->get_items( $bundle_id );
94
  $fields_to_sync = array(
@@ -104,7 +110,11 @@ class WCML_Product_Bundles {
104
  'order_visibility',
105
  'single_product_price_visibility',
106
  'cart_price_visibility',
107
- 'order_price_visibility'
 
 
 
 
108
  );
109
 
110
  $target_lang = $this->sitepress->get_language_for_element( $translated_bundle_id, 'post_product' );
@@ -122,6 +132,18 @@ class WCML_Product_Bundles {
122
  foreach ( $fields_to_sync as $key ) {
123
  $this->product_bundles_items->update_item_meta( $translated_item, $key, $item_meta[ $key ] );
124
  }
 
 
 
 
 
 
 
 
 
 
 
 
125
  $this->product_bundles_items->save_item_meta( $translated_item );
126
 
127
  }
@@ -181,17 +203,15 @@ class WCML_Product_Bundles {
181
  }
182
 
183
  private function get_product_id_for_item_id( $item_id ) {
184
- global $wpdb;
185
 
186
- return $wpdb->get_var( $wpdb->prepare(
187
- "SELECT product_id FROM {$wpdb->prefix}woocommerce_bundled_items WHERE bundled_item_id=%d", $item_id ) );
188
  }
189
 
190
  private function get_item_id_for_product_id( $product_id, $bundle_id ) {
191
- global $wpdb;
192
 
193
- return $wpdb->get_var( $wpdb->prepare(
194
- "SELECT bundled_item_id FROM {$wpdb->prefix}woocommerce_bundled_items WHERE product_id=%d AND bundle_id=%d",
195
  $product_id, $bundle_id
196
  ) );
197
  }
@@ -341,7 +361,6 @@ class WCML_Product_Bundles {
341
 
342
  // Update Bundled products title and description after saving the translation
343
  public function bundle_update( $bundle_id, $translated_bundle_id, $data, $lang ) {
344
- global $wpdb;
345
 
346
  $bundle_data = $this->get_product_bundle_data( $bundle_id );
347
  $translated_bundle_data = $this->get_product_bundle_data( $translated_bundle_id );
@@ -350,8 +369,8 @@ class WCML_Product_Bundles {
350
  return;
351
  }
352
 
353
- $translate_bundled_item_ids = $wpdb->get_col( $wpdb->prepare(
354
- "SELECT product_id FROM {$wpdb->prefix}woocommerce_bundled_items WHERE bundle_id = %d", $translated_bundle_id ) );
355
 
356
  foreach ( $bundle_data as $item_id => $bundle_item_data ) {
357
 
@@ -362,12 +381,12 @@ class WCML_Product_Bundles {
362
 
363
  if ( ! in_array( $translated_product_id, $translate_bundled_item_ids ) ) {
364
 
365
- $menu_order = $wpdb->get_var( $wpdb->prepare( "
366
- SELECT menu_order FROM {$wpdb->prefix}woocommerce_bundled_items
367
  WHERE bundle_id=%d AND product_id=%d
368
  ", $bundle_id, $bundle_item_data['product_id'] ) );
369
 
370
- $wpdb->insert( $wpdb->prefix . 'woocommerce_bundled_items',
371
  array(
372
  'product_id' => $translated_product_id,
373
  'bundle_id' => $translated_bundle_id,
@@ -415,7 +434,6 @@ class WCML_Product_Bundles {
415
 
416
  // Sync product bundle data with translated values when the product is duplicated
417
  public function sync_bundled_ids( $bundle_id, $translated_bundle_id ) {
418
- global $wpdb;
419
 
420
  $bundle_data = $this->get_product_bundle_data( $bundle_id );
421
  if ( $bundle_data ) {
@@ -431,19 +449,19 @@ class WCML_Product_Bundles {
431
 
432
  $translated_item_id = $this->get_item_id_for_product_id( $translated_product_id, $translated_bundle_id );
433
  if ( ! $translated_item_id ) {
434
- $menu_order = $wpdb->get_var( $wpdb->prepare( "
435
- SELECT menu_order FROM {$wpdb->prefix}woocommerce_bundled_items
436
  WHERE bundle_id=%d AND product_id=%d
437
  ", $bundle_id, $product_id ) );
438
 
439
- $wpdb->insert( $wpdb->prefix . 'woocommerce_bundled_items',
440
  array(
441
  'product_id' => $translated_product_id,
442
  'bundle_id' => $translated_bundle_id,
443
  'menu_order' => $menu_order,
444
  )
445
  );
446
- $translated_item_id = $wpdb->insert_id;
447
  }
448
 
449
  $translated_bundle_data[ $translated_item_id ] = $product_data;
@@ -632,13 +650,12 @@ class WCML_Product_Bundles {
632
  }
633
 
634
  private function add_product_to_bundle( $product_id, $bundle_id, $original_bundle_id, $original_product_id ) {
635
- global $wpdb;
636
- $menu_order = $wpdb->get_var( $wpdb->prepare( "
637
- SELECT menu_order FROM {$wpdb->prefix}woocommerce_bundled_items
638
  WHERE bundle_id=%d AND product_id=%d
639
  ", $original_bundle_id, $original_product_id ) );
640
 
641
- $wpdb->insert( $wpdb->prefix . 'woocommerce_bundled_items',
642
  array(
643
  'product_id' => $product_id,
644
  'bundle_id' => $bundle_id,
@@ -646,7 +663,7 @@ class WCML_Product_Bundles {
646
  )
647
  );
648
 
649
- return $wpdb->insert_id;
650
  }
651
 
652
  /**
22
  */
23
  private $product_bundles_items;
24
 
25
+ /**
26
+ * @var wpdb
27
+ */
28
+ private $wpdb;
29
+
30
  /**
31
  * WCML_Product_Bundles constructor.
32
  */
33
+ function __construct( SitePress $sitepress, woocommerce_wpml $woocommerce_wpml, $product_bundles_items, wpdb $wpdb ) {
34
 
35
  $this->sitepress = $sitepress;
36
  $this->woocommerce_wpml = $woocommerce_wpml;
37
  $this->product_bundles_items = $product_bundles_items;
38
+ $this->wpdb = $wpdb;
39
 
40
  add_action( 'woocommerce_get_cart_item_from_session', array( $this, 'resync_bundle' ), 5, 3 );
41
  add_filter( 'woocommerce_cart_loaded_from_session', array( $this, 'resync_bundle_clean' ), 10 );
94
 
95
  }
96
 
97
+ public function sync_product_bundle_meta( $bundle_id, $translated_bundle_id ) {
98
 
99
  $bundle_items = $this->product_bundles_items->get_items( $bundle_id );
100
  $fields_to_sync = array(
110
  'order_visibility',
111
  'single_product_price_visibility',
112
  'cart_price_visibility',
113
+ 'order_price_visibility',
114
+ 'discount',
115
+ 'override_variations',
116
+ 'override_default_variation_attributes',
117
+ 'hide_filtered_variations'
118
  );
119
 
120
  $target_lang = $this->sitepress->get_language_for_element( $translated_bundle_id, 'post_product' );
132
  foreach ( $fields_to_sync as $key ) {
133
  $this->product_bundles_items->update_item_meta( $translated_item, $key, $item_meta[ $key ] );
134
  }
135
+
136
+
137
+ if( isset( $item_meta['allowed_variations'] ) ){
138
+ if( is_array( $item_meta['allowed_variations'] ) ){
139
+ $allowed_variations =
140
+ $this->translate_allowed_variations( $item_meta['allowed_variations'], $target_lang );
141
+ $this->product_bundles_items->update_item_meta( $translated_item, 'allowed_variations', $allowed_variations );
142
+ }else{
143
+ $this->product_bundles_items->update_item_meta( $translated_item, 'allowed_variations', $item_meta['allowed_variations'] );
144
+ }
145
+ }
146
+
147
  $this->product_bundles_items->save_item_meta( $translated_item );
148
 
149
  }
203
  }
204
 
205
  private function get_product_id_for_item_id( $item_id ) {
 
206
 
207
+ return $this->wpdb->get_var( $this->wpdb->prepare(
208
+ "SELECT product_id FROM {$this->wpdb->prefix}woocommerce_bundled_items WHERE bundled_item_id=%d", $item_id ) );
209
  }
210
 
211
  private function get_item_id_for_product_id( $product_id, $bundle_id ) {
 
212
 
213
+ return $this->wpdb->get_var( $this->wpdb->prepare(
214
+ "SELECT bundled_item_id FROM {$this->wpdb->prefix}woocommerce_bundled_items WHERE product_id=%d AND bundle_id=%d",
215
  $product_id, $bundle_id
216
  ) );
217
  }
361
 
362
  // Update Bundled products title and description after saving the translation
363
  public function bundle_update( $bundle_id, $translated_bundle_id, $data, $lang ) {
 
364
 
365
  $bundle_data = $this->get_product_bundle_data( $bundle_id );
366
  $translated_bundle_data = $this->get_product_bundle_data( $translated_bundle_id );
369
  return;
370
  }
371
 
372
+ $translate_bundled_item_ids = $this->wpdb->get_col( $this->wpdb->prepare(
373
+ "SELECT product_id FROM {$this->wpdb->prefix}woocommerce_bundled_items WHERE bundle_id = %d", $translated_bundle_id ) );
374
 
375
  foreach ( $bundle_data as $item_id => $bundle_item_data ) {
376
 
381
 
382
  if ( ! in_array( $translated_product_id, $translate_bundled_item_ids ) ) {
383
 
384
+ $menu_order = $this->wpdb->get_var( $this->wpdb->prepare( "
385
+ SELECT menu_order FROM {$this->wpdb->prefix}woocommerce_bundled_items
386
  WHERE bundle_id=%d AND product_id=%d
387
  ", $bundle_id, $bundle_item_data['product_id'] ) );
388
 
389
+ $this->wpdb->insert( $this->wpdb->prefix . 'woocommerce_bundled_items',
390
  array(
391
  'product_id' => $translated_product_id,
392
  'bundle_id' => $translated_bundle_id,
434
 
435
  // Sync product bundle data with translated values when the product is duplicated
436
  public function sync_bundled_ids( $bundle_id, $translated_bundle_id ) {
 
437
 
438
  $bundle_data = $this->get_product_bundle_data( $bundle_id );
439
  if ( $bundle_data ) {
449
 
450
  $translated_item_id = $this->get_item_id_for_product_id( $translated_product_id, $translated_bundle_id );
451
  if ( ! $translated_item_id ) {
452
+ $menu_order = $this->wpdb->get_var( $this->wpdb->prepare( "
453
+ SELECT menu_order FROM {$this->wpdb->prefix}woocommerce_bundled_items
454
  WHERE bundle_id=%d AND product_id=%d
455
  ", $bundle_id, $product_id ) );
456
 
457
+ $this->wpdb->insert( $this->wpdb->prefix . 'woocommerce_bundled_items',
458
  array(
459
  'product_id' => $translated_product_id,
460
  'bundle_id' => $translated_bundle_id,
461
  'menu_order' => $menu_order,
462
  )
463
  );
464
+ $translated_item_id = $this->wpdb->insert_id;
465
  }
466
 
467
  $translated_bundle_data[ $translated_item_id ] = $product_data;
650
  }
651
 
652
  private function add_product_to_bundle( $product_id, $bundle_id, $original_bundle_id, $original_product_id ) {
653
+ $menu_order = $this->wpdb->get_var( $this->wpdb->prepare( "
654
+ SELECT menu_order FROM {$this->wpdb->prefix}woocommerce_bundled_items
 
655
  WHERE bundle_id=%d AND product_id=%d
656
  ", $original_bundle_id, $original_product_id ) );
657
 
658
+ $this->wpdb->insert( $this->wpdb->prefix . 'woocommerce_bundled_items',
659
  array(
660
  'product_id' => $product_id,
661
  'bundle_id' => $bundle_id,
663
  )
664
  );
665
 
666
+ return $this->wpdb->insert_id;
667
  }
668
 
669
  /**
compatibility/class-wcml-tab-manager.php CHANGED
@@ -70,6 +70,9 @@ class WCML_Tab_Manager {
70
 
71
  add_filter( 'wcml_do_not_display_custom_fields_for_product', array( $this, 'replace_tm_editor_custom_fields_with_own_sections' ) );
72
 
 
 
 
73
  }else{
74
  add_filter( 'option_wc_tab_manager_default_layout', array( $this, 'filter_default_layout' ) );
75
  }
@@ -729,4 +732,29 @@ class WCML_Tab_Manager {
729
  return $fields;
730
  }
731
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
732
  }
70
 
71
  add_filter( 'wcml_do_not_display_custom_fields_for_product', array( $this, 'replace_tm_editor_custom_fields_with_own_sections' ) );
72
 
73
+ add_filter( 'wpml_duplicate_custom_fields_exceptions', array( $this, 'duplicate_categories_exception' ) );
74
+ add_action( 'wpml_after_copy_custom_field', array( $this, 'translate_categories' ), 10, 3 );
75
+
76
  }else{
77
  add_filter( 'option_wc_tab_manager_default_layout', array( $this, 'filter_default_layout' ) );
78
  }
732
  return $fields;
733
  }
734
 
735
+ function duplicate_categories_exception( $fields ) {
736
+ $fields[] = '_wc_tab_categories';
737
+
738
+ return $fields;
739
+ }
740
+
741
+ function translate_categories( $post_id_from, $post_id_to, $meta_key ) {
742
+ if ( '_wc_tab_categories' === $meta_key ) {
743
+ // Saving has already been processed, remove nonce so that we dont
744
+ // process translations too (which would overwrite _wc_tab_categories.
745
+ unset( $_POST['wc_tab_manager_metabox_nonce'] );
746
+
747
+ $args = array('element_id' => $post_id_to, 'element_type' => 'wc_product_tab' );
748
+ $language = apply_filters( 'wpml_element_language_code', false, $args );
749
+
750
+ $categories = array();
751
+ $meta_value = get_post_meta( $post_id_from, $meta_key, true );
752
+ foreach ( $meta_value as $category ) {
753
+ $categories[] = apply_filters( 'wpml_object_id', $category, 'product_cat', true, $language );
754
+ }
755
+
756
+ update_post_meta( $post_id_to, $meta_key, $categories, $meta_value );
757
+ }
758
+ }
759
+
760
  }
compatibility/class-wcml-wc-subscriptions.php CHANGED
@@ -43,16 +43,36 @@ class WCML_WC_Subscriptions{
43
 
44
  function init(){
45
  if( !is_admin() ){
46
- add_filter('woocommerce_subscriptions_product_sign_up_fee', array($this, 'product_price_filter'), 10, 2);
 
 
 
47
 
48
  add_action( 'woocommerce_before_calculate_totals', array( $this, 'maybe_backup_recurring_carts'), 1 );
49
  add_action( 'woocommerce_after_calculate_totals', array( $this, 'maybe_restore_recurring_carts'), 200 );
 
 
50
  }
51
  }
52
 
53
- function product_price_filter($subscription_sign_up_fee, $product){
54
 
55
- $subscription_sign_up_fee = apply_filters('wcml_raw_price_amount', $subscription_sign_up_fee );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
 
57
  return $subscription_sign_up_fee;
58
  }
@@ -249,4 +269,22 @@ class WCML_WC_Subscriptions{
249
  return $price;
250
  }
251
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
252
  }
43
 
44
  function init(){
45
  if( !is_admin() ){
46
+ add_filter( 'woocommerce_subscriptions_product_sign_up_fee', array(
47
+ $this,
48
+ 'subscriptions_product_sign_up_fee_filter'
49
+ ), 10, 2 );
50
 
51
  add_action( 'woocommerce_before_calculate_totals', array( $this, 'maybe_backup_recurring_carts'), 1 );
52
  add_action( 'woocommerce_after_calculate_totals', array( $this, 'maybe_restore_recurring_carts'), 200 );
53
+
54
+ $this->maybe_force_client_currency_for_resubscribe_subscription();
55
  }
56
  }
57
 
 
58
 
59
+ /**
60
+ * Filter Subscription Sign-up fee cost
61
+ *
62
+ * @param string $subscription_sign_up_fee
63
+ * @param WC_Product $product
64
+ * @return string
65
+ */
66
+ function subscriptions_product_sign_up_fee_filter( $subscription_sign_up_fee, $product ) {
67
+
68
+ if ( wcml_is_multi_currency_on() ) {
69
+ if ( get_post_meta( $product->get_id(), '_wcml_custom_prices_status', true ) ) {
70
+ $currency = $this->woocommerce_wpml->multi_currency->get_client_currency();
71
+ $subscription_sign_up_fee = get_post_meta( $product->get_id(), '_subscription_sign_up_fee_' . $currency, true );
72
+ } else {
73
+ $subscription_sign_up_fee = apply_filters( 'wcml_raw_price_amount', $subscription_sign_up_fee );
74
+ }
75
+ }
76
 
77
  return $subscription_sign_up_fee;
78
  }
269
  return $price;
270
  }
271
 
272
+ /**
273
+ * Force client currency for resubscribe subscription
274
+ *
275
+ */
276
+ function maybe_force_client_currency_for_resubscribe_subscription( ){
277
+
278
+ if ( isset( $_GET['resubscribe'] ) || false !== ( $resubscribe_cart_item = wcs_cart_contains_resubscribe() ) ) {
279
+ $subscription_id = ( isset( $_GET['resubscribe'] ) ) ? (int) $_GET['resubscribe'] : $resubscribe_cart_item['subscription_resubscribe']['subscription_id'];
280
+
281
+ $subscription_currency = get_post_meta( $subscription_id, '_order_currency', true );
282
+ $client_currency = $this->woocommerce_wpml->multi_currency->get_client_currency();
283
+
284
+ if( $subscription_currency && $client_currency !== $subscription_currency ){
285
+ $this->woocommerce_wpml->multi_currency->set_client_currency( $subscription_currency );
286
+ }
287
+ }
288
+ }
289
+
290
  }
inc/admin-menus/class-wcml-setup.php CHANGED
@@ -35,14 +35,23 @@ class WCML_Setup {
35
  'name' => __( 'Multiple Currencies', 'woocommerce-multilingual' ),
36
  'view' => array( $this, 'setup_multi_currency' ),
37
  'handler' => array( $this, 'save_multi_currency' )
38
- ),
39
- 'ready' => array(
40
- 'name' => __( 'Ready!', 'woocommerce-multilingual' ),
41
- 'view' => array( $this, 'setup_ready' ),
42
- 'handler' => ''
43
  )
44
  );
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  if( current_user_can( 'manage_options' ) ) {
47
  if ( isset( $_GET['page'] ) && $_GET['page'] === 'wcml-setup' ) {
48
  add_action( 'admin_menu', array( $this, 'admin_menus' ) );
@@ -228,6 +237,7 @@ class WCML_Setup {
228
  $this->next_step = isset( $steps[$step_index + 1] ) ? $steps[$step_index + 1] : '';
229
 
230
  $ouput_steps = $this->steps;
 
231
  array_shift( $ouput_steps );
232
  ?>
233
  <ol class="wcml-setup-steps">
@@ -270,6 +280,11 @@ class WCML_Setup {
270
  echo $ui->get_view();
271
  }
272
 
 
 
 
 
 
273
  public function setup_ready(){
274
  $ui = new WCML_Setup_Ready_UI( $this->woocommerce_wpml );
275
  echo $ui->get_view();
@@ -334,6 +349,29 @@ class WCML_Setup {
334
 
335
  }
336
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
337
  /**
338
  * handler
339
  */
35
  'name' => __( 'Multiple Currencies', 'woocommerce-multilingual' ),
36
  'view' => array( $this, 'setup_multi_currency' ),
37
  'handler' => array( $this, 'save_multi_currency' )
 
 
 
 
 
38
  )
39
  );
40
 
41
+ if ( $this->sitepress->get_wp_api()->version_compare( $this->sitepress->get_wp_api()->constant( 'ICL_SITEPRESS_VERSION' ), '3.9.0', '>=' ) ) {
42
+ $this->steps['translation-options'] = array(
43
+ 'name' => __( 'Translation Options', 'woocommerce-multilingual' ),
44
+ 'view' => array( $this, 'setup_translation_options' ),
45
+ 'handler' => array( $this, 'save_translation_options' )
46
+ );
47
+ }
48
+
49
+ $this->steps['ready'] = array(
50
+ 'name' => __( 'Ready!', 'woocommerce-multilingual' ),
51
+ 'view' => array( $this, 'setup_ready' ),
52
+ 'handler' => ''
53
+ );
54
+
55
  if( current_user_can( 'manage_options' ) ) {
56
  if ( isset( $_GET['page'] ) && $_GET['page'] === 'wcml-setup' ) {
57
  add_action( 'admin_menu', array( $this, 'admin_menus' ) );
237
  $this->next_step = isset( $steps[$step_index + 1] ) ? $steps[$step_index + 1] : '';
238
 
239
  $ouput_steps = $this->steps;
240
+
241
  array_shift( $ouput_steps );
242
  ?>
243
  <ol class="wcml-setup-steps">
280
  echo $ui->get_view();
281
  }
282
 
283
+ public function setup_translation_options(){
284
+ $ui = new WCML_Setup_Translation_Options_UI( $this->woocommerce_wpml, $this->next_step_url() );
285
+ echo $ui->get_view();
286
+ }
287
+
288
  public function setup_ready(){
289
  $ui = new WCML_Setup_Ready_UI( $this->woocommerce_wpml );
290
  echo $ui->get_view();
349
 
350
  }
351
 
352
+ /**
353
+ * handler
354
+ */
355
+ public function save_translation_options( $data ){
356
+
357
+ if ( isset( $data['translation-option'] ) ) {
358
+
359
+ $settings_helper = wpml_load_settings_helper();
360
+
361
+ if( 1 === (int) $data['translation-option'] ){
362
+ $settings_helper->set_post_type_display_as_translated( 'product' );
363
+ $settings_helper->set_post_type_translation_unlocked_option( 'product' );
364
+ $settings_helper->set_taxonomy_display_as_translated('product_cat' );
365
+ $settings_helper->set_taxonomy_translation_unlocked_option( 'product_cat' );
366
+ }else{
367
+ $settings_helper->set_post_type_translatable( 'product' );
368
+ $settings_helper->set_post_type_translation_unlocked_option( 'product', false );
369
+ $settings_helper->set_taxonomy_translatable('product_cat' );
370
+ $settings_helper->set_taxonomy_translation_unlocked_option( 'product_cat', false );
371
+ }
372
+ }
373
+ }
374
+
375
  /**
376
  * handler
377
  */
inc/class-wcml-attributes.php CHANGED
@@ -518,7 +518,9 @@ class WCML_Attributes{
518
 
519
  if ( ! is_admin() && $product_id ) {
520
  $orig_lang = $this->woocommerce_wpml->products->get_original_product_language( $product_id );
521
- if ( in_array( $orig_lang, array( 'de', 'da' ) ) ) {
 
 
522
  $attribute_name = $this->sitepress->locale_utils->filter_sanitize_title( remove_accents( $attribute_name ), $attribute_name );
523
  remove_filter( 'sanitize_title', array( $this->sitepress->locale_utils, 'filter_sanitize_title' ), 10 );
524
  }
518
 
519
  if ( ! is_admin() && $product_id ) {
520
  $orig_lang = $this->woocommerce_wpml->products->get_original_product_language( $product_id );
521
+ $current_language = $this->sitepress->get_current_language();
522
+
523
+ if ( in_array( $orig_lang, array( 'de', 'da' ) ) && $current_language !== $orig_lang ) {
524
  $attribute_name = $this->sitepress->locale_utils->filter_sanitize_title( remove_accents( $attribute_name ), $attribute_name );
525
  remove_filter( 'sanitize_title', array( $this->sitepress->locale_utils, 'filter_sanitize_title' ), 10 );
526
  }
inc/class-wcml-cart.php CHANGED
@@ -148,7 +148,7 @@ class WCML_Cart {
148
 
149
  public function cart_switching_currency( $exc, $current_currency, $new_currency, $return = false ) {
150
 
151
- $cart_for_session = WC()->cart->get_cart_for_session();
152
  if ( $this->woocommerce_wpml->settings['cart_sync']['currency_switch'] == WCML_CART_SYNC || empty( $cart_for_session ) ) {
153
  return $exc;
154
  }
@@ -178,50 +178,70 @@ class WCML_Cart {
178
  <p><?php echo esc_html( $confirmation_message ); ?></p>
179
  </div>
180
 
181
- <script type="text/javascript">
182
- jQuery(document).ready(function () {
183
- jQuery("#wcml-cart-dialog-confirm").dialog({
184
- resizable: false,
185
- draggable: false,
186
- height: "auto",
187
- width: 500,
188
- modal: true,
189
- closeOnEscape: false,
190
- dialogClass: "wcml-cart-dialog",
191
- create: function () {
192
- jQuery('#jquery-ui-style-css').attr('disabled', 'disabled');
193
- },
194
- open: function (event, ui) {
195
- jQuery(".ui-dialog-titlebar-close", ui.dialog | ui).hide();
196
- },
197
- close: function (event, ui) {
198
- jQuery('#jquery-ui-style-css').removeAttr('disabled');
199
- },
200
- buttons: {
201
- "<?php echo $switch_to; ?>": function () {
202
- jQuery(this).dialog("close");
203
- <?php if( $language_switch ): ?>
204
- window.location = '<?php echo esc_url( $switch_to_value, null, 'redirect' ); ?>';
205
- <?php else: ?>
206
- jQuery('.wcml_currency_switcher').parent().find('img').remove();
207
- wcml_load_currency("<?php echo esc_js( $switch_to_value ); ?>", true);
208
- <?php endif; ?>
209
-
210
- },
211
- "<?php echo $stay_in; ?>": function () {
212
- jQuery(this).dialog("close");
213
- <?php if( $language_switch ): ?>
214
- window.location = '<?php echo esc_url( $stay_in_value, null, 'redirect' ); ?>';
215
- <?php else: ?>
216
- jQuery('.wcml_currency_switcher').parent().find('img').remove();
217
- jQuery('.wcml_currency_switcher').removeAttr('disabled');
218
- jQuery('.wcml_currency_switcher').val('<?php echo esc_js( $stay_in_value ); ?>');
219
- <?php endif; ?>
220
- }
221
- }
222
- });
223
- });
224
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
  <?php
226
  }
227
 
@@ -271,7 +291,8 @@ class WCML_Cart {
271
  $cart->cart_contents[ $key ]['data']->price = get_post_meta( $cart_item['product_id'], '_price', 1 );
272
  }
273
 
274
- if ( $cart_item['product_id'] == $tr_product_id ) {
 
275
  $new_cart_data[ $key ] = apply_filters( 'wcml_cart_contents_not_changed', $cart->cart_contents[ $key ], $key, $current_language );
276
  continue;
277
  }
148
 
149
  public function cart_switching_currency( $exc, $current_currency, $new_currency, $return = false ) {
150
 
151
+ $cart_for_session = !is_null( WC()->cart ) ? WC()->cart->get_cart_for_session() : false;
152
  if ( $this->woocommerce_wpml->settings['cart_sync']['currency_switch'] == WCML_CART_SYNC || empty( $cart_for_session ) ) {
153
  return $exc;
154
  }
178
  <p><?php echo esc_html( $confirmation_message ); ?></p>
179
  </div>
180
 
181
+ <script type="text/javascript">
182
+ jQuery(document).ready(function () {
183
+ var dialogBox = jQuery("#wcml-cart-dialog-confirm");
184
+ dialogBox.dialog({
185
+ resizable: false,
186
+ draggable: false,
187
+ height: "auto",
188
+ width: 500,
189
+ modal: true,
190
+ closeOnEscape: false,
191
+ dialogClass: "otgs-ui-dialog wcml-cart-dialog",
192
+ create: function () {
193
+ jQuery('#jquery-ui-style-css').attr('disabled', 'disabled');
194
+ },
195
+ open: function (event, ui) {
196
+ jQuery(".ui-dialog-titlebar-close", ui.dialog | ui).hide();
197
+ repositionDialog();
198
+ },
199
+ close: function (event, ui) {
200
+ jQuery('#jquery-ui-style-css').removeAttr('disabled');
201
+ },
202
+ buttons: {
203
+ "<?php echo $switch_to; ?>": function () {
204
+ jQuery(this).dialog("close");
205
+ <?php if( $language_switch ): ?>
206
+ window.location = '<?php echo esc_url( $switch_to_value, null, 'redirect' ); ?>';
207
+ <?php else: ?>
208
+ jQuery('.wcml_currency_switcher').parent().find('img').remove();
209
+ wcml_load_currency("<?php echo esc_js( $switch_to_value ); ?>", true);
210
+ <?php endif; ?>
211
+
212
+ },
213
+ "<?php echo $stay_in; ?>": function () {
214
+ jQuery(this).dialog("close");
215
+ <?php if( $language_switch ): ?>
216
+ window.location = '<?php echo esc_url( $stay_in_value, null, 'redirect' ); ?>';
217
+ <?php else: ?>
218
+ jQuery('.wcml_currency_switcher').parent().find('img').remove();
219
+ jQuery('.wcml_currency_switcher').removeAttr('disabled');
220
+ jQuery('.wcml_currency_switcher').val('<?php echo esc_js( $stay_in_value ); ?>');
221
+ <?php endif; ?>
222
+ }
223
+ }
224
+ });
225
+
226
+ jQuery(window).resize(repositionDialog);
227
+
228
+ function repositionDialog() {
229
+ var winH = jQuery(window).height() - 180;
230
+ jQuery('.wcml-cart-dialog').css({
231
+ "max-height": winH,
232
+ "max-width": "95%"
233
+ });
234
+
235
+ dialogBox.dialog("option", "position", {
236
+ my: "center",
237
+ at: "center",
238
+ of: window
239
+ });
240
+ };
241
+
242
+
243
+ });
244
+ </script>
245
  <?php
246
  }
247
 
291
  $cart->cart_contents[ $key ]['data']->price = get_post_meta( $cart_item['product_id'], '_price', 1 );
292
  }
293
 
294
+ $display_as_translated = apply_filters( 'wpml_is_display_as_translated_post_type', false, 'product' );
295
+ if ( $cart_item['product_id'] == $tr_product_id || $display_as_translated ) {
296
  $new_cart_data[ $key ] = apply_filters( 'wcml_cart_contents_not_changed', $cart->cart_contents[ $key ], $key, $current_language );
297
  continue;
298
  }
inc/class-wcml-compatibility.php CHANGED
@@ -68,7 +68,7 @@ class WCML_Compatibility {
68
  $this->product_bundles->add_hooks();
69
  } else {
70
  $product_bundle_items = new WCML_WC_Product_Bundles_Items();
71
- $this->product_bundles = new WCML_Product_Bundles( $this->sitepress, $this->woocommerce_wpml, $product_bundle_items );
72
  }
73
  }
74
 
68
  $this->product_bundles->add_hooks();
69
  } else {
70
  $product_bundle_items = new WCML_WC_Product_Bundles_Items();
71
+ $this->product_bundles = new WCML_Product_Bundles( $this->sitepress, $this->woocommerce_wpml, $product_bundle_items, $this->wpdb );
72
  }
73
  }
74
 
inc/class-wcml-endpoints.php CHANGED
@@ -12,7 +12,6 @@ class WCML_Endpoints{
12
  add_action( 'icl_ajx_custom_call', array( $this, 'rewrite_rule_endpoints' ), 11, 2 );
13
  add_action( 'woocommerce_update_options', array( $this, 'add_endpoints' ) );
14
  add_filter( 'pre_update_option_rewrite_rules', array( $this, 'update_rewrite_rules' ), 100, 2 );
15
- add_filter( 'wpml_sl_blacklist_requests', array( $this, 'reserved_requests' ), 10, 2 );
16
 
17
  add_filter( 'page_link', array( $this, 'endpoint_permalink_filter' ), 10, 2 ); //after WPML
18
 
@@ -21,6 +20,8 @@ class WCML_Endpoints{
21
  $this->maybe_flush_rules();
22
  $this->register_endpoints_translations();
23
  add_filter('pre_get_posts', array($this, 'check_if_endpoint_exists'));
 
 
24
  }
25
 
26
  add_filter( 'woocommerce_get_endpoint_url', array( $this, 'filter_get_endpoint_url' ), 10, 4 );
12
  add_action( 'icl_ajx_custom_call', array( $this, 'rewrite_rule_endpoints' ), 11, 2 );
13
  add_action( 'woocommerce_update_options', array( $this, 'add_endpoints' ) );
14
  add_filter( 'pre_update_option_rewrite_rules', array( $this, 'update_rewrite_rules' ), 100, 2 );
 
15
 
16
  add_filter( 'page_link', array( $this, 'endpoint_permalink_filter' ), 10, 2 ); //after WPML
17
 
20
  $this->maybe_flush_rules();
21
  $this->register_endpoints_translations();
22
  add_filter('pre_get_posts', array($this, 'check_if_endpoint_exists'));
23
+ }else{
24
+ add_filter( 'wpml_sl_blacklist_requests', array( $this, 'reserved_requests' ), 10, 2 );
25
  }
26
 
27
  add_filter( 'woocommerce_get_endpoint_url', array( $this, 'filter_get_endpoint_url' ), 10, 4 );
inc/class-wcml-resources.php CHANGED
@@ -22,7 +22,7 @@ class WCML_Resources {
22
  self::$pagenow = $pagenow;
23
 
24
  self::load_css();
25
- self::load_js();
26
 
27
  $is_edit_product = self::$pagenow == 'post.php' && isset($_GET['post']) && get_post_type( $_GET['post'] ) == 'product';
28
  $is_original_product = isset( $_GET['post'] ) && !is_array( $_GET['post'] ) && self::$woocommerce_wpml->products->is_original_product( $_GET['post'] );
@@ -64,26 +64,34 @@ class WCML_Resources {
64
  wp_enqueue_style( 'wpml-wcml' );
65
  }
66
 
67
- private static function load_js() {
 
 
 
 
 
68
 
69
  if ( self::$is_wpml_wcml_page ) {
70
 
71
- wp_register_script( 'wcml-scripts', WCML_PLUGIN_URL . '/res/js/scripts' . WCML_JS_MIN . '.js', array(
72
- 'jquery',
73
- 'jquery-ui-core',
74
- 'jquery-ui-resizable'
75
- ), WCML_VERSION );
76
 
 
77
 
78
  wp_register_script( 'jquery-cookie', WCML_PLUGIN_URL . '/res/js/jquery.cookie' . WCML_JS_MIN . '.js', array('jquery'), WCML_VERSION );
79
  wp_register_script( 'wcml-dialogs', WCML_PLUGIN_URL . '/res/js/dialogs' . WCML_JS_MIN . '.js', array('jquery', 'jquery-ui-core', 'jquery-ui-dialog'), WCML_VERSION );
80
  wp_register_script( 'wcml-troubleshooting', WCML_PLUGIN_URL . '/res/js/troubleshooting' . WCML_JS_MIN . '.js', array('jquery'), WCML_VERSION );
 
81
 
 
82
  wp_enqueue_script( 'wp-color-picker');
83
  wp_enqueue_script( 'wcml-dialogs' );
84
- wp_enqueue_script( 'wcml-scripts' );
85
  wp_enqueue_script( 'jquery-cookie' );
86
  wp_enqueue_script( 'wcml-troubleshooting' );
 
87
 
88
  wp_localize_script( 'wcml-scripts', 'wcml_settings',
89
  array(
22
  self::$pagenow = $pagenow;
23
 
24
  self::load_css();
25
+ self::load_common_scripts();
26
 
27
  $is_edit_product = self::$pagenow == 'post.php' && isset($_GET['post']) && get_post_type( $_GET['post'] ) == 'product';
28
  $is_original_product = isset( $_GET['post'] ) && !is_array( $_GET['post'] ) && self::$woocommerce_wpml->products->is_original_product( $_GET['post'] );
64
  wp_enqueue_style( 'wpml-wcml' );
65
  }
66
 
67
+ public static function load_taxonomy_translation_scripts(){
68
+ wp_register_script( 'wcml-taxonomy-translation-scripts', WCML_PLUGIN_URL . '/res/js/taxonomy_translation' . WCML_JS_MIN . '.js', array( 'jquery' ), WCML_VERSION );
69
+ wp_enqueue_script( 'wcml-taxonomy-translation-scripts' );
70
+ }
71
+
72
+ private static function load_common_scripts() {
73
 
74
  if ( self::$is_wpml_wcml_page ) {
75
 
76
+ wp_register_script( 'wcml-scripts', WCML_PLUGIN_URL . '/res/js/scripts' . WCML_JS_MIN . '.js', array(
77
+ 'jquery',
78
+ 'jquery-ui-core',
79
+ 'jquery-ui-resizable'
80
+ ), WCML_VERSION );
81
 
82
+ self::load_taxonomy_translation_scripts();
83
 
84
  wp_register_script( 'jquery-cookie', WCML_PLUGIN_URL . '/res/js/jquery.cookie' . WCML_JS_MIN . '.js', array('jquery'), WCML_VERSION );
85
  wp_register_script( 'wcml-dialogs', WCML_PLUGIN_URL . '/res/js/dialogs' . WCML_JS_MIN . '.js', array('jquery', 'jquery-ui-core', 'jquery-ui-dialog'), WCML_VERSION );
86
  wp_register_script( 'wcml-troubleshooting', WCML_PLUGIN_URL . '/res/js/troubleshooting' . WCML_JS_MIN . '.js', array('jquery'), WCML_VERSION );
87
+ wp_register_script( 'wcml-translation-interface-dialog-warning', WCML_PLUGIN_URL . '/res/js/trnsl_interface_dialog_warning' . WCML_JS_MIN . '.js', array('jquery'), WCML_VERSION );
88
 
89
+ wp_enqueue_script( 'wcml-scripts' );
90
  wp_enqueue_script( 'wp-color-picker');
91
  wp_enqueue_script( 'wcml-dialogs' );
 
92
  wp_enqueue_script( 'jquery-cookie' );
93
  wp_enqueue_script( 'wcml-troubleshooting' );
94
+ wp_enqueue_script( 'wcml-translation-interface-dialog-warning' );
95
 
96
  wp_localize_script( 'wcml-scripts', 'wcml_settings',
97
  array(
inc/class-wcml-store-pages.php CHANGED
@@ -111,8 +111,7 @@ class WCML_Store_Pages{
111
  AND post_name = %s
112
  AND icl.element_type = 'post_page'
113
  AND icl.language_code = %s LIMIT 1;
114
- ",
115
- esc_sql( $page['name'] ), $this->sitepress->get_default_language() ) );
116
  }
117
 
118
  if( !$page_found ){
@@ -120,7 +119,7 @@ class WCML_Store_Pages{
120
  'post_status' => 'publish',
121
  'post_type' => 'page',
122
  'post_author' => 1,
123
- 'post_name' => esc_sql( $page['name'] ),
124
  'post_title' => $page['title'],
125
  'post_content' => $page['content'],
126
  'post_parent' => ! empty( $page['parent'] ) ? wc_get_page_id( $page['parent'] ) : '',
111
  AND post_name = %s
112
  AND icl.element_type = 'post_page'
113
  AND icl.language_code = %s LIMIT 1;
114
+ ", $page['name'], $this->sitepress->get_default_language() ) );
 
115
  }
116
 
117
  if( !$page_found ){
119
  'post_status' => 'publish',
120
  'post_type' => 'page',
121
  'post_author' => 1,
122
+ 'post_name' => $page['name'],
123
  'post_title' => $page['title'],
124
  'post_content' => $page['content'],
125
  'post_parent' => ! empty( $page['parent'] ) ? wc_get_page_id( $page['parent'] ) : '',
inc/class-wcml-terms.php CHANGED
@@ -78,7 +78,7 @@ class WCML_Terms{
78
  $page = isset( $_GET['page'] )? $_GET['page'] : '';
79
  if ( $page === ICL_PLUGIN_FOLDER . '/menu/taxonomy-translation.php' ) {
80
  WCML_Resources::load_management_css();
81
- wp_enqueue_script( 'wcml-scripts' );
82
  }
83
 
84
  }
@@ -396,6 +396,7 @@ class WCML_Terms{
396
 
397
  $is_wcml = is_admin() && $taxonomy && isset($_GET['page']) && $_GET['page'] == 'wpml-wcml' && isset($_GET['tab']);
398
  $is_ajax = is_ajax() && $taxonomy && isset( $_POST['action'] ) && $_POST['action'] === 'wpml_get_terms_and_labels_for_taxonomy_table';
 
399
  if( $is_wcml || $is_ajax ){
400
 
401
  $sync_tax = new WCML_Sync_Taxonomy( $this->woocommerce_wpml, $taxonomy, $taxonomy_obj );
78
  $page = isset( $_GET['page'] )? $_GET['page'] : '';
79
  if ( $page === ICL_PLUGIN_FOLDER . '/menu/taxonomy-translation.php' ) {
80
  WCML_Resources::load_management_css();
81
+ WCML_Resources::load_taxonomy_translation_scripts();
82
  }
83
 
84
  }
396
 
397
  $is_wcml = is_admin() && $taxonomy && isset($_GET['page']) && $_GET['page'] == 'wpml-wcml' && isset($_GET['tab']);
398
  $is_ajax = is_ajax() && $taxonomy && isset( $_POST['action'] ) && $_POST['action'] === 'wpml_get_terms_and_labels_for_taxonomy_table';
399
+
400
  if( $is_wcml || $is_ajax ){
401
 
402
  $sync_tax = new WCML_Sync_Taxonomy( $this->woocommerce_wpml, $taxonomy, $taxonomy_obj );
inc/class-wcml-url-translation.php CHANGED
@@ -14,6 +14,7 @@ class WCML_Url_Translation {
14
  public $default_product_category_gettext_base;
15
  public $default_product_tag_base;
16
  public $default_product_tag_gettext_base;
 
17
 
18
  /**
19
  * WCML_Url_Translation constructor.
14
  public $default_product_category_gettext_base;
15
  public $default_product_tag_base;
16
  public $default_product_tag_gettext_base;
17
+ public $wc_permalinks;
18
 
19
  /**
20
  * WCML_Url_Translation constructor.
inc/class-woocommerce-wpml.php CHANGED
@@ -176,6 +176,7 @@ class woocommerce_wpml {
176
  $this->troubleshooting = new WCML_Troubleshooting( $this, $sitepress, $wpdb );
177
  $this->links = new WCML_Links( $this, $sitepress );
178
  $this->translation_editor = new WCML_Translation_Editor( $this, $sitepress, $wpdb );
 
179
  $this->languages_upgrader = new WCML_Languages_Upgrader;
180
  $this->sync_variations_data = new WCML_Synchronize_Variations_Data( $this, $sitepress, $wpdb );
181
  $this->sync_variations_data->add_hooks();
176
  $this->troubleshooting = new WCML_Troubleshooting( $this, $sitepress, $wpdb );
177
  $this->links = new WCML_Links( $this, $sitepress );
178
  $this->translation_editor = new WCML_Translation_Editor( $this, $sitepress, $wpdb );
179
+ $this->translation_editor->add_hooks();
180
  $this->languages_upgrader = new WCML_Languages_Upgrader;
181
  $this->sync_variations_data = new WCML_Synchronize_Variations_Data( $this, $sitepress, $wpdb );
182
  $this->sync_variations_data->add_hooks();
inc/template-classes/class-wcml-settings-ui.php CHANGED
@@ -40,7 +40,9 @@ class WCML_Settings_UI extends WPML_Templates_Factory {
40
 
41
  ),
42
  'controls_value' => $this->woocommerce_wpml->settings['trnsl_interface'],
43
-
 
 
44
  ),
45
 
46
  'synchronization' => array(
40
 
41
  ),
42
  'controls_value' => $this->woocommerce_wpml->settings['trnsl_interface'],
43
+ 'pb_warning' => __("If you are using a page builder to design WooCommerce products, you should only use WPML's Translation Editor.", 'woocommerce-multilingual'),
44
+ 'pb_warning_ok_button' => __('OK (translate with the WordPress editor)', 'woocommerce-multilingual'),
45
+ 'pb_warning_cancel_button' => __('Cancel (stay with the Translation Editor)', 'woocommerce-multilingual'),
46
  ),
47
 
48
  'synchronization' => array(
inc/template-classes/setup/class-wcml-setup-translation-options-ui.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WCML_Setup_Translation_Options_UI extends WPML_Templates_Factory {
4
+
5
+ private $woocommerce_wpml;
6
+ private $next_step_url;
7
+
8
+ function __construct( $woocommerce_wpml, $next_step_url ) {
9
+ parent::__construct();
10
+
11
+ $this->woocommerce_wpml = $woocommerce_wpml;
12
+ $this->next_step_url = $next_step_url;
13
+
14
+ }
15
+
16
+ public function get_model(){
17
+
18
+ $custom_posts_unlocked = apply_filters( 'wpml_get_setting', false, 'custom_posts_unlocked_option' );
19
+ $custom_posts_sync = apply_filters( 'wpml_get_setting', false, 'custom_posts_sync_option' );
20
+
21
+ $is_display_as_translated_checked = 1 === $custom_posts_unlocked[ 'product' ] && WPML_CONTENT_TYPE_DISPLAY_AS_IF_TRANSLATED === $custom_posts_sync[ 'product' ];
22
+
23
+ $model = array(
24
+ 'strings' => array(
25
+ 'heading' => __( 'Translation Options', 'woocommerce-multilingual' ),
26
+ 'description' => __( "Normally, you first create products in the site's default language and then you translate them. If products are not translated, do you want to show them on other languages?", 'woocommerce-multilingual' ),
27
+ 'label_display_as_translated' => sprintf( __( 'Yes - show products even if they are not yet translated (%smore on how this will work%s)',
28
+ 'woocommerce-multilingual' ),
29
+ '<a target="blank" href="https://wpml.org/documentation/related-projects/woocommerce-multilingual/displaying-untranslated-products-in-secondary-languages/">', '</a>'
30
+ ),
31
+ 'label_translated' => __( 'No - only display products on other languages once they are translated', 'woocommerce-multilingual' ),
32
+ 'description_footer' => __( 'Note, to change this later, go to %sWPML &raquo; Translation Management &raquo; Multilingual Content Setup.%s', 'woocommerce-multilingual' ),
33
+ 'continue' => __( 'Continue', 'woocommerce-multilingual' ),
34
+ ),
35
+ 'is_display_as_translated_checked' => $is_display_as_translated_checked,
36
+ 'continue_url' => $this->next_step_url
37
+ );
38
+
39
+ return $model;
40
+
41
+ }
42
+
43
+ protected function init_template_base_dir() {
44
+ $this->template_paths = array(
45
+ WCML_PLUGIN_PATH . '/templates/',
46
+ );
47
+ }
48
+
49
+ public function get_template() {
50
+ return '/setup/translation-options.twig';
51
+ }
52
+
53
+
54
+ }
inc/translation-editor/class-wcml-editor-ui-product-job.php CHANGED
@@ -171,13 +171,13 @@ class WCML_Editor_UI_Product_Job extends WPML_Editor_UI_Job {
171
 
172
  switch( $cf_settings->get_editor_style() ){
173
  case 'visual':
174
- $cf_field = new WPML_Editor_UI_WYSIWYG_Field( $custom_field, $cf_settings->get_editor_label(), $this->data, true );
175
  break;
176
  case 'textarea':
177
- $cf_field = new WPML_Editor_UI_TextArea_Field( $custom_field, $cf_settings->get_editor_label(), $this->data, true );
178
  break;
179
  default: //line
180
- $cf_field = new WPML_Editor_UI_Single_Line_Field( $custom_field, $cf_settings->get_editor_label(), $this->data, true );
181
  }
182
 
183
  $custom_fields_section->add_field( $cf_field );
171
 
172
  switch( $cf_settings->get_editor_style() ){
173
  case 'visual':
174
+ $cf_field = new WPML_Editor_UI_WYSIWYG_Field( $custom_field, $this->get_product_custom_field_label( $custom_field ), $this->data, true );
175
  break;
176
  case 'textarea':
177
+ $cf_field = new WPML_Editor_UI_TextArea_Field( $custom_field, $this->get_product_custom_field_label( $custom_field ), $this->data, true );
178
  break;
179
  default: //line
180
+ $cf_field = new WPML_Editor_UI_Single_Line_Field( $custom_field, $this->get_product_custom_field_label( $custom_field ), $this->data, true );
181
  }
182
 
183
  $custom_fields_section->add_field( $cf_field );
inc/translation-editor/class-wcml-synchronize-product-data.php CHANGED
@@ -333,24 +333,37 @@ class WCML_Synchronize_Product_Data{
333
  // Process for non-current languages
334
  foreach( $translations as $translation ){
335
  if ( $ld->language_code != $translation->language_code ) {
336
- //check if product exist
337
- if( get_post_type( $translation->element_id ) == 'product_variation' && !get_post( wp_get_post_parent_id( $translation->element_id ) ) ){
338
- continue;
339
- }
 
 
 
 
 
 
340
  $_product = wc_get_product( $translation->element_id );
341
 
342
- if( $_product && $_product->exists() && $_product->managing_stock() ) {
343
- $total_sales = get_post_meta( $translation->element_id, 'total_sales', true);
344
 
345
- if( $action == 'reduce'){
346
- $stock = WooCommerce_Functions_Wrapper::reduce_stock( $translation->element_id, $qty );
347
- $total_sales += $qty;
348
- }else{
349
- $stock = WooCommerce_Functions_Wrapper::increase_stock( $translation->element_id, $qty );
350
- $total_sales -= $qty;
351
- }
352
- update_post_meta( $translation->element_id, 'total_sales', $total_sales );
353
- }
 
 
 
 
 
 
 
 
354
  }
355
  }
356
  }
333
  // Process for non-current languages
334
  foreach( $translations as $translation ){
335
  if ( $ld->language_code != $translation->language_code ) {
336
+
337
+ $translation_product_id = $translation->element_id;
338
+ //check if product exist
339
+ if ( get_post_type( $translation->element_id ) === 'product_variation' ) {
340
+ if ( ! get_post( wp_get_post_parent_id( $translation->element_id ) ) ) {
341
+ continue;
342
+ }
343
+ $translation_product_id = wp_get_post_parent_id( $translation->element_id );
344
+ }
345
+
346
  $_product = wc_get_product( $translation->element_id );
347
 
348
+ $managing_stock = $_product && $_product->exists() && $_product->managing_stock();
 
349
 
350
+ $total_sales = get_post_meta( $translation_product_id, 'total_sales', true );
351
+
352
+ if ( $action === 'reduce' ) {
353
+ $total_sales += $qty;
354
+
355
+ if( $managing_stock ){
356
+ WooCommerce_Functions_Wrapper::reduce_stock( $translation->element_id, $qty );
357
+ }
358
+ } else {
359
+ $total_sales -= $qty;
360
+
361
+ if( $managing_stock ){
362
+ WooCommerce_Functions_Wrapper::increase_stock( $translation->element_id, $qty );
363
+ }
364
+ }
365
+
366
+ update_post_meta( $translation_product_id, 'total_sales', $total_sales );
367
  }
368
  }
369
  }
inc/translation-editor/class-wcml-synchronize-variations-data.php CHANGED
@@ -180,6 +180,8 @@ class WCML_Synchronize_Variations_Data{
180
  wp_delete_post( $current_post_variation->ID, true );
181
  }
182
 
 
 
183
  add_action ( 'save_post', array( $wpml_post_translations, 'save_post_actions' ), 100, 2 );
184
  }
185
  }
@@ -424,4 +426,35 @@ class WCML_Synchronize_Variations_Data{
424
  }
425
  }
426
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
427
  }
180
  wp_delete_post( $current_post_variation->ID, true );
181
  }
182
 
183
+ $this->sync_prices_variation_ids( $product_id, $tr_product_id, $lang );
184
+
185
  add_action ( 'save_post', array( $wpml_post_translations, 'save_post_actions' ), 100, 2 );
186
  }
187
  }
426
  }
427
  }
428
 
429
+ /**
430
+ * Synchronize prices variation ids for product
431
+ *
432
+ * @param int $product_id
433
+ * @param int $tr_product_id
434
+ * @param string $language
435
+ */
436
+ public function sync_prices_variation_ids( $product_id, $tr_product_id, $language ){
437
+
438
+ $prices_variation_ids_fields = array(
439
+ '_min_price_variation_id',
440
+ '_min_regular_price_variation_id',
441
+ '_min_sale_price_variation_id',
442
+ '_max_price_variation_id',
443
+ '_max_regular_price_variation_id',
444
+ '_max_sale_price_variation_id'
445
+ );
446
+
447
+ foreach( $prices_variation_ids_fields as $price_field ){
448
+
449
+ $original_price_variation_id = get_post_meta( $product_id, $price_field, true );
450
+
451
+ if( $original_price_variation_id ){
452
+ $translated_price_variation_id = apply_filters( 'translate_object_id', $original_price_variation_id, 'product_variation', false, $language );
453
+ if( !is_null( $translated_price_variation_id ) ){
454
+ update_post_meta( $tr_product_id, $price_field, $translated_price_variation_id );
455
+ }
456
+ }
457
+ }
458
+ }
459
+
460
  }
inc/translation-editor/class-wcml-translation-editor.php CHANGED
@@ -2,20 +2,22 @@
2
 
3
  class WCML_Translation_Editor{
4
 
5
- /**
6
- * @var woocommerce_wpml
7
- */
8
  private $woocommerce_wpml;
9
- /**
10
- * @var SitePress
11
- */
12
  private $sitepress;
 
 
13
 
14
- public function __construct( &$woocommerce_wpml, &$sitepress, &$wpdb ) {
15
 
16
- $this->woocommerce_wpml =& $woocommerce_wpml;
17
- $this->sitepress =& $sitepress;
18
- $this->wpdb =& $wpdb;
 
 
 
 
19
 
20
  add_filter( 'wpml-translation-editor-fetch-job', array( $this, 'fetch_translation_job_for_editor' ), 10, 2 );
21
  add_filter( 'wpml-translation-editor-job-data', array( $this, 'get_translation_job_data_for_editor' ), 10, 2 );
@@ -32,6 +34,8 @@ class WCML_Translation_Editor{
32
  add_action( 'wp_ajax_wcml_editor_auto_slug', array( $this, 'auto_generate_slug' ) );
33
 
34
  add_action('wpml_doc_translation_method_below', array( $this, 'wpml_translation_editor_override_notice') );
 
 
35
  }
36
 
37
  }
@@ -359,4 +363,22 @@ class WCML_Translation_Editor{
359
  <?php
360
 
361
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
362
  }
2
 
3
  class WCML_Translation_Editor{
4
 
5
+ /** @var woocommerce_wpml */
 
 
6
  private $woocommerce_wpml;
7
+ /** @var SitePress */
 
 
8
  private $sitepress;
9
+ /** @var wpdb */
10
+ private $wpdb;
11
 
12
+ public function __construct( woocommerce_wpml $woocommerce_wpml, SitePress $sitepress, wpdb $wpdb ) {
13
 
14
+ $this->woocommerce_wpml = $woocommerce_wpml;
15
+ $this->sitepress = $sitepress;
16
+ $this->wpdb = $wpdb;
17
+
18
+ }
19
+
20
+ public function add_hooks(){
21
 
22
  add_filter( 'wpml-translation-editor-fetch-job', array( $this, 'fetch_translation_job_for_editor' ), 10, 2 );
23
  add_filter( 'wpml-translation-editor-job-data', array( $this, 'get_translation_job_data_for_editor' ), 10, 2 );
34
  add_action( 'wp_ajax_wcml_editor_auto_slug', array( $this, 'auto_generate_slug' ) );
35
 
36
  add_action('wpml_doc_translation_method_below', array( $this, 'wpml_translation_editor_override_notice') );
37
+
38
+ add_filter( 'wpml_tm_show_page_builders_translation_editor_warning', array( $this, 'show_page_builders_translation_editor_warning' ), 10, 2 );
39
  }
40
 
41
  }
363
  <?php
364
 
365
  }
366
+
367
+ /**
368
+ * Don't show Page builders Translation editor warning for products
369
+ *
370
+ * @param bool $display
371
+ * @param int $post_id
372
+ *
373
+ * @return bool
374
+ */
375
+ public function show_page_builders_translation_editor_warning( $display, $post_id ){
376
+
377
+ if( 'product' === get_post_type( $post_id ) ){
378
+ $display = false;
379
+ }
380
+
381
+ return $display;
382
+ }
383
+
384
  }
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: http://wpml.org/documentation/related-projects/woocommerce-multilin
4
  Tags: CMS, woocommerce, commerce, ecommerce, e-commerce, products, WPML, multilingual, e-shop, shop
5
  License: GPLv2
6
  Requires at least: 3.9
7
- Tested up to: 4.8.1
8
- Stable tag: 4.2.5
9
 
10
  Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
11
 
@@ -142,7 +142,23 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
142
 
143
  == Changelog ==
144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  = 4.2.5 =
 
146
  * Cannot update Purchase note (any other custom field) once the job is completed
147
  * New order admin emails have un-translated heading and subject when admin language is different of default
148
  * Product in cart not adjusted to correct language when switching languages
@@ -157,7 +173,6 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
157
  * Fix a bug that the price calculation is not correct in combination with WC Bookings and WC Deposit plugin
158
  * MaxStore Pro theme compatibility for mini cart
159
  * Product price was doubled on cart in combination with Booking and Product Addons
160
- * Added 'wcml_hide_cart_alert_dialog' filter to support hide cart alert switching dialog
161
 
162
  = 4.2.4 =
163
  * Allow translating categories used in shortcodes when the simple tax query is used
@@ -168,29 +183,6 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
168
  * Fixed an incompatibility issue with WooCommerce Bookings: the layout of the conformation prompt from switching the cart was broken.
169
  * Serialized custom fields were translated incorrectly using the WooCommerce Multilingual Translation Editor
170
 
171
- = 4.2.3 =
172
- * A fatal error occurred when deactivating WPML with WooCommerce Multilingual being active
173
-
174
- = 4.2.2 =
175
- * Added a filter to include links to the String Translation table for custom options/settings in Woocommerce Gateway settings panel
176
- * Added logic to display a warning in the back-end when built in taxonomies translation status (set to 'translate') is overridden
177
- * Added the ability to translate the currency switcher format in String Translation
178
- * My account Bookings list page displays bookings in all languages
179
- * Updating variable product does not refresh product visibility terms
180
- * Currency switcher doesn't reload the product page if # is present in the URL
181
- * Fixed a PHP fatal error that was occurring when using WooCommerce Multilingual together with Sensei
182
- * The 'featured' product field was not synchronized across product translations
183
- * When updating a translation, the product translation slug was overwritten if product contains page builders fields
184
- * The 'reset password' form in a secondary language pointed to a 404 error
185
- * "product/%product_cat%" product permalink doesn't work for products without category assigned in second language if "Uncategorized" string not translated in String Translation module
186
- * It was not possible to set the custom price value in secondary currencies as '0'
187
- * It was not possible to translate attribute slugs if the attributes base was not translated
188
- * Currency switcher styles were not loaded when using only a shortcode currency switcher
189
- * The customer order email was sent in default language when the 'Processing' button was clicked on the back-end
190
-
191
- = 4.2.1.1 =
192
- * WC Subscriptions compatibility error
193
-
194
  = 4.2.1 =
195
  * Added the ability to set custom currencies for orders created via the REST API
196
  * Filter by translation status displays wrong results on WooCommerce Multilingual products list page
@@ -198,7 +190,6 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
198
  * Missing Woocommerce pages were created in default language
199
  * Fatal error while custom call not active currency switcher template
200
  * Duplicating from WooCommerce resulted in losing language data for the original product
201
- * Coupon with category restriction removed when switching language on cart page
202
  * PHP errors were shown on the admin dashboard when no orders existed and displaying errors was on
203
  * Fixed issue with problem in downloadable products in secondary language with different domain per language is enabled
204
  * A fatal error (undefiend get_current_screen) was occurring in some conditions on the WP admin side
@@ -218,7 +209,6 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
218
  * Checkout Field Editor compatibility fix
219
  * Fixed issue with displaying custom prices in Bundles Products
220
  * Add filter for 'woocommerce_subscriptions_product_price'
221
- * Fixed compatibi;ity issue with coupos not applied correctly in a subscription product
222
  * The `wcml_raw_price_amount` filter could not be used to convert to a different currency than the current user currency
223
 
224
  = 4.2.0 =
@@ -233,7 +223,6 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
233
  * A fatal error occurred when using old WordPress versions (before 4.4.0) - rest_get_url_prefix didn't exist
234
  * The admin orders page was loading slower than necessary
235
  * A PHP fatal error was occurring when using the Adventure Tours extension
236
- * A product addon was added to the cart more then once in combination with Bookings
237
  * For translated products, the product variation names were displayed in the old format (before WooCommerce 3.0)
238
  * The prices in the secondary currencies for products in secondary languages for products read via the REST API were incorrect
239
  * CSS for the currency switcher was loaded when the multi-currency was not enabled
4
  Tags: CMS, woocommerce, commerce, ecommerce, e-commerce, products, WPML, multilingual, e-shop, shop
5
  License: GPLv2
6
  Requires at least: 3.9
7
+ Tested up to: 4.9
8
+ Stable tag: 4.2.6
9
 
10
  Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
11
 
142
 
143
  == Changelog ==
144
 
145
+ = 4.2.6 =
146
+ * WooCommerce Tab Manager categories aren't copied to translated tabs
147
+ * Endpoint translation issue when submitting a job post on secondary languages [WP Job Manager]
148
+ * After changing the payment method, the information is sent incorrectly in the email
149
+ * WooCommerce Subscriptions plugin fatal error on the secondary language
150
+ * Fix for Woocommerce Dynamic Pricing
151
+ * WooCommerce subscriptions > Manually set sign-up fee is not respected
152
+ * WoooCommerce Subscriptions -> changing currency and re-subscribing produces wrong price in the cart
153
+ * Total sales not synced when not managing stocks
154
+ * Adding to cart German product with custom attribute results in improper sanitized custom attribute name after the action is complete
155
+ * WooCommerce Multilingual Translation editor -> Missing Custom Field label
156
+ * WooCommerce Product Add-ons - Admin edit global addon screen shows previous value for name/descripton after update
157
+ * Filtering by variation does not work for product bundle
158
+ * Fix responsiveness of reset cart prompt
159
+
160
  = 4.2.5 =
161
+ * Added 'wcml_hide_cart_alert_dialog' filter to support hide cart alert switching dialog
162
  * Cannot update Purchase note (any other custom field) once the job is completed
163
  * New order admin emails have un-translated heading and subject when admin language is different of default
164
  * Product in cart not adjusted to correct language when switching languages
173
  * Fix a bug that the price calculation is not correct in combination with WC Bookings and WC Deposit plugin
174
  * MaxStore Pro theme compatibility for mini cart
175
  * Product price was doubled on cart in combination with Booking and Product Addons
 
176
 
177
  = 4.2.4 =
178
  * Allow translating categories used in shortcodes when the simple tax query is used
183
  * Fixed an incompatibility issue with WooCommerce Bookings: the layout of the conformation prompt from switching the cart was broken.
184
  * Serialized custom fields were translated incorrectly using the WooCommerce Multilingual Translation Editor
185
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  = 4.2.1 =
187
  * Added the ability to set custom currencies for orders created via the REST API
188
  * Filter by translation status displays wrong results on WooCommerce Multilingual products list page
190
  * Missing Woocommerce pages were created in default language
191
  * Fatal error while custom call not active currency switcher template
192
  * Duplicating from WooCommerce resulted in losing language data for the original product
 
193
  * PHP errors were shown on the admin dashboard when no orders existed and displaying errors was on
194
  * Fixed issue with problem in downloadable products in secondary language with different domain per language is enabled
195
  * A fatal error (undefiend get_current_screen) was occurring in some conditions on the WP admin side
209
  * Checkout Field Editor compatibility fix
210
  * Fixed issue with displaying custom prices in Bundles Products
211
  * Add filter for 'woocommerce_subscriptions_product_price'
 
212
  * The `wcml_raw_price_amount` filter could not be used to convert to a different currency than the current user currency
213
 
214
  = 4.2.0 =
223
  * A fatal error occurred when using old WordPress versions (before 4.4.0) - rest_get_url_prefix didn't exist
224
  * The admin orders page was loading slower than necessary
225
  * A PHP fatal error was occurring when using the Adventure Tours extension
 
226
  * For translated products, the product variation names were displayed in the old format (before WooCommerce 3.0)
227
  * The prices in the secondary currencies for products in secondary languages for products read via the REST API were incorrect
228
  * CSS for the currency switcher was loaded when the multi-currency was not enabled
res/js/scripts.js CHANGED
@@ -23,161 +23,6 @@ jQuery(document).ready(function ($) {
23
  window.location = $('.wcml_products_admin_url').val();
24
  });
25
 
26
- if (typeof TaxonomyTranslation != 'undefined') {
27
-
28
- TaxonomyTranslation.views.TermView = TaxonomyTranslation.views.TermView.extend({
29
- initialize: function () {
30
- TaxonomyTranslation.views.TermView.__super__.initialize.apply(this, arguments);
31
- this.listenTo(this.model, 'translationSaved', this.render_overlay);
32
- },
33
- render_overlay: function () {
34
- var taxonomy = TaxonomyTranslation.classes.taxonomy.get("taxonomy");
35
- $.ajax({
36
- type: "post",
37
- url: ajaxurl,
38
- dataType: 'json',
39
- data: {
40
- action: "wcml_update_term_translated_warnings",
41
- taxonomy: taxonomy,
42
- wcml_nonce: $('#wcml_update_term_translated_warnings_nonce').val()
43
- },
44
- success: function (response) {
45
- if (response.hide) {
46
- if (response.is_attribute) {
47
- $('.tax-product-attributes').removeAttr('title');
48
- $('.tax-product-attributes i.otgs-ico-warning').remove();
49
- } else {
50
- $('.js-tax-tab-' + taxonomy).removeAttr('title');
51
- $('.js-tax-tab-' + taxonomy + ' i.otgs-ico-warning').remove();
52
- }
53
- }
54
- }
55
- })
56
- }
57
- });
58
-
59
- }
60
-
61
- function disable_tax_translation_toggling() {
62
- $('.wcml-tax-translation-list .actions a')
63
- .bind('click', tax_translation_toggling_return_false)
64
- .css({cursor: 'wait'});
65
- }
66
-
67
- function enable_tax_translation_toggling() {
68
- $('.wcml-tax-translation-list .actions a')
69
- .unbind('click', tax_translation_toggling_return_false)
70
- .css({cursor: 'pointer'});
71
- }
72
-
73
- function tax_translation_toggling_return_false(event) {
74
- event.preventDefault();
75
- return false;
76
- }
77
-
78
- $(document).on('submit', '#wcml_tt_sync_variations', function () {
79
-
80
- var this_form = $('#wcml_tt_sync_variations');
81
- var data = this_form.serialize();
82
- this_form.find('.wcml_tt_spinner').fadeIn();
83
- this_form.find('input[type=submit]').attr('disabled', 'disabled');
84
-
85
- $.ajax({
86
- type: "post",
87
- url: ajaxurl,
88
- dataType: 'json',
89
- data: data,
90
- success: function (response) {
91
- this_form.find('.wcml_tt_sycn_preview').html(response.progress);
92
- if (response.go) {
93
- this_form.find('input[name=last_post_id]').val(response.last_post_id);
94
- this_form.find('input[name=languages_processed]').val(response.languages_processed);
95
- this_form.trigger('submit');
96
- } else {
97
- this_form.find('input[name=last_post_id]').val(0);
98
- this_form.find('.wcml_tt_spinner').fadeOut();
99
- this_form.find('input').removeAttr('disabled');
100
- jQuery('#wcml_tt_sync_assignment').fadeOut();
101
- jQuery('#wcml_tt_sync_desc').fadeOut();
102
- }
103
-
104
- }
105
- });
106
-
107
- return false;
108
-
109
- });
110
-
111
-
112
- $(document).on('submit', '#wcml_tt_sync_assignment', function () {
113
-
114
- var this_form = $('#wcml_tt_sync_assignment');
115
- var parameters = this_form.serialize();
116
-
117
- this_form.find('.wcml_tt_spinner').fadeIn();
118
- this_form.find('input').attr('disabled', 'disabled');
119
-
120
- $('.wcml_tt_sync_row').remove();
121
-
122
- $.ajax({
123
- type: "POST",
124
- dataType: 'json',
125
- url: ajaxurl,
126
- data: 'action=wcml_tt_sync_taxonomies_in_content_preview&wcml_nonce=' + $('#wcml_sync_taxonomies_in_content_preview_nonce').val() + '&' + parameters,
127
- success: function (ret) {
128
-
129
- this_form.find('.wcml_tt_spinner').fadeOut();
130
- this_form.find('input').removeAttr('disabled');
131
-
132
- if (ret.errors) {
133
- this_form.find('.errors').html(ret.errors);
134
- } else {
135
- jQuery('#wcml_tt_sync_preview').html(ret.html);
136
- jQuery('#wcml_tt_sync_assignment').fadeOut();
137
- jQuery('#wcml_tt_sync_desc').fadeOut();
138
- }
139
-
140
- }
141
-
142
- });
143
-
144
- return false;
145
-
146
- });
147
-
148
- $(document).on('click', 'form.wcml_tt_do_sync a.submit', function () {
149
-
150
- var this_form = $('form.wcml_tt_do_sync');
151
- var parameters = this_form.serialize();
152
-
153
- this_form.find('.wcml_tt_spinner').fadeIn();
154
- this_form.find('input').attr('disabled', 'disabled');
155
-
156
- jQuery.ajax({
157
- type: "POST",
158
- dataType: 'json',
159
- url: ajaxurl,
160
- data: 'action=wcml_tt_sync_taxonomies_in_content&wcml_nonce=' + $('#wcml_sync_taxonomies_in_content_nonce').val() + '&' + parameters,
161
- success: function (ret) {
162
-
163
- this_form.find('.wcml_tt_spinner').fadeOut();
164
- this_form.find('input').removeAttr('disabled');
165
-
166
- if (ret.errors) {
167
- this_form.find('.errors').html(ret.errors);
168
- } else {
169
- this_form.closest('.wcml_tt_sync_row').html(ret.html);
170
- }
171
-
172
- }
173
-
174
- });
175
-
176
- return false;
177
-
178
-
179
- });
180
-
181
  var wcml_product_rows_data = new Array();
182
  var wcml_get_product_fields_string = function (row) {
183
  var string = '';
@@ -289,18 +134,6 @@ jQuery(document).ready(function ($) {
289
  return false;
290
  });
291
 
292
- $(document).on('click', '#term-table-sync-header', function () {
293
- $('#wcml_tt_sync_assignment').hide();
294
- $('#wcml_tt_sync_desc').hide();
295
- });
296
-
297
- $(document).on('click', '#term-table-header', function () {
298
- if( $('#wcml_tt_sync_assignment').data('sync') ) {
299
- $('#wcml_tt_sync_assignment').show();
300
- $('#wcml_tt_sync_desc').show();
301
- }
302
- });
303
-
304
 
305
  });
306
 
23
  window.location = $('.wcml_products_admin_url').val();
24
  });
25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  var wcml_product_rows_data = new Array();
27
  var wcml_get_product_fields_string = function (row) {
28
  var string = '';
134
  return false;
135
  });
136
 
 
 
 
 
 
 
 
 
 
 
 
 
137
 
138
  });
139
 
res/js/scripts.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(a){var b=!1;window.onbeforeunload=function(c){if(b)return a("#wcml_warn_message").val()},a('.wcml-section input[type="submit"]').click(function(){b=!1}),a(".wcml_search").click(function(){window.location=a(".wcml_products_admin_url").val()+"&cat="+a(".wcml_product_category").val()+"&trst="+a(".wcml_translation_status").val()+"&st="+a(".wcml_product_status").val()+"&slang="+a(".wcml_translation_status_lang").val()}),a(".wcml_search_by_title").click(function(){window.location=a(".wcml_products_admin_url").val()+"&s="+a(".wcml_product_name").val()}),a(".wcml_reset_search").click(function(){window.location=a(".wcml_products_admin_url").val()}),"undefined"!=typeof TaxonomyTranslation&&(TaxonomyTranslation.views.TermView=TaxonomyTranslation.views.TermView.extend({initialize:function(){TaxonomyTranslation.views.TermView.__super__.initialize.apply(this,arguments),this.listenTo(this.model,"translationSaved",this.render_overlay)},render_overlay:function(){var b=TaxonomyTranslation.classes.taxonomy.get("taxonomy");a.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"wcml_update_term_translated_warnings",taxonomy:b,wcml_nonce:a("#wcml_update_term_translated_warnings_nonce").val()},success:function(c){c.hide&&(c.is_attribute?(a(".tax-product-attributes").removeAttr("title"),a(".tax-product-attributes i.otgs-ico-warning").remove()):(a(".js-tax-tab-"+b).removeAttr("title"),a(".js-tax-tab-"+b+" i.otgs-ico-warning").remove()))}})}})),a(document).on("submit","#wcml_tt_sync_variations",function(){var b=a("#wcml_tt_sync_variations"),c=b.serialize();return b.find(".wcml_tt_spinner").fadeIn(),b.find("input[type=submit]").attr("disabled","disabled"),a.ajax({type:"post",url:ajaxurl,dataType:"json",data:c,success:function(a){b.find(".wcml_tt_sycn_preview").html(a.progress),a.go?(b.find("input[name=last_post_id]").val(a.last_post_id),b.find("input[name=languages_processed]").val(a.languages_processed),b.trigger("submit")):(b.find("input[name=last_post_id]").val(0),b.find(".wcml_tt_spinner").fadeOut(),b.find("input").removeAttr("disabled"),jQuery("#wcml_tt_sync_assignment").fadeOut(),jQuery("#wcml_tt_sync_desc").fadeOut())}}),!1}),a(document).on("submit","#wcml_tt_sync_assignment",function(){var b=a("#wcml_tt_sync_assignment"),c=b.serialize();return b.find(".wcml_tt_spinner").fadeIn(),b.find("input").attr("disabled","disabled"),a(".wcml_tt_sync_row").remove(),a.ajax({type:"POST",dataType:"json",url:ajaxurl,data:"action=wcml_tt_sync_taxonomies_in_content_preview&wcml_nonce="+a("#wcml_sync_taxonomies_in_content_preview_nonce").val()+"&"+c,success:function(a){b.find(".wcml_tt_spinner").fadeOut(),b.find("input").removeAttr("disabled"),a.errors?b.find(".errors").html(a.errors):(jQuery("#wcml_tt_sync_preview").html(a.html),jQuery("#wcml_tt_sync_assignment").fadeOut(),jQuery("#wcml_tt_sync_desc").fadeOut())}}),!1}),a(document).on("click","form.wcml_tt_do_sync a.submit",function(){var b=a("form.wcml_tt_do_sync"),c=b.serialize();return b.find(".wcml_tt_spinner").fadeIn(),b.find("input").attr("disabled","disabled"),jQuery.ajax({type:"POST",dataType:"json",url:ajaxurl,data:"action=wcml_tt_sync_taxonomies_in_content&wcml_nonce="+a("#wcml_sync_taxonomies_in_content_nonce").val()+"&"+c,success:function(a){b.find(".wcml_tt_spinner").fadeOut(),b.find("input").removeAttr("disabled"),a.errors?b.find(".errors").html(a.errors):b.closest(".wcml_tt_sync_row").html(a.html)}}),!1});new Array;a("#wcml_custom_exchange_rates").submit(function(){var b=a(this);return b.find(":submit").parent().prepend(icl_ajxloaderimg+"&nbsp;"),b.find(":submit").prop("disabled",!0),a.ajax({type:"post",dataType:"json",url:ajaxurl,data:b.serialize(),success:function(){b.find(":submit").prev().remove(),b.find(":submit").prop("disabled",!1)}}),!1}),a(document).on("click",".wcml_save_base",function(b){b.preventDefault();var c=a(this),d=a(this).closest(".wcml-dialog-container"),e="#wcml-edit-base-slug-"+c.attr("data-base")+"-"+c.attr("data-language")+"-link",f="#wcml-edit-base-slug-"+c.attr("data-base")+"-"+c.attr("data-language");a.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"wcml_update_base_translation",base:c.attr("data-base"),base_value:d.find("#base-original").val(),base_translation:d.find("#base-translation").val(),language:c.attr("data-language"),wcml_nonce:a("#wcml_update_base_nonce").val()},success:function(b){a(f).remove(),a(e).find("i").remove(),a(e).append('<i class="otgs-ico-edit" >'),a(e).parent().prepend(b)}})}),a(document).on("click",".hide-rate-block",function(){var b=a(this).closest(".wcml-wrap");a(this).attr("disabled","disabled");var c=a('<span class="spinner" style="visibility: visible;">'),d=jQuery(this).data("setting");return a(this).parent().prepend(c),a(this).remove(),a.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"wcml_update_setting_ajx",setting:d,value:1,nonce:a("#wcml_settings_nonce").val()},success:function(a){b.hide()}}),!1}),a(document).on("click","#term-table-sync-header",function(){a("#wcml_tt_sync_assignment").hide(),a("#wcml_tt_sync_desc").hide()}),a(document).on("click","#term-table-header",function(){a("#wcml_tt_sync_assignment").data("sync")&&(a("#wcml_tt_sync_assignment").show(),a("#wcml_tt_sync_desc").show())})});
1
+ jQuery(document).ready(function($){var discard=false;window.onbeforeunload=function(e){if(discard){return $("#wcml_warn_message").val()}};$('.wcml-section input[type="submit"]').click(function(){discard=false});$(".wcml_search").click(function(){window.location=$(".wcml_products_admin_url").val()+"&cat="+$(".wcml_product_category").val()+"&trst="+$(".wcml_translation_status").val()+"&st="+$(".wcml_product_status").val()+"&slang="+$(".wcml_translation_status_lang").val()});$(".wcml_search_by_title").click(function(){window.location=$(".wcml_products_admin_url").val()+"&s="+$(".wcml_product_name").val()});$(".wcml_reset_search").click(function(){window.location=$(".wcml_products_admin_url").val()});var wcml_product_rows_data=new Array;var wcml_get_product_fields_string=function(row){var string="";row.find("input[type=text], textarea").each(function(){string+=$(this).val()});return string};$("#wcml_custom_exchange_rates").submit(function(){var thisf=$(this);thisf.find(":submit").parent().prepend(icl_ajxloaderimg+"&nbsp;");thisf.find(":submit").prop("disabled",true);$.ajax({type:"post",dataType:"json",url:ajaxurl,data:thisf.serialize(),success:function(){thisf.find(":submit").prev().remove();thisf.find(":submit").prop("disabled",false)}});return false});function wcml_remove_custom_rates(post_id){var thisa=$(this);$.ajax({type:"post",dataType:"json",url:ajaxurl,data:{action:"wcml_remove_custom_rates",post_id:post_id},success:function(){thisa.parent().parent().parent().fadeOut(function(){$(this).remove()})}});return false}$(document).on("click",".wcml_save_base",function(e){e.preventDefault();var elem=$(this);var dialog_saving_data=$(this).closest(".wcml-dialog-container");var link="#wcml-edit-base-slug-"+elem.attr("data-base")+"-"+elem.attr("data-language")+"-link";var dialog_container="#wcml-edit-base-slug-"+elem.attr("data-base")+"-"+elem.attr("data-language");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"wcml_update_base_translation",base:elem.attr("data-base"),base_value:dialog_saving_data.find("#base-original").val(),base_translation:dialog_saving_data.find("#base-translation").val(),language:elem.attr("data-language"),wcml_nonce:$("#wcml_update_base_nonce").val()},success:function(response){$(dialog_container).remove();$(link).find("i").remove();$(link).append('<i class="otgs-ico-edit" >');$(link).parent().prepend(response)}})});$(document).on("click",".hide-rate-block",function(){var wrap=$(this).closest(".wcml-wrap");$(this).attr("disabled","disabled");var ajaxLoader=$('<span class="spinner" style="visibility: visible;">');var setting=jQuery(this).data("setting");$(this).parent().prepend(ajaxLoader);$(this).remove();$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"wcml_update_setting_ajx",setting:setting,value:1,nonce:$("#wcml_settings_nonce").val()},success:function(response){wrap.hide()}});return false})});
res/js/taxonomy_translation.js ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function ($) {
2
+
3
+ if (typeof TaxonomyTranslation != 'undefined') {
4
+
5
+ TaxonomyTranslation.views.TermView = TaxonomyTranslation.views.TermView.extend({
6
+ initialize: function () {
7
+ TaxonomyTranslation.views.TermView.__super__.initialize.apply(this, arguments);
8
+ this.listenTo(this.model, 'translationSaved', this.render_overlay);
9
+ },
10
+ render_overlay: function () {
11
+ var taxonomy = TaxonomyTranslation.classes.taxonomy.get("taxonomy");
12
+ $.ajax({
13
+ type: "post",
14
+ url: ajaxurl,
15
+ dataType: 'json',
16
+ data: {
17
+ action: "wcml_update_term_translated_warnings",
18
+ taxonomy: taxonomy,
19
+ wcml_nonce: $('#wcml_update_term_translated_warnings_nonce').val()
20
+ },
21
+ success: function (response) {
22
+ if (response.hide) {
23
+ if (response.is_attribute) {
24
+ $('.tax-product-attributes').removeAttr('title');
25
+ $('.tax-product-attributes i.otgs-ico-warning').remove();
26
+ } else {
27
+ $('.js-tax-tab-' + taxonomy).removeAttr('title');
28
+ $('.js-tax-tab-' + taxonomy + ' i.otgs-ico-warning').remove();
29
+ }
30
+ }
31
+ }
32
+ })
33
+ }
34
+ });
35
+
36
+ }
37
+
38
+ function disable_tax_translation_toggling() {
39
+ $('.wcml-tax-translation-list .actions a')
40
+ .bind('click', tax_translation_toggling_return_false)
41
+ .css({cursor: 'wait'});
42
+ }
43
+
44
+ function enable_tax_translation_toggling() {
45
+ $('.wcml-tax-translation-list .actions a')
46
+ .unbind('click', tax_translation_toggling_return_false)
47
+ .css({cursor: 'pointer'});
48
+ }
49
+
50
+ function tax_translation_toggling_return_false(event) {
51
+ event.preventDefault();
52
+ return false;
53
+ }
54
+
55
+ $(document).on('submit', '#wcml_tt_sync_variations', function () {
56
+
57
+ var this_form = $('#wcml_tt_sync_variations');
58
+ var data = this_form.serialize();
59
+ this_form.find('.wcml_tt_spinner').fadeIn();
60
+ this_form.find('input[type=submit]').attr('disabled', 'disabled');
61
+
62
+ $.ajax({
63
+ type: "post",
64
+ url: ajaxurl,
65
+ dataType: 'json',
66
+ data: data,
67
+ success: function (response) {
68
+ this_form.find('.wcml_tt_sycn_preview').html(response.progress);
69
+ if (response.go) {
70
+ this_form.find('input[name=last_post_id]').val(response.last_post_id);
71
+ this_form.find('input[name=languages_processed]').val(response.languages_processed);
72
+ this_form.trigger('submit');
73
+ } else {
74
+ this_form.find('input[name=last_post_id]').val(0);
75
+ this_form.find('.wcml_tt_spinner').fadeOut();
76
+ this_form.find('input').removeAttr('disabled');
77
+ jQuery('#wcml_tt_sync_assignment').fadeOut();
78
+ jQuery('#wcml_tt_sync_desc').fadeOut();
79
+ }
80
+
81
+ }
82
+ });
83
+
84
+ return false;
85
+
86
+ });
87
+
88
+
89
+ $(document).on('submit', '#wcml_tt_sync_assignment', function () {
90
+
91
+ var this_form = $('#wcml_tt_sync_assignment');
92
+ var parameters = this_form.serialize();
93
+
94
+ this_form.find('.wcml_tt_spinner').fadeIn();
95
+ this_form.find('input').attr('disabled', 'disabled');
96
+
97
+ $('.wcml_tt_sync_row').remove();
98
+
99
+ $.ajax({
100
+ type: "POST",
101
+ dataType: 'json',
102
+ url: ajaxurl,
103
+ data: 'action=wcml_tt_sync_taxonomies_in_content_preview&wcml_nonce=' + $('#wcml_sync_taxonomies_in_content_preview_nonce').val() + '&' + parameters,
104
+ success: function (ret) {
105
+
106
+ this_form.find('.wcml_tt_spinner').fadeOut();
107
+ this_form.find('input').removeAttr('disabled');
108
+
109
+ if (ret.errors) {
110
+ this_form.find('.errors').html(ret.errors);
111
+ } else {
112
+ jQuery('#wcml_tt_sync_preview').html(ret.html);
113
+ jQuery('#wcml_tt_sync_assignment').fadeOut();
114
+ jQuery('#wcml_tt_sync_desc').fadeOut();
115
+ }
116
+
117
+ }
118
+
119
+ });
120
+
121
+ return false;
122
+
123
+ });
124
+
125
+ $(document).on('click', 'form.wcml_tt_do_sync a.submit', function () {
126
+
127
+ var this_form = $('form.wcml_tt_do_sync');
128
+ var parameters = this_form.serialize();
129
+
130
+ this_form.find('.wcml_tt_spinner').fadeIn();
131
+ this_form.find('input').attr('disabled', 'disabled');
132
+
133
+ jQuery.ajax({
134
+ type: "POST",
135
+ dataType: 'json',
136
+ url: ajaxurl,
137
+ data: 'action=wcml_tt_sync_taxonomies_in_content&wcml_nonce=' + $('#wcml_sync_taxonomies_in_content_nonce').val() + '&' + parameters,
138
+ success: function (ret) {
139
+
140
+ this_form.find('.wcml_tt_spinner').fadeOut();
141
+ this_form.find('input').removeAttr('disabled');
142
+
143
+ if (ret.errors) {
144
+ this_form.find('.errors').html(ret.errors);
145
+ } else {
146
+ this_form.closest('.wcml_tt_sync_row').html(ret.html);
147
+ }
148
+
149
+ }
150
+
151
+ });
152
+
153
+ return false;
154
+
155
+
156
+ });
157
+
158
+ $(document).on('click', '#term-table-sync-header', function () {
159
+ $('#wcml_tt_sync_assignment').hide();
160
+ $('#wcml_tt_sync_desc').hide();
161
+ });
162
+
163
+ $(document).on('click', '#term-table-header', function () {
164
+ if( $('#wcml_tt_sync_assignment').data('sync') ) {
165
+ $('#wcml_tt_sync_assignment').show();
166
+ $('#wcml_tt_sync_desc').show();
167
+ }
168
+ });
169
+
170
+
171
+ });
172
+
res/js/taxonomy_translation.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function($){if(typeof TaxonomyTranslation!="undefined"){TaxonomyTranslation.views.TermView=TaxonomyTranslation.views.TermView.extend({initialize:function(){TaxonomyTranslation.views.TermView.__super__.initialize.apply(this,arguments);this.listenTo(this.model,"translationSaved",this.render_overlay)},render_overlay:function(){var taxonomy=TaxonomyTranslation.classes.taxonomy.get("taxonomy");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"wcml_update_term_translated_warnings",taxonomy:taxonomy,wcml_nonce:$("#wcml_update_term_translated_warnings_nonce").val()},success:function(response){if(response.hide){if(response.is_attribute){$(".tax-product-attributes").removeAttr("title");$(".tax-product-attributes i.otgs-ico-warning").remove()}else{$(".js-tax-tab-"+taxonomy).removeAttr("title");$(".js-tax-tab-"+taxonomy+" i.otgs-ico-warning").remove()}}}})}})}function disable_tax_translation_toggling(){$(".wcml-tax-translation-list .actions a").bind("click",tax_translation_toggling_return_false).css({cursor:"wait"})}function enable_tax_translation_toggling(){$(".wcml-tax-translation-list .actions a").unbind("click",tax_translation_toggling_return_false).css({cursor:"pointer"})}function tax_translation_toggling_return_false(event){event.preventDefault();return false}$(document).on("submit","#wcml_tt_sync_variations",function(){var this_form=$("#wcml_tt_sync_variations");var data=this_form.serialize();this_form.find(".wcml_tt_spinner").fadeIn();this_form.find("input[type=submit]").attr("disabled","disabled");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:data,success:function(response){this_form.find(".wcml_tt_sycn_preview").html(response.progress);if(response.go){this_form.find("input[name=last_post_id]").val(response.last_post_id);this_form.find("input[name=languages_processed]").val(response.languages_processed);this_form.trigger("submit")}else{this_form.find("input[name=last_post_id]").val(0);this_form.find(".wcml_tt_spinner").fadeOut();this_form.find("input").removeAttr("disabled");jQuery("#wcml_tt_sync_assignment").fadeOut();jQuery("#wcml_tt_sync_desc").fadeOut()}}});return false});$(document).on("submit","#wcml_tt_sync_assignment",function(){var this_form=$("#wcml_tt_sync_assignment");var parameters=this_form.serialize();this_form.find(".wcml_tt_spinner").fadeIn();this_form.find("input").attr("disabled","disabled");$(".wcml_tt_sync_row").remove();$.ajax({type:"POST",dataType:"json",url:ajaxurl,data:"action=wcml_tt_sync_taxonomies_in_content_preview&wcml_nonce="+$("#wcml_sync_taxonomies_in_content_preview_nonce").val()+"&"+parameters,success:function(ret){this_form.find(".wcml_tt_spinner").fadeOut();this_form.find("input").removeAttr("disabled");if(ret.errors){this_form.find(".errors").html(ret.errors)}else{jQuery("#wcml_tt_sync_preview").html(ret.html);jQuery("#wcml_tt_sync_assignment").fadeOut();jQuery("#wcml_tt_sync_desc").fadeOut()}}});return false});$(document).on("click","form.wcml_tt_do_sync a.submit",function(){var this_form=$("form.wcml_tt_do_sync");var parameters=this_form.serialize();this_form.find(".wcml_tt_spinner").fadeIn();this_form.find("input").attr("disabled","disabled");jQuery.ajax({type:"POST",dataType:"json",url:ajaxurl,data:"action=wcml_tt_sync_taxonomies_in_content&wcml_nonce="+$("#wcml_sync_taxonomies_in_content_nonce").val()+"&"+parameters,success:function(ret){this_form.find(".wcml_tt_spinner").fadeOut();this_form.find("input").removeAttr("disabled");if(ret.errors){this_form.find(".errors").html(ret.errors)}else{this_form.closest(".wcml_tt_sync_row").html(ret.html)}}});return false});$(document).on("click","#term-table-sync-header",function(){$("#wcml_tt_sync_assignment").hide();$("#wcml_tt_sync_desc").hide()});$(document).on("click","#term-table-header",function(){if($("#wcml_tt_sync_assignment").data("sync")){$("#wcml_tt_sync_assignment").show();$("#wcml_tt_sync_desc").show()}})});
res/js/trnsl_interface_dialog_warning.js ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function ($) {
2
+
3
+ $(document).on('click', 'input[name="trnsl_interface"]', function () {
4
+
5
+ if ( $(this).val() == 0 ) {
6
+ jQuery(document).ready(function () {
7
+ var dialogBox = jQuery("#wcml-translation-interface-dialog-confirm");
8
+ var buttonsOpts = {};
9
+ buttonsOpts[ dialogBox.find('.cancel-button').val() ] = function () {
10
+ jQuery(this).dialog("close");
11
+ jQuery('input[name="trnsl_interface"][value="1"]').attr('checked', 'checked');
12
+ };
13
+ buttonsOpts[ dialogBox.find('.ok-button').val() ] = function () {
14
+ jQuery(this).dialog("close");
15
+ };
16
+
17
+ dialogBox.dialog({
18
+ resizable: false,
19
+ draggable: false,
20
+ height: "auto",
21
+ width: 600,
22
+ modal: true,
23
+ closeOnEscape: false,
24
+ dialogClass: "otgs-ui-dialog",
25
+ create: function () {
26
+ jQuery('#jquery-ui-style-css').attr('disabled', 'disabled');
27
+ },
28
+ open: function (event, ui) {
29
+ jQuery(".ui-dialog-titlebar-close", ui.dialog | ui).hide();
30
+ },
31
+ close: function (event, ui) {
32
+ jQuery('#jquery-ui-style-css').removeAttr('disabled');
33
+ },
34
+ buttons : buttonsOpts
35
+ });
36
+ });
37
+ }
38
+ });
39
+
40
+ });
41
+
res/js/trnsl_interface_dialog_warning.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function($){$(document).on("click",'input[name="trnsl_interface"]',function(){if($(this).val()==0){jQuery(document).ready(function(){var dialogBox=jQuery("#wcml-translation-interface-dialog-confirm");var buttonsOpts={};buttonsOpts[dialogBox.find(".cancel-button").val()]=function(){jQuery(this).dialog("close");jQuery('input[name="trnsl_interface"][value="1"]').attr("checked","checked")};buttonsOpts[dialogBox.find(".ok-button").val()]=function(){jQuery(this).dialog("close")};dialogBox.dialog({resizable:false,draggable:false,height:"auto",width:600,modal:true,closeOnEscape:false,dialogClass:"otgs-ui-dialog",create:function(){jQuery("#jquery-ui-style-css").attr("disabled","disabled")},open:function(event,ui){jQuery(".ui-dialog-titlebar-close",ui.dialog|ui).hide()},close:function(event,ui){jQuery("#jquery-ui-style-css").removeAttr("disabled")},buttons:buttonsOpts})})}})});
templates/settings-ui.twig CHANGED
@@ -9,6 +9,12 @@
9
  </div>
10
  <div class="wcml-section-content">
11
 
 
 
 
 
 
 
12
  <ul>
13
  <li>
14
  <input type="radio" name="trnsl_interface" value="{{ wpml_translation }}"
9
  </div>
10
  <div class="wcml-section-content">
11
 
12
+ <div id="wcml-translation-interface-dialog-confirm" title="{{ form.translation_interface.heading }}" class="hidden">
13
+ <p>{{ form.translation_interface.pb_warning }}</p>
14
+ <input type="hidden" class="ok-button" value="{{ form.translation_interface.pb_warning_ok_button }}" />
15
+ <input type="hidden" class="cancel-button" value="{{ form.translation_interface.pb_warning_cancel_button }}"/>
16
+ </div>
17
+
18
  <ul>
19
  <li>
20
  <input type="radio" name="trnsl_interface" value="{{ wpml_translation }}"
templates/setup/translation-options.twig ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h1>{{ strings.heading }}</h1>
2
+
3
+ <p>{{ strings.description }}</p>
4
+
5
+ <ul class="no-bullets">
6
+ <li>
7
+ <label>
8
+ <input type="radio" value="1" name="translation-option" {% if is_display_as_translated_checked %}checked="checked"{% endif %} />
9
+ {{ strings.label_display_as_translated|raw }}
10
+ </label>
11
+ </li>
12
+ <li>
13
+ <label>
14
+ <input type="radio" value="2" name="translation-option" />
15
+ {{ strings.label_translated }}
16
+ </label>
17
+ </li>
18
+ </ul>
19
+
20
+ <p>{{ strings.description_footer|format('<strong>','</strong>')|raw }}</p>
21
+
22
+ <p class="wcml-setup-actions step">
23
+ <a href="{{ continue_url }}" class="button button-large button-primary submit">{{ strings.continue }}</a>
24
+ </p>
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit0f07622f9161d526755751a06b94b887::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitb886f0e360e6838e613d0296417ff87d::getLoader();
vendor/autoload_52.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
- return ComposerAutoloaderInit7bcc7875eb86a79d191a7fd61af603ef::getLoader();
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
+ return ComposerAutoloaderInitfa2d9b0a98885165f0c584c602b01930::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -394,6 +394,7 @@ return array(
394
  'WCML_Setup_Multi_Currency_UI' => $baseDir . '/inc/template-classes/setup/class-wcml-setup-multi-currency-ui.php',
395
  'WCML_Setup_Ready_UI' => $baseDir . '/inc/template-classes/setup/class-wcml-setup-ready-ui.php',
396
  'WCML_Setup_Store_Pages_UI' => $baseDir . '/inc/template-classes/setup/class-wcml-setup-store-pages-ui.php',
 
397
  'WCML_Status_Config_Warnings_UI' => $baseDir . '/inc/template-classes/status/class-wcml-status-config-warnings-ui.php',
398
  'WCML_Status_Multi_Currencies_UI' => $baseDir . '/inc/template-classes/status/class-wcml-status-multi-currencies-ui.php',
399
  'WCML_Status_Products_UI' => $baseDir . '/inc/template-classes/status/class-wcml-status-products-ui.php',
394
  'WCML_Setup_Multi_Currency_UI' => $baseDir . '/inc/template-classes/setup/class-wcml-setup-multi-currency-ui.php',
395
  'WCML_Setup_Ready_UI' => $baseDir . '/inc/template-classes/setup/class-wcml-setup-ready-ui.php',
396
  'WCML_Setup_Store_Pages_UI' => $baseDir . '/inc/template-classes/setup/class-wcml-setup-store-pages-ui.php',
397
+ 'WCML_Setup_Translation_Options_UI' => $baseDir . '/inc/template-classes/setup/class-wcml-setup-translation-options-ui.php',
398
  'WCML_Status_Config_Warnings_UI' => $baseDir . '/inc/template-classes/status/class-wcml-status-config-warnings-ui.php',
399
  'WCML_Status_Multi_Currencies_UI' => $baseDir . '/inc/template-classes/status/class-wcml-status-multi-currencies-ui.php',
400
  'WCML_Status_Products_UI' => $baseDir . '/inc/template-classes/status/class-wcml-status-products-ui.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit0f07622f9161d526755751a06b94b887
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit0f07622f9161d526755751a06b94b887
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit0f07622f9161d526755751a06b94b887', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit0f07622f9161d526755751a06b94b887', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit0f07622f9161d526755751a06b94b887::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 ComposerAutoloaderInitb886f0e360e6838e613d0296417ff87d
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitb886f0e360e6838e613d0296417ff87d', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitb886f0e360e6838e613d0296417ff87d', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInitb886f0e360e6838e613d0296417ff87d::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 ComposerAutoloaderInit7bcc7875eb86a79d191a7fd61af603ef {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit7bcc7875eb86a79d191a7fd61af603ef {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit7bcc7875eb86a79d191a7fd61af603ef', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit7bcc7875eb86a79d191a7fd61af603ef', '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 ComposerAutoloaderInitfa2d9b0a98885165f0c584c602b01930 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitfa2d9b0a98885165f0c584c602b01930', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitfa2d9b0a98885165f0c584c602b01930', '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 ComposerStaticInit0f07622f9161d526755751a06b94b887
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'C' =>
@@ -426,6 +426,7 @@ class ComposerStaticInit0f07622f9161d526755751a06b94b887
426
  'WCML_Setup_Multi_Currency_UI' => __DIR__ . '/../..' . '/inc/template-classes/setup/class-wcml-setup-multi-currency-ui.php',
427
  'WCML_Setup_Ready_UI' => __DIR__ . '/../..' . '/inc/template-classes/setup/class-wcml-setup-ready-ui.php',
428
  'WCML_Setup_Store_Pages_UI' => __DIR__ . '/../..' . '/inc/template-classes/setup/class-wcml-setup-store-pages-ui.php',
 
429
  'WCML_Status_Config_Warnings_UI' => __DIR__ . '/../..' . '/inc/template-classes/status/class-wcml-status-config-warnings-ui.php',
430
  'WCML_Status_Multi_Currencies_UI' => __DIR__ . '/../..' . '/inc/template-classes/status/class-wcml-status-multi-currencies-ui.php',
431
  'WCML_Status_Products_UI' => __DIR__ . '/../..' . '/inc/template-classes/status/class-wcml-status-products-ui.php',
@@ -481,10 +482,10 @@ class ComposerStaticInit0f07622f9161d526755751a06b94b887
481
  public static function getInitializer(ClassLoader $loader)
482
  {
483
  return \Closure::bind(function () use ($loader) {
484
- $loader->prefixLengthsPsr4 = ComposerStaticInit0f07622f9161d526755751a06b94b887::$prefixLengthsPsr4;
485
- $loader->prefixDirsPsr4 = ComposerStaticInit0f07622f9161d526755751a06b94b887::$prefixDirsPsr4;
486
- $loader->prefixesPsr0 = ComposerStaticInit0f07622f9161d526755751a06b94b887::$prefixesPsr0;
487
- $loader->classMap = ComposerStaticInit0f07622f9161d526755751a06b94b887::$classMap;
488
 
489
  }, null, ClassLoader::class);
490
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitb886f0e360e6838e613d0296417ff87d
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'C' =>
426
  'WCML_Setup_Multi_Currency_UI' => __DIR__ . '/../..' . '/inc/template-classes/setup/class-wcml-setup-multi-currency-ui.php',
427
  'WCML_Setup_Ready_UI' => __DIR__ . '/../..' . '/inc/template-classes/setup/class-wcml-setup-ready-ui.php',
428
  'WCML_Setup_Store_Pages_UI' => __DIR__ . '/../..' . '/inc/template-classes/setup/class-wcml-setup-store-pages-ui.php',
429
+ 'WCML_Setup_Translation_Options_UI' => __DIR__ . '/../..' . '/inc/template-classes/setup/class-wcml-setup-translation-options-ui.php',
430
  'WCML_Status_Config_Warnings_UI' => __DIR__ . '/../..' . '/inc/template-classes/status/class-wcml-status-config-warnings-ui.php',
431
  'WCML_Status_Multi_Currencies_UI' => __DIR__ . '/../..' . '/inc/template-classes/status/class-wcml-status-multi-currencies-ui.php',
432
  'WCML_Status_Products_UI' => __DIR__ . '/../..' . '/inc/template-classes/status/class-wcml-status-products-ui.php',
482
  public static function getInitializer(ClassLoader $loader)
483
  {
484
  return \Closure::bind(function () use ($loader) {
485
+ $loader->prefixLengthsPsr4 = ComposerStaticInitb886f0e360e6838e613d0296417ff87d::$prefixLengthsPsr4;
486
+ $loader->prefixDirsPsr4 = ComposerStaticInitb886f0e360e6838e613d0296417ff87d::$prefixDirsPsr4;
487
+ $loader->prefixesPsr0 = ComposerStaticInitb886f0e360e6838e613d0296417ff87d::$prefixesPsr0;
488
+ $loader->classMap = ComposerStaticInitb886f0e360e6838e613d0296417ff87d::$classMap;
489
 
490
  }, null, ClassLoader::class);
491
  }
wpml-config.xml CHANGED
@@ -63,6 +63,7 @@
63
  <custom-field action="ignore">wpml_language</custom-field>
64
  <custom-field action="ignore">_product_attributes</custom-field>
65
  <custom-field action="translate">_children</custom-field>
 
66
  </custom-fields>
67
  <custom-types>
68
  <custom-type translate="1">product</custom-type>
63
  <custom-field action="ignore">wpml_language</custom-field>
64
  <custom-field action="ignore">_product_attributes</custom-field>
65
  <custom-field action="translate">_children</custom-field>
66
+ <custom-field action="copy">_subscription_limit</custom-field>
67
  </custom-fields>
68
  <custom-types>
69
  <custom-type translate="1">product</custom-type>
wpml-woocommerce.php CHANGED
@@ -7,17 +7,17 @@
7
  Author URI: http://www.onthegosystems.com/
8
  Text Domain: woocommerce-multilingual
9
  Requires at least: 3.9
10
- Tested up to: 4.8.1
11
- Version: 4.2.5
12
  WC requires at least: 2.1.0
13
- WC tested up to: 3.2.1
14
  */
15
 
16
  if ( defined( 'WCML_VERSION' ) ) {
17
  return;
18
  }
19
 
20
- define( 'WCML_VERSION', '4.2.5' );
21
  define( 'WCML_PLUGIN_PATH', dirname( __FILE__ ) );
22
  define( 'WCML_PLUGIN_FOLDER', basename( WCML_PLUGIN_PATH ) );
23
  define( 'WCML_LOCALE_PATH', WCML_PLUGIN_PATH . '/locale' );
7
  Author URI: http://www.onthegosystems.com/
8
  Text Domain: woocommerce-multilingual
9
  Requires at least: 3.9
10
+ Tested up to: 4.9
11
+ Version: 4.2.6
12
  WC requires at least: 2.1.0
13
+ WC tested up to: 3.2.4
14
  */
15
 
16
  if ( defined( 'WCML_VERSION' ) ) {
17
  return;
18
  }
19
 
20
+ define( 'WCML_VERSION', '4.2.6' );
21
  define( 'WCML_PLUGIN_PATH', dirname( __FILE__ ) );
22
  define( 'WCML_PLUGIN_FOLDER', basename( WCML_PLUGIN_PATH ) );
23
  define( 'WCML_LOCALE_PATH', WCML_PLUGIN_PATH . '/locale' );