WooCommerce Multilingual – run WooCommerce with WPML - Version 4.2.7.1

Version Description

  • Fatal error while updating to 4.2.7 with Woocommerce Bundles
Download this release

Release Info

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

Code changes from version 4.2.7 to 4.2.7.1

changelog/4.2.7.1.md ADDED
@@ -0,0 +1,2 @@
 
 
1
+ # Fixes
2
+ * [wcml-2266] Fatal error while updating to 4.2.7 with Woocommerce Bundles
changelog/4.2.7.md CHANGED
@@ -1,4 +1,5 @@
1
  # Fixes
 
2
  * [wcml-2258] Notices on front when Reset cart feature is enabled and WooCommerce version >= 2.3
3
  * [wcml-2256] Notice in edit order screen and empty comment added to the order (order note)
4
  * [wcml-2255] Woo Bundles product filtering for variable products does not work in second language
1
  # Fixes
2
+ * [wcml-2259] Translated attributes and "Display as translated" mode for products -> shows no variation in second language
3
  * [wcml-2258] Notices on front when Reset cart feature is enabled and WooCommerce version >= 2.3
4
  * [wcml-2256] Notice in edit order screen and empty comment added to the order (order note)
5
  * [wcml-2255] Woo Bundles product filtering for variable products does not work in second language
compatibility/class-wcml-product-bundles.php CHANGED
@@ -66,6 +66,8 @@ class WCML_Product_Bundles {
66
  add_filter( 'wcml_after_save_custom_prices', array( $this, 'update_bundles_base_price' ), 10, 4 );
67
  }
68
 
 
 
69
  }
70
 
71
  private function get_product_bundle_data( $bundle_id ) {
@@ -773,4 +775,46 @@ class WCML_Product_Bundles {
773
 
774
  return false;
775
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
776
  }
66
  add_filter( 'wcml_after_save_custom_prices', array( $this, 'update_bundles_base_price' ), 10, 4 );
67
  }
68
 
69
+ add_action( 'init', array( $this, 'upgrade_bundles_items_relationships' ) );
70
+
71
  }
72
 
73
  private function get_product_bundle_data( $bundle_id ) {
775
 
776
  return false;
777
  }
778
+
779
+ // #wcml-2241
780
+ public function upgrade_bundles_items_relationships() {
781
+
782
+ if ( ! get_option( 'wcml_upgrade_bundles_items_relationships' ) ) {
783
+
784
+ $bundled_items = $this->wpdb->get_results( "SELECT bundled_item_id, bundle_id, product_id FROM {$this->wpdb->prefix}woocommerce_bundled_items" );
785
+ $active_languages = $this->sitepress->get_active_languages();
786
+
787
+ foreach ( $bundled_items as $bundled_item ) {
788
+
789
+ if ( $this->woocommerce_wpml->products->is_original_product( $bundled_item->bundle_id ) ) {
790
+
791
+ foreach ( $active_languages as $lang ) {
792
+
793
+ if ( $lang['code'] !== $this->woocommerce_wpml->products->get_original_product_language( $bundled_item->bundle_id ) ) {
794
+
795
+ $translated_bundle_id = apply_filters( 'translate_object_id', $bundled_item->bundle_id, get_post_type( $bundled_item->bundle_id ), false, $lang['code'] );
796
+ $translated_product_id = apply_filters( 'translate_object_id', $bundled_item->product_id, get_post_type( $bundled_item->product_id ), false, $lang['code'] );
797
+
798
+ $translated_item_id = $this->wpdb->get_var( $this->wpdb->prepare(
799
+ "SELECT bundled_item_id FROM {$this->wpdb->prefix}woocommerce_bundled_items WHERE product_id=%d AND bundle_id=%d",
800
+ $translated_product_id, $translated_bundle_id
801
+ ) );
802
+
803
+ $this->wpdb->insert( $this->wpdb->prefix . 'woocommerce_bundled_itemmeta',
804
+ array(
805
+ 'bundled_item_id' => $bundled_item->bundled_item_id,
806
+ 'meta_key' => 'translation_item_id_of_' . $lang['code'],
807
+ 'meta_value' => $translated_item_id,
808
+ )
809
+ );
810
+ }
811
+ }
812
+ }
813
+ }
814
+
815
+ add_option( 'wcml_upgrade_bundles_items_relationships', true );
816
+
817
+ }
818
+ }
819
+
820
  }
