WooCommerce Multilingual – run WooCommerce with WPML - Version 4.3.2

Version Description

  • Fixed an error when adding a product to cart in specific situations
  • Error while adding product to cart wit WC < 3.4.0
  • Fixed issue with product images not showing in translations
  • SW Product bundles error while activating
Download this release

Release Info

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

Code changes from version 4.3.1 to 4.3.2

changelog/4.3.2.md ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ # Fixes
2
+ * [wcml-2440] Fixed an error when adding a product to cart in specific situations
3
+ * [wcml-2439] Error while adding product to cart wit WC < 3.4.0
4
+ * [wcml-2437] Fixed issue with product images not showing in translations
5
+ * [wcml-2435] SW Product bundles error while activating
classes/media/class-wcml-product-image-filter-factory.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- class WCML_Product_Image_Filter_Factory implements IWPML_Frontend_Action_Loader, IWPML_Backend_Action_Loader {
4
-
5
- public function create() {
6
- global $sitepress;
7
-
8
- return new WCML_Product_Image_Filter( new WPML_Translation_Element_Factory( $sitepress ) );
9
- }
10
-
11
- }
 
 
 
 
 
 
 
 
 
 
 
classes/media/class-wcml-product-image-filter.php DELETED
@@ -1,39 +0,0 @@
1
- <?php
2
-
3
- class WCML_Product_Image_Filter implements IWPML_Action {
4
-
5
- /**
6
- * @var WPML_Translation_Element_Factory
7
- */
8
- private $translation_element_factory;
9
-
10
- public function __construct( WPML_Translation_Element_Factory $translation_element_factory ) {
11
- $this->translation_element_factory = $translation_element_factory;
12
- }
13
-
14
- public function add_hooks() {
15
- add_filter( 'get_post_metadata', array( $this, 'localize_image_id' ), 10, 3 );
16
- }
17
-
18
- public function localize_image_id( $value, $object_id, $meta_key ) {
19
- if ( '_thumbnail_id' === $meta_key &&
20
- in_array( get_post_type( $object_id ), array( 'product', 'product_variation' ) ) ) {
21
-
22
- remove_filter( 'get_post_metadata', array( $this, 'localize_image_id' ), 10, 3 );
23
- $meta_value = get_post_meta( $object_id, '_thumbnail_id', true );
24
- if ( empty( $meta_value ) ) {
25
- $post_element = $this->translation_element_factory->create( $object_id, 'post' );
26
- $source_element = $post_element->get_source_element();
27
- if ( null !== $source_element ) {
28
- $value = get_post_meta( $source_element->get_id(), '_thumbnail_id', true );
29
- }
30
-
31
- }
32
- add_filter( 'get_post_metadata', array( $this, 'localize_image_id' ), 10, 3 );
33
-
34
- }
35
-
36
- return $value;
37
- }
38
-
39
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/class-wcml-cart.php CHANGED
@@ -372,8 +372,14 @@ class WCML_Cart {
372
  */
373
  public function get_data_cart_hash( $cart_item ) {
374
 
375
- $hash_product_object = wc_get_product( $cart_item[ 'variation_id' ] ? $cart_item[ 'variation_id' ] : $cart_item[ 'product_id' ] );
376
- $data_hash = wc_get_cart_item_data_hash( $hash_product_object );
 
 
 
 
 
 
377
 
378
  return $data_hash;
379
  }
372
  */
373
  public function get_data_cart_hash( $cart_item ) {
374
 
375
+ $data_hash = '';
376
+
377
+ if ( function_exists( 'wc_get_cart_item_data_hash' ) ) {
378
+ $hash_product_object = wc_get_product( $cart_item['variation_id'] ? $cart_item['variation_id'] : $cart_item['product_id'] );
379
+ if( $hash_product_object ){
380
+ $data_hash = wc_get_cart_item_data_hash( $hash_product_object );
381
+ }
382
+ }
383
 
384
  return $data_hash;
385
  }
inc/class-wcml-compatibility.php CHANGED
@@ -62,7 +62,7 @@ class WCML_Compatibility {
62
  }
63
 
64
  //Product Bundle
65
- if ( class_exists( 'WC_Product_Bundle' ) ) {
66
  if ( version_compare( WC_PB()->version, '5.0.0', '<' ) ) {
67
  $this->product_bundles = new WCML_Product_Bundles_Legacy( $this->sitepress, $this->woocommerce_wpml, $this->tp );
68
  $this->product_bundles->add_hooks();
62
  }
63
 
64
  //Product Bundle
65
+ if ( class_exists( 'WC_Product_Bundle' ) && function_exists( 'WC_PB' ) ) {
66
  if ( version_compare( WC_PB()->version, '5.0.0', '<' ) ) {
67
  $this->product_bundles = new WCML_Product_Bundles_Legacy( $this->sitepress, $this->woocommerce_wpml, $this->tp );
68
  $this->product_bundles->add_hooks();
inc/missing-php-functions.php CHANGED
@@ -156,6 +156,3 @@ if ( !is_admin() && ! function_exists( 'woocommerce_wp_text_input' ) ) {
156
  echo '</p>';
157
  }
158
  }
159
-
160
-
161
- ?>
156
  echo '</p>';
157
  }
158
  }
 
 
 
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.6
8
- Stable tag: 4.3.1
9
 
10
  Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
11
 
@@ -140,6 +140,12 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
140
 
141
  == Changelog ==
142
 
 
 
 
 
 
 
143
  = 4.3.1 =
144
  * Error in WCML_Currency_Switcher_Templates while activating
145
  * Fix an issue where New order admin email subject and heading were overwrites with wrong data
5
  License: GPLv2
6
  Requires at least: 3.9
7
  Tested up to: 4.9.6
8
+ Stable tag: 4.3.2
9
 
10
  Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
11
 
140
 
141
  == Changelog ==
142
 
143
+ = 4.3.2 =
144
+ * Fixed an error when adding a product to cart in specific situations
145
+ * Error while adding product to cart wit WC < 3.4.0
146
+ * Fixed issue with product images not showing in translations
147
+ * SW Product bundles error while activating
148
+
149
  = 4.3.1 =
150
  * Error in WCML_Currency_Switcher_Templates while activating
151
  * Fix an issue where New order admin email subject and heading were overwrites with wrong data
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit3f1d8b16640b4a043111685fe8a5c948::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit05f5b43addf06b2d78e3926664637a1a::getLoader();
vendor/autoload_52.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
- return ComposerAutoloaderInitb17d424ee73e0a81816859dad3c7a3e6::getLoader();
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
+ return ComposerAutoloaderInit3623574b351c16de2361ae5d445aa7fa::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -388,8 +388,6 @@ return array(
388
  'WCML_Product_Bundles_Legacy' => $baseDir . '/compatibility/class-wcml-product-bundles-legacy.php',
389
  'WCML_Product_Gallery_Filter' => $baseDir . '/classes/media/class-wcml-product-gallery-filter.php',
390
  'WCML_Product_Gallery_Filter_Factory' => $baseDir . '/classes/media/class-wcml-product-gallery-filter-factory.php',
391
- 'WCML_Product_Image_Filter' => $baseDir . '/classes/media/class-wcml-product-image-filter.php',
392
- 'WCML_Product_Image_Filter_Factory' => $baseDir . '/classes/media/class-wcml-product-image-filter-factory.php',
393
  'WCML_Products' => $baseDir . '/inc/class-wcml-products.php',
394
  'WCML_Products_Screen_Options' => $baseDir . '/inc/class-wcml-products-screen-options.php',
395
  'WCML_Products_UI' => $baseDir . '/inc/template-classes/class-wcml-products-ui.php',
388
  'WCML_Product_Bundles_Legacy' => $baseDir . '/compatibility/class-wcml-product-bundles-legacy.php',
389
  'WCML_Product_Gallery_Filter' => $baseDir . '/classes/media/class-wcml-product-gallery-filter.php',
390
  'WCML_Product_Gallery_Filter_Factory' => $baseDir . '/classes/media/class-wcml-product-gallery-filter-factory.php',
 
 
391
  'WCML_Products' => $baseDir . '/inc/class-wcml-products.php',
392
  'WCML_Products_Screen_Options' => $baseDir . '/inc/class-wcml-products-screen-options.php',
393
  'WCML_Products_UI' => $baseDir . '/inc/template-classes/class-wcml-products-ui.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit3f1d8b16640b4a043111685fe8a5c948
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit3f1d8b16640b4a043111685fe8a5c948
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit3f1d8b16640b4a043111685fe8a5c948', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit3f1d8b16640b4a043111685fe8a5c948', '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\ComposerStaticInit3f1d8b16640b4a043111685fe8a5c948::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 ComposerAutoloaderInit05f5b43addf06b2d78e3926664637a1a
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit05f5b43addf06b2d78e3926664637a1a', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit05f5b43addf06b2d78e3926664637a1a', '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\ComposerStaticInit05f5b43addf06b2d78e3926664637a1a::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 ComposerAutoloaderInitb17d424ee73e0a81816859dad3c7a3e6 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitb17d424ee73e0a81816859dad3c7a3e6 {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitb17d424ee73e0a81816859dad3c7a3e6', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitb17d424ee73e0a81816859dad3c7a3e6', '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 ComposerAutoloaderInit3623574b351c16de2361ae5d445aa7fa {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit3623574b351c16de2361ae5d445aa7fa', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit3623574b351c16de2361ae5d445aa7fa', '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 ComposerStaticInit3f1d8b16640b4a043111685fe8a5c948
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'C' =>
@@ -420,8 +420,6 @@ class ComposerStaticInit3f1d8b16640b4a043111685fe8a5c948
420
  'WCML_Product_Bundles_Legacy' => __DIR__ . '/../..' . '/compatibility/class-wcml-product-bundles-legacy.php',
421
  'WCML_Product_Gallery_Filter' => __DIR__ . '/../..' . '/classes/media/class-wcml-product-gallery-filter.php',
422
  'WCML_Product_Gallery_Filter_Factory' => __DIR__ . '/../..' . '/classes/media/class-wcml-product-gallery-filter-factory.php',
423
- 'WCML_Product_Image_Filter' => __DIR__ . '/../..' . '/classes/media/class-wcml-product-image-filter.php',
424
- 'WCML_Product_Image_Filter_Factory' => __DIR__ . '/../..' . '/classes/media/class-wcml-product-image-filter-factory.php',
425
  'WCML_Products' => __DIR__ . '/../..' . '/inc/class-wcml-products.php',
426
  'WCML_Products_Screen_Options' => __DIR__ . '/../..' . '/inc/class-wcml-products-screen-options.php',
427
  'WCML_Products_UI' => __DIR__ . '/../..' . '/inc/template-classes/class-wcml-products-ui.php',
@@ -515,10 +513,10 @@ class ComposerStaticInit3f1d8b16640b4a043111685fe8a5c948
515
  public static function getInitializer(ClassLoader $loader)
516
  {
517
  return \Closure::bind(function () use ($loader) {
518
- $loader->prefixLengthsPsr4 = ComposerStaticInit3f1d8b16640b4a043111685fe8a5c948::$prefixLengthsPsr4;
519
- $loader->prefixDirsPsr4 = ComposerStaticInit3f1d8b16640b4a043111685fe8a5c948::$prefixDirsPsr4;
520
- $loader->prefixesPsr0 = ComposerStaticInit3f1d8b16640b4a043111685fe8a5c948::$prefixesPsr0;
521
- $loader->classMap = ComposerStaticInit3f1d8b16640b4a043111685fe8a5c948::$classMap;
522
 
523
  }, null, ClassLoader::class);
524
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit05f5b43addf06b2d78e3926664637a1a
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'C' =>
420
  'WCML_Product_Bundles_Legacy' => __DIR__ . '/../..' . '/compatibility/class-wcml-product-bundles-legacy.php',
421
  'WCML_Product_Gallery_Filter' => __DIR__ . '/../..' . '/classes/media/class-wcml-product-gallery-filter.php',
422
  'WCML_Product_Gallery_Filter_Factory' => __DIR__ . '/../..' . '/classes/media/class-wcml-product-gallery-filter-factory.php',
 
 
423
  'WCML_Products' => __DIR__ . '/../..' . '/inc/class-wcml-products.php',
424
  'WCML_Products_Screen_Options' => __DIR__ . '/../..' . '/inc/class-wcml-products-screen-options.php',
425
  'WCML_Products_UI' => __DIR__ . '/../..' . '/inc/template-classes/class-wcml-products-ui.php',
513
  public static function getInitializer(ClassLoader $loader)
514
  {
515
  return \Closure::bind(function () use ($loader) {
516
+ $loader->prefixLengthsPsr4 = ComposerStaticInit05f5b43addf06b2d78e3926664637a1a::$prefixLengthsPsr4;
517
+ $loader->prefixDirsPsr4 = ComposerStaticInit05f5b43addf06b2d78e3926664637a1a::$prefixDirsPsr4;
518
+ $loader->prefixesPsr0 = ComposerStaticInit05f5b43addf06b2d78e3926664637a1a::$prefixesPsr0;
519
+ $loader->classMap = ComposerStaticInit05f5b43addf06b2d78e3926664637a1a::$classMap;
520
 
521
  }, null, ClassLoader::class);
522
  }
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.6
11
- Version: 4.3.1
12
  WC requires at least: 2.1.0
13
  WC tested up to: 3.4.2
14
  */
@@ -17,7 +17,7 @@ if ( defined( 'WCML_VERSION' ) ) {
17
  return;
18
  }
19
 
20
- define( 'WCML_VERSION', '4.3.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' );
@@ -61,7 +61,6 @@ function wcml_loader(){
61
  $xdomain_data->add_hooks();
62
 
63
  $loaders = array(
64
- 'WCML_Product_Image_Filter_Factory',
65
  'WCML_Product_Gallery_Filter_Factory',
66
  'WCML_Update_Product_Gallery_Translation_Factory',
67
  'WCML_Append_Gallery_To_Post_Media_Ids_Factory',
8
  Text Domain: woocommerce-multilingual
9
  Requires at least: 3.9
10
  Tested up to: 4.9.6
11
+ Version: 4.3.2
12
  WC requires at least: 2.1.0
13
  WC tested up to: 3.4.2
14
  */
17
  return;
18
  }
19
 
20
+ define( 'WCML_VERSION', '4.3.2' );
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' );
61
  $xdomain_data->add_hooks();
62
 
63
  $loaders = array(
 
64
  'WCML_Product_Gallery_Filter_Factory',
65
  'WCML_Update_Product_Gallery_Translation_Factory',
66
  'WCML_Append_Gallery_To_Post_Media_Ids_Factory',