问题概述
可下载产品的路径在原文和翻译之间始终保持同步。
临时解决方法
此问题已在 WooCommerce Multilingual 3.8.0 中修复。 更新即可在您的站点上解决此问题,因此只有在您还无法更新时,才需要此临时解决方法。
在wp-content/plugins/woocommerce-multilingual/inc/products.class.php中
在第 906 行,您需要将:
PHP
if( in_array( $key ,array( '_file_paths', '_downloadable_files' )) || ( isset($settings['translation-management']['custom_fields_translation'][$key]) && $settings['translation-management']['custom_fields_translation'][$key] == 1 ) ){
更改为:
PHP
if( ( $woocommerce_wpml->settings['file_path_sync'] && in_array( $key ,array( '_file_paths', '_downloadable_files' ) ) ) || ( isset($settings['translation-management']['custom_fields_translation'][$key]) && $settings['translation-management']['custom_fields_translation'][$key] == 1 ) ){
或者将此补丁应用到上述同一文件:5cfd9c862c0da207262c5da49d6608f7ae1d25d0.patch