inc/class-wcml-upgrade.php CHANGED
@@ -627,42 +627,6 @@ class WCML_Upgrade{
627
  update_option( '_wcml_settings', $wcml_settings );
628
  }
629
 
630
- global $wpdb, $woocommerce_wpml, $sitepress;
631
- // #wcml-2241
632
- if( $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->prefix.'woocommerce_bundled_itemmeta' ) ) ){
633
-
634
- $bundled_items = $wpdb->get_results( "SELECT bundled_item_id, bundle_id, product_id FROM {$wpdb->prefix}woocommerce_bundled_items" );
635
- $active_languages = $sitepress->get_active_languages();
636
-
637
- foreach( $bundled_items as $bundled_item ){
638
-
639
- if( $woocommerce_wpml->products->is_original_product( $bundled_item->bundle_id ) ){
640
-
641
- foreach( $active_languages as $lang ){
642
-
643
- if( $lang['code'] !== $woocommerce_wpml->products->get_original_product_language( $bundled_item->bundle_id ) ){
644
-
645
- $translated_bundle_id = apply_filters( 'translate_object_id', $bundled_item->bundle_id, get_post_type( $bundled_item->bundle_id ), false, $lang['code'] );
646
- $translated_product_id = apply_filters( 'translate_object_id', $bundled_item->product_id, get_post_type( $bundled_item->product_id ), false, $lang['code'] );
647
-
648
- $translated_item_id = $wpdb->get_var( $wpdb->prepare(
649
- "SELECT bundled_item_id FROM {$wpdb->prefix}woocommerce_bundled_items WHERE product_id=%d AND bundle_id=%d",
650
- $translated_product_id, $translated_bundle_id
651
- ) );
652
-
653
- $wpdb->insert( $wpdb->prefix . 'woocommerce_bundled_itemmeta',
654
- array(
655
- 'bundled_item_id' => $bundled_item->bundled_item_id,
656
- 'meta_key' => 'translation_item_id_of_'.$lang['code'],
657
- 'meta_value' => $translated_item_id,
658
- )
659
- );
660
- }
661
- }
662
- }
663
- }
664
- }
665
-
666
  }
667
 
668
  }
627
  update_option( '_wcml_settings', $wcml_settings );
628
  }
629
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
630
  }
631
 
632
  }
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: CMS, woocommerce, commerce, ecommerce, e-commerce, products, WPML, multili
5
  License: GPLv2
6
  Requires at least: 3.9
7
  Tested up to: 4.9.1
8
- Stable tag: 4.2.7
9
 
10
  Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
11
 
@@ -142,7 +142,11 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
142
 
143
  == Changelog ==
144
 
 
 
 
145
  = 4.2.7 =
 
146
  * Notices on front when Reset cart feature is enabled and WooCommerce version >= 2.3
147
  * Notice in edit order screen and empty comment added to the order (order note)
148
  * Woo Bundles product filtering for variable products does not work in second language
5
  License: GPLv2
6
  Requires at least: 3.9
7
  Tested up to: 4.9.1
8
+ Stable tag: 4.2.7.1
9
 
10
  Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
11
 
142
 
143
  == Changelog ==
144
 
145
+ = 4.2.7.1 =
146
+ * Fatal error while updating to 4.2.7 with Woocommerce Bundles
147
+
148
  = 4.2.7 =
149
+ * Translated attributes and "Display as translated" mode for products -> shows no variation in second language
150
  * Notices on front when Reset cart feature is enabled and WooCommerce version >= 2.3
151
  * Notice in edit order screen and empty comment added to the order (order note)
152
  * Woo Bundles product filtering for variable products does not work in second language
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderIniteac697898e7b8de14a985d0f073b2ba1::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit700c2931447cea63ebf64beae8bdd7e5::getLoader();
vendor/autoload_52.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
- return ComposerAutoloaderInitb70efbf85024fd6832eb8f90b8b53b87::getLoader();
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
+ return ComposerAutoloaderInit7553e033b450bd056d54dea34f8634ea::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderIniteac697898e7b8de14a985d0f073b2ba1
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderIniteac697898e7b8de14a985d0f073b2ba1
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderIniteac697898e7b8de14a985d0f073b2ba1', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderIniteac697898e7b8de14a985d0f073b2ba1', '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\ComposerStaticIniteac697898e7b8de14a985d0f073b2ba1::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 ComposerAutoloaderInit700c2931447cea63ebf64beae8bdd7e5
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit700c2931447cea63ebf64beae8bdd7e5', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit700c2931447cea63ebf64beae8bdd7e5', '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\ComposerStaticInit700c2931447cea63ebf64beae8bdd7e5::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 ComposerAutoloaderInitb70efbf85024fd6832eb8f90b8b53b87 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitb70efbf85024fd6832eb8f90b8b53b87 {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitb70efbf85024fd6832eb8f90b8b53b87', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitb70efbf85024fd6832eb8f90b8b53b87', '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 ComposerAutoloaderInit7553e033b450bd056d54dea34f8634ea {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit7553e033b450bd056d54dea34f8634ea', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit7553e033b450bd056d54dea34f8634ea', '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 ComposerStaticIniteac697898e7b8de14a985d0f073b2ba1
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'C' =>
@@ -482,10 +482,10 @@ class ComposerStaticIniteac697898e7b8de14a985d0f073b2ba1
482
  public static function getInitializer(ClassLoader $loader)
483
  {
484
  return \Closure::bind(function () use ($loader) {
485
- $loader->prefixLengthsPsr4 = ComposerStaticIniteac697898e7b8de14a985d0f073b2ba1::$prefixLengthsPsr4;
486
- $loader->prefixDirsPsr4 = ComposerStaticIniteac697898e7b8de14a985d0f073b2ba1::$prefixDirsPsr4;
487
- $loader->prefixesPsr0 = ComposerStaticIniteac697898e7b8de14a985d0f073b2ba1::$prefixesPsr0;
488
- $loader->classMap = ComposerStaticIniteac697898e7b8de14a985d0f073b2ba1::$classMap;
489
 
490
  }, null, ClassLoader::class);
491
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit700c2931447cea63ebf64beae8bdd7e5
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'C' =>
482
  public static function getInitializer(ClassLoader $loader)
483
  {
484
  return \Closure::bind(function () use ($loader) {
485
+ $loader->prefixLengthsPsr4 = ComposerStaticInit700c2931447cea63ebf64beae8bdd7e5::$prefixLengthsPsr4;
486
+ $loader->prefixDirsPsr4 = ComposerStaticInit700c2931447cea63ebf64beae8bdd7e5::$prefixDirsPsr4;
487
+ $loader->prefixesPsr0 = ComposerStaticInit700c2931447cea63ebf64beae8bdd7e5::$prefixesPsr0;
488
+ $loader->classMap = ComposerStaticInit700c2931447cea63ebf64beae8bdd7e5::$classMap;
489
 
490
  }, null, ClassLoader::class);
491
  }
wpml-woocommerce.php CHANGED
@@ -8,7 +8,7 @@
8
  Text Domain: woocommerce-multilingual
9
  Requires at least: 3.9
10
  Tested up to: 4.9
11
- Version: 4.2.7
12
  WC requires at least: 2.1.0
13
  WC tested up to: 3.2.5
14
  */
@@ -17,7 +17,7 @@ if ( defined( 'WCML_VERSION' ) ) {
17
  return;
18
  }
19
 
20
- define( 'WCML_VERSION', '4.2.7' );
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' );
8
  Text Domain: woocommerce-multilingual
9
  Requires at least: 3.9
10
  Tested up to: 4.9
11
+ Version: 4.2.7.1
12
  WC requires at least: 2.1.0
13
  WC tested up to: 3.2.5
14
  */
17
  return;
18
  }
19
 
20
+ define( 'WCML_VERSION', '4.2.7.1' );
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' );