Version Description
- Replaced deprecated jQuery function live()
- Fixed bug: language names not localized on products editor page
- Fixed bug: Can't set "Custom post type" to translate
- Fixed bug: Translation fields not visible - In certain circumstances (e.g. search) the translation fields corresponding to the translated languages were missing
- Fixed alignment for Update/Save button in the products translation editor
- Fixed bug: Default selection not copied to duplicate products
- Fixed bug: Price doesn't change when change language on the cart page when set "I will manage the pricing in each currency myself"
- Resolved one compatibility issue with Woosidebars
- Direct translators to the products translation editor automatically (instead of the standard post translation editor)
- Fixed bug: In some situations (different child categories with the same name) the wrong categories were set to a duplicated product.
- Enhancement: Add icons for products in the products translation editor
- Register WooCommerce strings (defined as admin texts in the wpml config file) automatically on plugin activation
- WPML (+addons) - new versions required.
- lcfirst is only available since php 5.3
- Identify fields on known plugins and show their human name in our product translation table (support for WordPress SEO for now)
Download this release
Release Info
Developer | AmirHelzer |
Plugin | WooCommerce Multilingual – run WooCommerce with WPML |
Version | 3.0.1 |
Comparing to | |
See all releases |
Code changes from version 3.0 to 3.0.1
- assets/css/management.css +20 -3
- assets/images/icon-woo-downloadable.png +0 -0
- assets/images/icon-woo-external.png +0 -0
- assets/images/icon-woo-grouped.png +0 -0
- assets/images/icon-woo-simple.png +0 -0
- assets/images/icon-woo-variable.png +0 -0
- assets/images/icon-woo-virtual.png +0 -0
- assets/js/cart_widget.js +5 -0
- assets/js/scripts.js +5 -4
- inc/currencies.class.php +39 -17
- inc/dependencies.class.php +35 -7
- inc/emails.class.php +32 -1
- inc/products.class.php +146 -120
- inc/store-pages.class.php +24 -5
- inc/terms.class.php +32 -10
- locale/orig/wpml-wcml.po +568 -591
- locale/wpml-wcml-ar.mo +0 -0
- locale/wpml-wcml-de_DE.mo +0 -0
- locale/wpml-wcml-el.mo +0 -0
- locale/wpml-wcml-es_ES.mo +0 -0
- locale/wpml-wcml-fr_FR.mo +0 -0
- locale/wpml-wcml-he_IL.mo +0 -0
- locale/wpml-wcml-it_IT.mo +0 -0
- locale/wpml-wcml-ja.mo +0 -0
- locale/wpml-wcml-ko_KO.mo +0 -0
- locale/wpml-wcml-nl_NL.mo +0 -0
- locale/wpml-wcml-pl_PL.mo +0 -0
- locale/wpml-wcml-pt_BR.mo +0 -0
- locale/wpml-wcml-pt_PT.mo +0 -0
- locale/wpml-wcml-ru_RU.mo +0 -0
- locale/wpml-wcml-sv_SE.mo +0 -0
- locale/wpml-wcml-vn.mo +0 -0
- locale/wpml-wcml-zh_CN.mo +0 -0
- locale/wpml-wcml-zh_TW.mo +0 -0
- menu/sub/products.php +29 -13
- readme.txt +30 -2
- woocommerce_wpml.class.php +52 -32
- wpml-config.xml +1 -47
- wpml-woocommerce.php +2 -2
assets/css/management.css
CHANGED
@@ -133,7 +133,7 @@
|
|
133 |
margin-left: 30px;
|
134 |
}
|
135 |
|
136 |
-
.wcml_products{
|
137 |
margin: 20px 0;
|
138 |
position: relative;
|
139 |
}
|
@@ -236,8 +236,10 @@
|
|
236 |
font-size: 16px;
|
237 |
vertical-align: middle;
|
238 |
position: static;
|
239 |
-
margin: 0
|
240 |
cursor: default;
|
|
|
|
|
241 |
}
|
242 |
|
243 |
.wcml_details{
|
@@ -671,4 +673,19 @@ textarea[disabled] {
|
|
671 |
|
672 |
.js-tax-translation li .actions{margin:3px 0 0 27px;}
|
673 |
|
674 |
-
.wcml_duplicate_product_notice td{border-bottom: none !important;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
margin-left: 30px;
|
134 |
}
|
135 |
|
136 |
+
.wcml_products {
|
137 |
margin: 20px 0;
|
138 |
position: relative;
|
139 |
}
|
236 |
font-size: 16px;
|
237 |
vertical-align: middle;
|
238 |
position: static;
|
239 |
+
margin: 0;
|
240 |
cursor: default;
|
241 |
+
width: 21px;
|
242 |
+
display: inline-block;
|
243 |
}
|
244 |
|
245 |
.wcml_details{
|
673 |
|
674 |
.js-tax-translation li .actions{margin:3px 0 0 27px;}
|
675 |
|
676 |
+
.wcml_duplicate_product_notice td{border-bottom: none !important;}
|
677 |
+
|
678 |
+
/* Icons */
|
679 |
+
[class^="icon-woo"] {
|
680 |
+
width: 24px;
|
681 |
+
height: 24px;
|
682 |
+
background-position: center center;
|
683 |
+
display: inline-block;
|
684 |
+
}
|
685 |
+
.icon-woo-simple { background-image: url('../images/icon-woo-simple.png'); }
|
686 |
+
.icon-woo-downloadable { background-image: url('../images/icon-woo-downloadable.png'); }
|
687 |
+
.icon-woo-external { background-image: url('../images/icon-woo-external.png'); }
|
688 |
+
.icon-woo-grouped { background-image: url('../images/icon-woo-grouped.png'); }
|
689 |
+
.icon-woo-variable { background-image: url('../images/icon-woo-variable.png'); }
|
690 |
+
.icon-woo-virtual { background-image: url('../images/icon-woo-virtual.png'); }
|
691 |
+
/* Icons END */
|
assets/images/icon-woo-downloadable.png
ADDED
Binary file
|
assets/images/icon-woo-external.png
ADDED
Binary file
|
assets/images/icon-woo-grouped.png
ADDED
Binary file
|
assets/images/icon-woo-simple.png
ADDED
Binary file
|
assets/images/icon-woo-variable.png
ADDED
Binary file
|
assets/images/icon-woo-virtual.png
ADDED
Binary file
|
assets/js/cart_widget.js
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function($){
|
2 |
+
sessionStorage.removeItem("wc_cart_hash");
|
3 |
+
sessionStorage.removeItem("wc_fragments");
|
4 |
+
});
|
5 |
+
|
assets/js/scripts.js
CHANGED
@@ -320,7 +320,8 @@ jQuery(document).ready(function($){
|
|
320 |
success: function(response) {
|
321 |
this_form.find('.icl_tt_sycn_preview').html(response.progress);
|
322 |
if(response.go){
|
323 |
-
this_form.find('input[name=last_post_id]').val(response.last_post_id)
|
|
|
324 |
this_form.trigger('submit');
|
325 |
}else{
|
326 |
this_form.find('input[name=last_post_id]').val(0);
|
@@ -428,10 +429,10 @@ jQuery(document).ready(function($){
|
|
428 |
var prod_id = jQuery(this).closest('div.wcml_product_row').attr('id');
|
429 |
|
430 |
if(text_area.val() != ''){
|
431 |
-
jQuery('
|
432 |
}else{
|
433 |
-
if(jQuery('
|
434 |
-
jQuery('
|
435 |
}
|
436 |
}
|
437 |
|
320 |
success: function(response) {
|
321 |
this_form.find('.icl_tt_sycn_preview').html(response.progress);
|
322 |
if(response.go){
|
323 |
+
this_form.find('input[name=last_post_id]').val(response.last_post_id);
|
324 |
+
this_form.find('input[name=languages_processed]').val(response.languages_processed);
|
325 |
this_form.trigger('submit');
|
326 |
}else{
|
327 |
this_form.find('input[name=last_post_id]').val(0);
|
429 |
var prod_id = jQuery(this).closest('div.wcml_product_row').attr('id');
|
430 |
|
431 |
if(text_area.val() != ''){
|
432 |
+
jQuery(this).closest('tr').find('.wcml_field_translation_' + text_area.attr('name')).hide();
|
433 |
}else{
|
434 |
+
if(jQuery(this).closest('tr').find('.wcml_field_translation_' + text_area.attr('name')).length){
|
435 |
+
jQuery(this).closest('tr').find('.wcml_field_translation_' + text_area.attr('name')).show();
|
436 |
}
|
437 |
}
|
438 |
|
inc/currencies.class.php
CHANGED
@@ -1,19 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
class WCML_Currencies{
|
4 |
-
|
5 |
-
private $default_currencies = array(
|
6 |
-
'BRL' => 'R$',
|
7 |
-
'USD' => '$',
|
8 |
-
'EUR' => '€',
|
9 |
-
'JPY' => '¥',
|
10 |
-
'TRY' => 'TL',
|
11 |
-
'NOK' => 'kr',
|
12 |
-
'ZAR' => 'R',
|
13 |
-
'CZK' => 'Kč',
|
14 |
-
'GBP' => '£'
|
15 |
-
);
|
16 |
-
|
17 |
private $currencies = false;
|
18 |
|
19 |
|
@@ -42,6 +30,8 @@ class WCML_Currencies{
|
|
42 |
add_filter('woocommerce_order_amount_shipping', array($this, 'woocommerce_price_filter'));
|
43 |
add_filter('woocommerce_order_amount_total_tax', array($this, 'woocommerce_price_filter'));
|
44 |
add_filter('woocommerce_order_amount_cart_discount',array($this, 'woocommerce_price_filter'));
|
|
|
|
|
45 |
}
|
46 |
|
47 |
add_filter('woocommerce_price_filter_min_price', array($this, 'price_filter_min_price'));
|
@@ -86,6 +76,38 @@ class WCML_Currencies{
|
|
86 |
|
87 |
}
|
88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
/**
|
90 |
* Filters the currency symbol.
|
91 |
*/
|
@@ -104,9 +126,9 @@ class WCML_Currencies{
|
|
104 |
|
105 |
if($db_currency && $woocommerce_wpml->settings['enable_multi_currency'] == 'yes'){
|
106 |
$db_currency = $db_currency->code;
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
$currency_symbol = $db_currency;
|
111 |
}
|
112 |
}
|
@@ -220,7 +242,7 @@ class WCML_Currencies{
|
|
220 |
?>
|
221 |
<tr>
|
222 |
<td>
|
223 |
-
<img src="<?php echo ICL_PLUGIN_URL ?>/res/flags/<?php echo $language['code'] ?>.png" width="18" height="12" class="flag_img"/><?php echo $language['
|
224 |
</td>
|
225 |
<td>
|
226 |
<select name="currency_for[<?php echo $language['code']; ?>]">
|
1 |
<?php
|
2 |
|
3 |
class WCML_Currencies{
|
4 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
private $currencies = false;
|
6 |
|
7 |
|
30 |
add_filter('woocommerce_order_amount_shipping', array($this, 'woocommerce_price_filter'));
|
31 |
add_filter('woocommerce_order_amount_total_tax', array($this, 'woocommerce_price_filter'));
|
32 |
add_filter('woocommerce_order_amount_cart_discount',array($this, 'woocommerce_price_filter'));
|
33 |
+
}else{
|
34 |
+
add_action('woocommerce_before_calculate_totals',array($this,'woocommerce_calculate_totals'));
|
35 |
}
|
36 |
|
37 |
add_filter('woocommerce_price_filter_min_price', array($this, 'price_filter_min_price'));
|
76 |
|
77 |
}
|
78 |
|
79 |
+
function woocommerce_calculate_totals($cart){
|
80 |
+
global $sitepress, $woocommerce;
|
81 |
+
$current_language = $sitepress->get_current_language();
|
82 |
+
|
83 |
+
foreach($cart->cart_contents as $key=>$cart_item){
|
84 |
+
$tr_product_id = icl_object_id($cart_item['product_id'],'product',false,$current_language);
|
85 |
+
if(isset($cart->cart_contents[$key]['variation_id']) && $cart->cart_contents[$key]['variation_id']){
|
86 |
+
$tr_variation_id = icl_object_id($cart_item['variation_id'],'product_variation',false,$current_language);
|
87 |
+
if(!is_null($tr_variation_id)){
|
88 |
+
$price = get_post_meta($tr_variation_id,'_price',true);
|
89 |
+
$cart->cart_contents[$key]['product_id'] = $tr_product_id;
|
90 |
+
$cart->cart_contents[$key]['variation_id'] = $tr_variation_id;
|
91 |
+
$cart->cart_contents[$key]['data'] = get_product( $tr_variation_id );
|
92 |
+
if($cart_item['variation']){
|
93 |
+
foreach($cart_item['variation'] as $attr_key=>$attribute){
|
94 |
+
$trns_attr = get_post_meta($tr_variation_id,'attribute_'.$attr_key,true);
|
95 |
+
$cart->cart_contents[$key]['variation'][$attr_key] = $trns_attr;
|
96 |
+
}
|
97 |
+
}
|
98 |
+
}
|
99 |
+
}else{
|
100 |
+
if(!is_null($tr_product_id)){
|
101 |
+
$price = get_post_meta($tr_product_id,'_price',true);
|
102 |
+
$cart->cart_contents[$key]['product_id'] = $tr_product_id;
|
103 |
+
$cart->cart_contents[$key]['data'] = get_product( $tr_product_id );
|
104 |
+
}
|
105 |
+
}
|
106 |
+
}
|
107 |
+
$woocommerce->session->cart = $cart;
|
108 |
+
return $cart;
|
109 |
+
}
|
110 |
+
|
111 |
/**
|
112 |
* Filters the currency symbol.
|
113 |
*/
|
126 |
|
127 |
if($db_currency && $woocommerce_wpml->settings['enable_multi_currency'] == 'yes'){
|
128 |
$db_currency = $db_currency->code;
|
129 |
+
remove_filter('woocommerce_currency_symbol',array($this,'woocommerce_currency_symbol_filter'),2);
|
130 |
+
$currency_symbol = get_woocommerce_currency_symbol($db_currency);
|
131 |
+
if(!$currency_symbol){
|
132 |
$currency_symbol = $db_currency;
|
133 |
}
|
134 |
}
|
242 |
?>
|
243 |
<tr>
|
244 |
<td>
|
245 |
+
<img src="<?php echo ICL_PLUGIN_URL ?>/res/flags/<?php echo $language['code'] ?>.png" width="18" height="12" class="flag_img"/><?php echo $language['display_name'] ?>
|
246 |
</td>
|
247 |
<td>
|
248 |
<select name="currency_for[<?php echo $language['code']; ?>]">
|
inc/dependencies.class.php
CHANGED
@@ -17,7 +17,7 @@ class WCML_Dependencies{
|
|
17 |
$this->missing['WPML'] = 'http://wpml.org';
|
18 |
$allok = false;
|
19 |
}
|
20 |
-
} else if(version_compare(ICL_SITEPRESS_VERSION, '
|
21 |
add_action('admin_notices', array($this, '_old_wpml_warning'));
|
22 |
$allok = false;
|
23 |
}
|
@@ -30,39 +30,67 @@ class WCML_Dependencies{
|
|
30 |
if(!defined('WPML_TM_VERSION')){
|
31 |
$this->missing['WPML Translation Management'] = 'http://wpml.org';
|
32 |
$allok = false;
|
|
|
|
|
|
|
33 |
}
|
34 |
|
35 |
if(!defined('WPML_ST_VERSION')){
|
36 |
$this->missing['WPML String Translation'] = 'http://wpml.org';
|
37 |
$allok = false;
|
|
|
|
|
|
|
38 |
}
|
39 |
|
40 |
if(is_admin() && !defined('WPML_MEDIA_VERSION')){
|
41 |
$this->missing['WPML Media'] = 'http://wpml.org';
|
42 |
$allok = false;
|
|
|
|
|
|
|
43 |
}
|
44 |
|
45 |
-
if (
|
46 |
add_action('admin_notices', array($this, '_missing_plugins_warning'));
|
47 |
-
return false;
|
48 |
}
|
49 |
|
50 |
-
$
|
51 |
-
|
|
|
|
|
|
|
52 |
}
|
53 |
|
54 |
/**
|
55 |
* Adds admin notice.
|
56 |
*/
|
57 |
function _old_wpml_warning(){ ?>
|
58 |
-
<div class="message error"><p><?php printf(__('WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href="%s">WPML</a> versions prior
|
59 |
-
'wpml-wcml'), 'http://wpml.org/'); ?></p></div>
|
|
|
|
|
|
|
|
|
|
|
60 |
<?php }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
/**
|
63 |
* Adds admin notice.
|
64 |
*/
|
65 |
function _missing_plugins_warning(){
|
|
|
66 |
$missing = '';
|
67 |
$counter = 0;
|
68 |
foreach ($this->missing as $title => $url) {
|
17 |
$this->missing['WPML'] = 'http://wpml.org';
|
18 |
$allok = false;
|
19 |
}
|
20 |
+
} else if(version_compare(ICL_SITEPRESS_VERSION, '3.0', '<')){
|
21 |
add_action('admin_notices', array($this, '_old_wpml_warning'));
|
22 |
$allok = false;
|
23 |
}
|
30 |
if(!defined('WPML_TM_VERSION')){
|
31 |
$this->missing['WPML Translation Management'] = 'http://wpml.org';
|
32 |
$allok = false;
|
33 |
+
}elseif(version_compare(WPML_TM_VERSION, '1.9', '<')){
|
34 |
+
add_action('admin_notices', array($this, '_old_wpml_tm_warning'));
|
35 |
+
$allok = false;
|
36 |
}
|
37 |
|
38 |
if(!defined('WPML_ST_VERSION')){
|
39 |
$this->missing['WPML String Translation'] = 'http://wpml.org';
|
40 |
$allok = false;
|
41 |
+
}elseif(version_compare(WPML_ST_VERSION, '2.0', '<')){
|
42 |
+
add_action('admin_notices', array($this, '_old_wpml_st_warning'));
|
43 |
+
$allok = false;
|
44 |
}
|
45 |
|
46 |
if(is_admin() && !defined('WPML_MEDIA_VERSION')){
|
47 |
$this->missing['WPML Media'] = 'http://wpml.org';
|
48 |
$allok = false;
|
49 |
+
}elseif(version_compare(WPML_MEDIA_VERSION, '2.1', '<')){
|
50 |
+
add_action('admin_notices', array($this, '_old_wpml_media_warning'));
|
51 |
+
$allok = false;
|
52 |
}
|
53 |
|
54 |
+
if ($this->missing) {
|
55 |
add_action('admin_notices', array($this, '_missing_plugins_warning'));
|
|
|
56 |
}
|
57 |
|
58 |
+
if($allok){
|
59 |
+
$this->check_for_incompatible_permalinks();
|
60 |
+
}
|
61 |
+
|
62 |
+
return $allok;
|
63 |
}
|
64 |
|
65 |
/**
|
66 |
* Adds admin notice.
|
67 |
*/
|
68 |
function _old_wpml_warning(){ ?>
|
69 |
+
<div class="message error"><p><?php printf(__('WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href="%s">WPML</a> versions prior %s.',
|
70 |
+
'wpml-wcml'), 'http://wpml.org/', '3.0'); ?></p></div>
|
71 |
+
<?php }
|
72 |
+
|
73 |
+
function _old_wpml_tm_warning(){ ?>
|
74 |
+
<div class="message error"><p><?php printf(__('WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href="%s">WPML Translation Management</a> versions prior %s.',
|
75 |
+
'wpml-wcml'), 'http://wpml.org/', '1.9'); ?></p></div>
|
76 |
<?php }
|
77 |
+
|
78 |
+
function _old_wpml_st_warning(){ ?>
|
79 |
+
<div class="message error"><p><?php printf(__('WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href="%s">WPML String Translation</a> versions prior %s.',
|
80 |
+
'wpml-wcml'), 'http://wpml.org/', '2.0'); ?></p></div>
|
81 |
+
<?php }
|
82 |
+
|
83 |
+
function _old_wpml_media_warning(){ ?>
|
84 |
+
<div class="message error"><p><?php printf(__('WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href="%s">WPML Media</a> versions prior %s.',
|
85 |
+
'wpml-wcml'), 'http://wpml.org/', '2.1'); ?></p></div>
|
86 |
+
<?php }
|
87 |
+
|
88 |
|
89 |
/**
|
90 |
* Adds admin notice.
|
91 |
*/
|
92 |
function _missing_plugins_warning(){
|
93 |
+
|
94 |
$missing = '';
|
95 |
$counter = 0;
|
96 |
foreach ($this->missing as $title => $url) {
|
inc/emails.class.php
CHANGED
@@ -16,6 +16,8 @@ class WCML_Emails{
|
|
16 |
add_filter('woocommerce_before_resend_order_emails', array($this, 'email_header'));
|
17 |
add_filter('woocommerce_after_resend_order_email', array($this, 'email_footer'));
|
18 |
|
|
|
|
|
19 |
}
|
20 |
|
21 |
/**
|
@@ -26,7 +28,7 @@ class WCML_Emails{
|
|
26 |
* @return type
|
27 |
*/
|
28 |
function email_header($order) {
|
29 |
-
global $sitepress;
|
30 |
|
31 |
if (is_array($order)) {
|
32 |
$order = $order['order_id'];
|
@@ -37,6 +39,9 @@ class WCML_Emails{
|
|
37 |
$lang = get_post_meta($order, 'wpml_language', TRUE);
|
38 |
if(!empty($lang)){
|
39 |
$sitepress->switch_lang($lang, true);
|
|
|
|
|
|
|
40 |
}
|
41 |
}
|
42 |
|
@@ -53,4 +58,30 @@ class WCML_Emails{
|
|
53 |
}
|
54 |
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
}
|
16 |
add_filter('woocommerce_before_resend_order_emails', array($this, 'email_header'));
|
17 |
add_filter('woocommerce_after_resend_order_email', array($this, 'email_footer'));
|
18 |
|
19 |
+
//WPML job link
|
20 |
+
add_filter('icl_job_edit_url',array($this,'icl_job_edit_url'),10 ,2);
|
21 |
}
|
22 |
|
23 |
/**
|
28 |
* @return type
|
29 |
*/
|
30 |
function email_header($order) {
|
31 |
+
global $sitepress,$woocommerce;
|
32 |
|
33 |
if (is_array($order)) {
|
34 |
$order = $order['order_id'];
|
39 |
$lang = get_post_meta($order, 'wpml_language', TRUE);
|
40 |
if(!empty($lang)){
|
41 |
$sitepress->switch_lang($lang, true);
|
42 |
+
$domain = 'woocommerce';
|
43 |
+
unload_textdomain($domain);
|
44 |
+
$woocommerce->load_plugin_textdomain();
|
45 |
}
|
46 |
}
|
47 |
|
58 |
}
|
59 |
|
60 |
|
61 |
+
function icl_job_edit_url($link,$job_id){
|
62 |
+
global $wpdb,$sitepress;
|
63 |
+
|
64 |
+
$trid = $wpdb->get_var($wpdb->prepare("
|
65 |
+
SELECT t.trid
|
66 |
+
FROM {$wpdb->prefix}icl_translate_job j
|
67 |
+
JOIN {$wpdb->prefix}icl_translation_status s ON j.rid = s.rid
|
68 |
+
JOIN {$wpdb->prefix}icl_translations t ON s.translation_id = t.translation_id
|
69 |
+
WHERE j.job_id = %d
|
70 |
+
", $job_id));
|
71 |
+
|
72 |
+
if($trid){
|
73 |
+
$original_product_id = $wpdb->get_var($wpdb->prepare("
|
74 |
+
SELECT element_id
|
75 |
+
FROM {$wpdb->prefix}icl_translations
|
76 |
+
WHERE trid = %d AND element_type = 'post_product' AND language_code = '%s'
|
77 |
+
", $trid,$sitepress->get_default_language()));
|
78 |
+
|
79 |
+
if($original_product_id){
|
80 |
+
$link = admin_url('admin.php?page=wpml-wcml&tab=products&prid='.$original_product_id);
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
return $link;
|
85 |
+
}
|
86 |
+
|
87 |
}
|
inc/products.class.php
CHANGED
@@ -3,18 +3,21 @@
|
|
3 |
class WCML_Products{
|
4 |
|
5 |
private $not_display_fields_for_variables_product = array('_regular_price','_sale_price','_price','_min_variation_price','_max_variation_price','_min_variation_regular_price','_max_variation_regular_price','_min_variation_sale_price','_max_variation_sale_price');
|
|
|
|
|
6 |
|
7 |
function __construct(){
|
8 |
|
9 |
add_action('init', array($this, 'init'));
|
|
|
10 |
|
11 |
}
|
12 |
|
13 |
function init(){
|
14 |
|
15 |
if(is_admin()){
|
16 |
-
add_action('wp_ajax_wcml_update_product', array($this,'update_product_actions'));
|
17 |
-
|
18 |
add_filter('wpml_post_edit_page_link_to_translation',array($this,'_filter_link_to_translation'));
|
19 |
add_action('admin_init', array($this, 'restrict_admin_with_redirect'));
|
20 |
|
@@ -24,13 +27,11 @@ class WCML_Products{
|
|
24 |
add_action('admin_init', array($this, 'make_new_attributes_translatable'));
|
25 |
|
26 |
// filters to sync variable products
|
27 |
-
add_action('save_post', array($this, '
|
28 |
//when save new attachment duplicate product gallery
|
29 |
add_action('wpml_media_create_duplicate_attachment', array($this,'sync_product_gallery_duplicate_attachment'),11,2);
|
30 |
-
|
31 |
-
add_filter('
|
32 |
-
|
33 |
-
add_filter('icl_make_duplicate', array($this, 'sync_variations_for_duplicates'), 11, 4);
|
34 |
|
35 |
//remove media sync on product page
|
36 |
add_action('admin_head', array($this,'remove_language_options'),11);
|
@@ -38,8 +39,9 @@ class WCML_Products{
|
|
38 |
add_action('admin_print_scripts', array($this,'preselect_product_type_in_admin_screen'), 11);
|
39 |
|
40 |
add_filter('woocommerce_json_search_found_products', array($this, 'woocommerce_json_search_found_products'));
|
|
|
41 |
}
|
42 |
-
|
43 |
add_filter('wpml_link_to_translation',array($this,'_filter_link_to_translation'));
|
44 |
|
45 |
add_filter('woocommerce_json_search_found_products', array($this, 'filter_found_products_by_language'));
|
@@ -98,6 +100,18 @@ class WCML_Products{
|
|
98 |
}
|
99 |
}
|
100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
}
|
102 |
|
103 |
function get_product($product_id) {
|
@@ -178,7 +192,7 @@ class WCML_Products{
|
|
178 |
* $action - content action (duplicate or clean content)
|
179 |
*/
|
180 |
function product_test_content_action($products,$action,$lang = false,$no_redirect = false){
|
181 |
-
global $sitepress,$wpdb,$sitepress_settings
|
182 |
$languages = $sitepress->get_active_languages();
|
183 |
$default_language = $sitepress->get_default_language();
|
184 |
|
@@ -190,57 +204,19 @@ class WCML_Products{
|
|
190 |
$args = array();
|
191 |
switch ($action){
|
192 |
case 'duplicate':
|
193 |
-
if($language['code'] != $default_language
|
194 |
-
$
|
195 |
-
|
196 |
-
|
197 |
-
$args['post_type'] = $orig_product->post_type;
|
198 |
-
$args['post_content'] = $orig_product->post_content;
|
199 |
-
$args['post_excerpt'] = $orig_product->post_excerpt;
|
200 |
-
$args['post_status'] = $orig_product->post_status;
|
201 |
-
$args['menu_order'] = $orig_product->menu_order;
|
202 |
-
$args['ping_status'] = $orig_product->ping_status;
|
203 |
-
$args['comment_status'] = $orig_product->comment_status;
|
204 |
-
$product_parent = icl_object_id($orig_product->post_parent, 'product', false, $language['code']);
|
205 |
-
$args['post_parent'] = is_null($product_parent)?0:$product_parent;
|
206 |
-
$tr_product_id = wp_insert_post($args);
|
207 |
-
|
208 |
-
$trid = $sitepress->get_element_trid($product_id, 'post_' . $orig_product->post_type);
|
209 |
-
$sitepress->set_element_language_details($tr_product_id, 'post_' . $orig_product->post_type, $trid, $language['code']);
|
210 |
-
|
211 |
-
//create translation package
|
212 |
-
$translation_id = $wpdb->get_var($wpdb->prepare("
|
213 |
-
SELECT translation_id FROM {$wpdb->prefix}icl_translations WHERE trid=%d AND language_code='%s'
|
214 |
-
", $trid, $language['code']));
|
215 |
-
|
216 |
-
$md5 = $iclTranslationManagement->post_md5($orig_product);
|
217 |
-
$translation_package = $iclTranslationManagement->create_translation_package($product_id);
|
218 |
-
|
219 |
-
get_currentuserinfo();
|
220 |
-
$user_id = $current_user->ID;
|
221 |
-
|
222 |
-
list($rid, $update) = $iclTranslationManagement->update_translation_status(array(
|
223 |
-
'translation_id' => $translation_id,
|
224 |
-
'status' => ICL_TM_DUPLICATE,
|
225 |
-
'translator_id' => $user_id,
|
226 |
-
'needs_update' => 0,
|
227 |
-
'md5' => $md5,
|
228 |
-
'translation_service' => 'local',
|
229 |
-
'translation_package' => serialize($translation_package)
|
230 |
-
));
|
231 |
-
|
232 |
-
if(!$update){
|
233 |
-
$job_id = $iclTranslationManagement->add_translation_job($rid, $user_id , $translation_package);
|
234 |
}
|
235 |
|
236 |
-
|
237 |
|
238 |
//duplicate product attrs
|
239 |
$orig_product_attrs = $this->get_product_atributes($product_id);
|
240 |
add_post_meta($tr_product_id,'_product_attributes',$orig_product_attrs);
|
241 |
|
242 |
-
$this->
|
243 |
-
|
244 |
//sync media
|
245 |
$this->sync_thumbnail_id($product_id, $tr_product_id,$language['code']);
|
246 |
$this->sync_product_gallery($product_id);
|
@@ -255,7 +231,7 @@ class WCML_Products{
|
|
255 |
case 'clean':
|
256 |
if($language['code'] != $default_language && !is_null(icl_object_id($product_id, 'product', false, $language['code']))){
|
257 |
$tr_product_id = icl_object_id($product_id, 'product', false, $language['code']);
|
258 |
-
if(get_post_meta($tr_product_id,'
|
259 |
wp_delete_post($tr_product_id,true);
|
260 |
|
261 |
//delete taxonomies
|
@@ -279,7 +255,34 @@ class WCML_Products{
|
|
279 |
}
|
280 |
}
|
281 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
/*
|
284 |
* get products from search
|
285 |
* $title - product name
|
@@ -375,7 +378,7 @@ class WCML_Products{
|
|
375 |
}
|
376 |
|
377 |
$sql .= " ORDER BY p.id DESC LIMIT ".($page-1)*$limit.",".$limit;
|
378 |
-
|
379 |
|
380 |
$data = array();
|
381 |
$data['products'] = $wpdb->get_results($wpdb->prepare($sql,'%'.$title.'%',$current_language,$category?$category:''));
|
@@ -408,12 +411,12 @@ class WCML_Products{
|
|
408 |
|
409 |
$languages = $sitepress->get_active_languages();
|
410 |
$default_language = $sitepress->get_default_language();
|
411 |
-
|
412 |
$product_trid = $sitepress->get_element_trid($original_product_id, 'post_' . $orig_product->post_type);
|
413 |
$tr_product_id = icl_object_id($original_product_id, 'product', false, $language);
|
414 |
-
|
415 |
if (is_null($tr_product_id)) {
|
416 |
-
|
417 |
//insert new post
|
418 |
$args = array();
|
419 |
$args['post_title'] = $data['title_' . $language];
|
@@ -432,10 +435,10 @@ class WCML_Products{
|
|
432 |
$sitepress->set_element_language_details($tr_product_id, 'post_' . $orig_product->post_type, $product_trid, $language);
|
433 |
|
434 |
$this->duplicate_product_post_meta($original_product_id, $tr_product_id, $data, true);
|
435 |
-
|
436 |
-
|
437 |
}else{
|
438 |
-
|
439 |
//update post
|
440 |
$args = array();
|
441 |
$args['ID'] = $tr_product_id;
|
@@ -447,9 +450,9 @@ class WCML_Products{
|
|
447 |
|
448 |
$sitepress->set_element_language_details($tr_product_id, 'post_' . $orig_product->post_type, $product_trid, $language);
|
449 |
$this->duplicate_product_post_meta($original_product_id, $tr_product_id, $data);
|
450 |
-
|
451 |
}
|
452 |
-
|
453 |
//get "_product_attributes" from original product
|
454 |
$orig_product_attrs = $this->get_product_atributes($original_product_id);
|
455 |
$trnsl_labels = get_option('wcml_custom_attr_translations');
|
@@ -495,9 +498,9 @@ class WCML_Products{
|
|
495 |
update_post_meta($tr_product_id, '_' . $price_key, $data[$price_key.'_'.$language]);
|
496 |
}
|
497 |
}
|
498 |
-
}
|
499 |
-
|
500 |
-
|
501 |
//save images texts
|
502 |
if(isset($data['images'])){
|
503 |
foreach($data['images'] as $key=>$image){
|
@@ -514,14 +517,14 @@ class WCML_Products{
|
|
514 |
}
|
515 |
}
|
516 |
|
517 |
-
|
518 |
$translations = $sitepress->get_element_translations($product_trid,'post_product');
|
519 |
ob_clean();
|
520 |
ob_start();
|
521 |
$return = array();
|
522 |
|
523 |
$this->get_translation_statuses($translations,$languages,$default_language);
|
524 |
-
$return['status'] = ob_get_clean();
|
525 |
|
526 |
|
527 |
ob_start();
|
@@ -538,16 +541,16 @@ class WCML_Products{
|
|
538 |
$return['variations'][$language] = ob_get_clean();
|
539 |
}
|
540 |
}
|
541 |
-
|
542 |
// no longer a duplicate
|
543 |
if(!empty($data['end_duplication'][$original_product_id][$language])){
|
544 |
delete_post_meta($tr_product_id, '_icl_lang_duplicate_of', $original_product_id);
|
545 |
-
|
546 |
}
|
547 |
-
|
548 |
echo json_encode($return);
|
549 |
die();
|
550 |
-
|
551 |
}
|
552 |
|
553 |
function is_variable_product($product_id){
|
@@ -560,36 +563,38 @@ class WCML_Products{
|
|
560 |
|
561 |
|
562 |
function sync_product_taxonomies($original_product_id,$tr_product_id,$lang){
|
563 |
-
global $sitepress;
|
|
|
|
|
564 |
$taxonomies = get_object_taxonomies('product');
|
565 |
-
foreach ($taxonomies as $
|
566 |
-
$terms = get_the_terms($original_product_id, $
|
567 |
-
$
|
568 |
if ($terms) {
|
569 |
|
570 |
foreach ($terms as $term) {
|
571 |
|
572 |
if($term->taxonomy == "product_type"){
|
573 |
-
|
574 |
continue;
|
575 |
}
|
576 |
-
$trid = $sitepress->get_element_trid($term->term_taxonomy_id, 'tax_' . $tax);
|
577 |
-
if ($trid) {
|
578 |
-
$translations = $sitepress->get_element_translations($trid, 'tax_' . $tax);
|
579 |
-
if (isset($translations[$lang])) {
|
580 |
-
//update tax
|
581 |
-
|
582 |
-
$saved_terms[] = $translations[$lang]->element_id;
|
583 |
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
|
|
|
|
|
|
588 |
} else {
|
589 |
-
|
590 |
}
|
591 |
}
|
592 |
}
|
|
|
|
|
|
|
|
|
593 |
}
|
594 |
}
|
595 |
|
@@ -1108,7 +1113,7 @@ class WCML_Products{
|
|
1108 |
$sitepress->save_settings($wpml_settings);
|
1109 |
}
|
1110 |
}
|
1111 |
-
|
1112 |
/**
|
1113 |
* Filters upsell/crosell products in the correct language.
|
1114 |
*/
|
@@ -1241,19 +1246,9 @@ class WCML_Products{
|
|
1241 |
}
|
1242 |
|
1243 |
/**
|
1244 |
-
* This function
|
1245 |
-
*/
|
1246 |
-
/**
|
1247 |
-
* This function synchronizes variations when we first create a duplicate
|
1248 |
-
*/
|
1249 |
-
function sync_variations_for_duplicates($master_post_id, $lang, $postarr, $id) {
|
1250 |
-
$this->sync_variations($id, $postarr);
|
1251 |
-
}
|
1252 |
-
|
1253 |
-
/**
|
1254 |
-
* This function takes care of synchronizing variations from original to translations
|
1255 |
*/
|
1256 |
-
function
|
1257 |
global $wpdb, $pagenow, $sitepress, $sitepress_settings,$woocommerce_wpml;
|
1258 |
$default_language = $sitepress->get_default_language();
|
1259 |
$current_language = $sitepress->get_current_language();
|
@@ -1305,7 +1300,7 @@ class WCML_Products{
|
|
1305 |
|
1306 |
// If we reach this point, we go ahead with sync.
|
1307 |
// Remove filter to avoid double sync
|
1308 |
-
remove_action('save_post', array($this, '
|
1309 |
|
1310 |
//media sync
|
1311 |
update_post_meta($post_id, '_wpml_media_duplicate', 1);
|
@@ -1401,20 +1396,18 @@ class WCML_Products{
|
|
1401 |
global $wpdb;
|
1402 |
$original_default_attributes = get_post_meta($orig_post_id, '_default_attributes', TRUE);
|
1403 |
if(!empty($original_default_attributes)){
|
1404 |
-
$unserialized_default_attributes =
|
1405 |
-
foreach($
|
1406 |
// get the correct language
|
1407 |
if (substr($attribute, 0, 3) == 'pa_') {
|
1408 |
//attr is taxonomy
|
1409 |
$default_term = get_term_by('slug', $default_term_slug, $attribute);
|
1410 |
-
$
|
1411 |
|
1412 |
-
if($
|
1413 |
-
$
|
1414 |
-
|
1415 |
-
|
1416 |
-
// if it isn't translated - unset it
|
1417 |
-
unset($unserialized_default_attributes[$attribute]);
|
1418 |
}
|
1419 |
}else{
|
1420 |
//custom attr
|
@@ -1533,14 +1526,14 @@ class WCML_Products{
|
|
1533 |
$product_type = $type;
|
1534 |
}
|
1535 |
if($product_type == 'variable'){
|
1536 |
-
$contents[] = 'Variations';
|
1537 |
}elseif($product_type != 'grouped'){
|
1538 |
-
$contents[] = 'Sale price';
|
1539 |
-
$contents[] = 'Regular price';
|
1540 |
}
|
1541 |
}
|
1542 |
|
1543 |
-
global $sitepress;
|
1544 |
$settings = $sitepress->get_settings();
|
1545 |
foreach(get_post_custom_keys($product_id) as $meta_key){
|
1546 |
if(isset($settings['translation-management']['custom_fields_translation'][$meta_key]) && $settings['translation-management']['custom_fields_translation'][$meta_key] == 2){
|
@@ -1549,6 +1542,14 @@ class WCML_Products{
|
|
1549 |
}
|
1550 |
|
1551 |
if($this->check_custom_field_is_single_value($product_id,$meta_key)){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1552 |
$custom_key_label = str_replace('_',' ',$meta_key);
|
1553 |
$contents[] = trim($custom_key_label[0]) ? ucfirst($custom_key_label) : ucfirst(substr($custom_key_label,1));
|
1554 |
}
|
@@ -1763,7 +1764,7 @@ class WCML_Products{
|
|
1763 |
}
|
1764 |
}
|
1765 |
|
1766 |
-
$variables['label'] = substr($variables['label'],0,strlen($variables['label'])-3);
|
1767 |
$variables_all[$variation->ID] = $variables;
|
1768 |
}
|
1769 |
}
|
@@ -2017,7 +2018,7 @@ class WCML_Products{
|
|
2017 |
}
|
2018 |
|
2019 |
function icl_pro_translation_completed($new_post_id) {
|
2020 |
-
$this->
|
2021 |
}
|
2022 |
|
2023 |
function translate_cart_contents($item, $values, $key) {
|
@@ -2090,9 +2091,9 @@ class WCML_Products{
|
|
2090 |
return $title;
|
2091 |
}
|
2092 |
|
2093 |
-
function
|
2094 |
if(get_post_type($master_post_id)=='product'){
|
2095 |
-
$this->product_test_content_action(array($master_post_id), 'duplicate', $lang, true);
|
2096 |
}
|
2097 |
}
|
2098 |
|
@@ -2110,4 +2111,29 @@ class WCML_Products{
|
|
2110 |
return $new_found_products;
|
2111 |
}
|
2112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2113 |
}
|
3 |
class WCML_Products{
|
4 |
|
5 |
private $not_display_fields_for_variables_product = array('_regular_price','_sale_price','_price','_min_variation_price','_max_variation_price','_min_variation_regular_price','_max_variation_regular_price','_min_variation_sale_price','_max_variation_sale_price');
|
6 |
+
private $tinymce_plugins_for_rtl = '';
|
7 |
+
private $yoast_seo_fields = array('_yoast_wpseo_focuskw','_yoast_wpseo_title','_yoast_wpseo_metadesc');
|
8 |
|
9 |
function __construct(){
|
10 |
|
11 |
add_action('init', array($this, 'init'));
|
12 |
+
add_action('init', array($this, 'wc_cart_widget_actions'));
|
13 |
|
14 |
}
|
15 |
|
16 |
function init(){
|
17 |
|
18 |
if(is_admin()){
|
19 |
+
add_action('wp_ajax_wcml_update_product', array($this,'update_product_actions'));
|
20 |
+
|
21 |
add_filter('wpml_post_edit_page_link_to_translation',array($this,'_filter_link_to_translation'));
|
22 |
add_action('admin_init', array($this, 'restrict_admin_with_redirect'));
|
23 |
|
27 |
add_action('admin_init', array($this, 'make_new_attributes_translatable'));
|
28 |
|
29 |
// filters to sync variable products
|
30 |
+
add_action('save_post', array($this, 'sync_post_action'), 11, 2); // After WPML
|
31 |
//when save new attachment duplicate product gallery
|
32 |
add_action('wpml_media_create_duplicate_attachment', array($this,'sync_product_gallery_duplicate_attachment'),11,2);
|
33 |
+
|
34 |
+
add_filter('icl_make_duplicate', array($this, 'icl_make_duplicate'), 11, 4);
|
|
|
|
|
35 |
|
36 |
//remove media sync on product page
|
37 |
add_action('admin_head', array($this,'remove_language_options'),11);
|
39 |
add_action('admin_print_scripts', array($this,'preselect_product_type_in_admin_screen'), 11);
|
40 |
|
41 |
add_filter('woocommerce_json_search_found_products', array($this, 'woocommerce_json_search_found_products'));
|
42 |
+
add_filter('tiny_mce_before_init', array($this, '_mce_set_plugins'), 9);
|
43 |
}
|
44 |
+
add_action('woocommerce_email',array($this,'wcml_refresh_text_domain'));
|
45 |
add_filter('wpml_link_to_translation',array($this,'_filter_link_to_translation'));
|
46 |
|
47 |
add_filter('woocommerce_json_search_found_products', array($this, 'filter_found_products_by_language'));
|
100 |
}
|
101 |
}
|
102 |
|
103 |
+
if(defined('WPSEO_VERSION') && defined('WPSEO_PATH') && isset($_GET['tab']) && $_GET['tab'] == 'products'){
|
104 |
+
require WPSEO_PATH . 'admin/class-metabox.php';
|
105 |
+
}
|
106 |
+
|
107 |
+
}
|
108 |
+
|
109 |
+
function wc_cart_widget_actions(){
|
110 |
+
add_action('wp_ajax_woocommerce_get_refreshed_fragments',array($this,'wcml_refresh_fragments'),9);
|
111 |
+
add_action('wp_ajax_nopriv_woocommerce_get_refreshed_fragments',array($this,'wcml_refresh_fragments'),9);
|
112 |
+
if(!is_admin()){
|
113 |
+
wp_enqueue_script('wcml-scripts', WCML_PLUGIN_URL . '/assets/js/cart_widget.js', array('jquery'), WCML_VERSION);
|
114 |
+
}
|
115 |
}
|
116 |
|
117 |
function get_product($product_id) {
|
192 |
* $action - content action (duplicate or clean content)
|
193 |
*/
|
194 |
function product_test_content_action($products,$action,$lang = false,$no_redirect = false){
|
195 |
+
global $sitepress,$wpdb,$sitepress_settings;
|
196 |
$languages = $sitepress->get_active_languages();
|
197 |
$default_language = $sitepress->get_default_language();
|
198 |
|
204 |
$args = array();
|
205 |
switch ($action){
|
206 |
case 'duplicate':
|
207 |
+
if($language['code'] != $default_language){
|
208 |
+
$tr_product_id = icl_object_id($product_id, 'product', false, $language['code']);
|
209 |
+
if(is_null($tr_product_id)){
|
210 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
}
|
212 |
|
213 |
+
$this->duplicate_product_post_meta($product_id,$tr_product_id);
|
214 |
|
215 |
//duplicate product attrs
|
216 |
$orig_product_attrs = $this->get_product_atributes($product_id);
|
217 |
add_post_meta($tr_product_id,'_product_attributes',$orig_product_attrs);
|
218 |
|
219 |
+
$this->sync_default_product_attr($product_id, $tr_product_id, $language['code']);
|
|
|
220 |
//sync media
|
221 |
$this->sync_thumbnail_id($product_id, $tr_product_id,$language['code']);
|
222 |
$this->sync_product_gallery($product_id);
|
231 |
case 'clean':
|
232 |
if($language['code'] != $default_language && !is_null(icl_object_id($product_id, 'product', false, $language['code']))){
|
233 |
$tr_product_id = icl_object_id($product_id, 'product', false, $language['code']);
|
234 |
+
if(get_post_meta($tr_product_id,'_icl_lang_duplicate_of',true)){
|
235 |
wp_delete_post($tr_product_id,true);
|
236 |
|
237 |
//delete taxonomies
|
255 |
}
|
256 |
}
|
257 |
|
258 |
+
function create_product_translation_package($product_id,$trid,$language,$status){
|
259 |
+
global $sitepress,$wpdb,$current_user,$iclTranslationManagement;
|
260 |
+
//create translation package
|
261 |
+
$translation_id = $wpdb->get_var($wpdb->prepare("
|
262 |
+
SELECT translation_id FROM {$wpdb->prefix}icl_translations WHERE trid=%d AND language_code='%s'
|
263 |
+
", $trid, $language));
|
264 |
+
|
265 |
+
$md5 = $iclTranslationManagement->post_md5(get_post($product_id));
|
266 |
+
$translation_package = $iclTranslationManagement->create_translation_package($product_id);
|
267 |
|
268 |
+
get_currentuserinfo();
|
269 |
+
$user_id = $current_user->ID;
|
270 |
+
|
271 |
+
list($rid, $update) = $iclTranslationManagement->update_translation_status(array(
|
272 |
+
'translation_id' => $translation_id,
|
273 |
+
'status' => $status,
|
274 |
+
'translator_id' => $user_id,
|
275 |
+
'needs_update' => 0,
|
276 |
+
'md5' => $md5,
|
277 |
+
'translation_service' => 'local',
|
278 |
+
'translation_package' => serialize($translation_package)
|
279 |
+
));
|
280 |
+
|
281 |
+
if(!$update){
|
282 |
+
$job_id = $iclTranslationManagement->add_translation_job($rid, $user_id , $translation_package);
|
283 |
+
}
|
284 |
+
|
285 |
+
}
|
286 |
/*
|
287 |
* get products from search
|
288 |
* $title - product name
|
378 |
}
|
379 |
|
380 |
$sql .= " ORDER BY p.id DESC LIMIT ".($page-1)*$limit.",".$limit;
|
381 |
+
|
382 |
|
383 |
$data = array();
|
384 |
$data['products'] = $wpdb->get_results($wpdb->prepare($sql,'%'.$title.'%',$current_language,$category?$category:''));
|
411 |
|
412 |
$languages = $sitepress->get_active_languages();
|
413 |
$default_language = $sitepress->get_default_language();
|
414 |
+
|
415 |
$product_trid = $sitepress->get_element_trid($original_product_id, 'post_' . $orig_product->post_type);
|
416 |
$tr_product_id = icl_object_id($original_product_id, 'product', false, $language);
|
417 |
+
|
418 |
if (is_null($tr_product_id)) {
|
419 |
+
|
420 |
//insert new post
|
421 |
$args = array();
|
422 |
$args['post_title'] = $data['title_' . $language];
|
435 |
$sitepress->set_element_language_details($tr_product_id, 'post_' . $orig_product->post_type, $product_trid, $language);
|
436 |
|
437 |
$this->duplicate_product_post_meta($original_product_id, $tr_product_id, $data, true);
|
438 |
+
|
439 |
+
|
440 |
}else{
|
441 |
+
|
442 |
//update post
|
443 |
$args = array();
|
444 |
$args['ID'] = $tr_product_id;
|
450 |
|
451 |
$sitepress->set_element_language_details($tr_product_id, 'post_' . $orig_product->post_type, $product_trid, $language);
|
452 |
$this->duplicate_product_post_meta($original_product_id, $tr_product_id, $data);
|
453 |
+
|
454 |
}
|
455 |
+
|
456 |
//get "_product_attributes" from original product
|
457 |
$orig_product_attrs = $this->get_product_atributes($original_product_id);
|
458 |
$trnsl_labels = get_option('wcml_custom_attr_translations');
|
498 |
update_post_meta($tr_product_id, '_' . $price_key, $data[$price_key.'_'.$language]);
|
499 |
}
|
500 |
}
|
501 |
+
}
|
502 |
+
|
503 |
+
|
504 |
//save images texts
|
505 |
if(isset($data['images'])){
|
506 |
foreach($data['images'] as $key=>$image){
|
517 |
}
|
518 |
}
|
519 |
|
520 |
+
|
521 |
$translations = $sitepress->get_element_translations($product_trid,'post_product');
|
522 |
ob_clean();
|
523 |
ob_start();
|
524 |
$return = array();
|
525 |
|
526 |
$this->get_translation_statuses($translations,$languages,$default_language);
|
527 |
+
$return['status'] = ob_get_clean();
|
528 |
|
529 |
|
530 |
ob_start();
|
541 |
$return['variations'][$language] = ob_get_clean();
|
542 |
}
|
543 |
}
|
544 |
+
|
545 |
// no longer a duplicate
|
546 |
if(!empty($data['end_duplication'][$original_product_id][$language])){
|
547 |
delete_post_meta($tr_product_id, '_icl_lang_duplicate_of', $original_product_id);
|
548 |
+
|
549 |
}
|
550 |
+
|
551 |
echo json_encode($return);
|
552 |
die();
|
553 |
+
|
554 |
}
|
555 |
|
556 |
function is_variable_product($product_id){
|
563 |
|
564 |
|
565 |
function sync_product_taxonomies($original_product_id,$tr_product_id,$lang){
|
566 |
+
global $sitepress,$wpdb;
|
567 |
+
remove_filter('get_term', array($sitepress,'get_term_adjust_id')); // AVOID filtering to current language
|
568 |
+
|
569 |
$taxonomies = get_object_taxonomies('product');
|
570 |
+
foreach ($taxonomies as $taxonomy) {
|
571 |
+
$terms = get_the_terms($original_product_id, $taxonomy);
|
572 |
+
$terms_array = array();
|
573 |
if ($terms) {
|
574 |
|
575 |
foreach ($terms as $term) {
|
576 |
|
577 |
if($term->taxonomy == "product_type"){
|
578 |
+
$terms_array[] = $term->name;
|
579 |
continue;
|
580 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
581 |
|
582 |
+
$tr_id = icl_object_id($term->term_id, $taxonomy, false, $lang);
|
583 |
+
if(!is_null($tr_id)){
|
584 |
+
// not using get_term - unfiltered get_term
|
585 |
+
$translated_term = $wpdb->get_row($wpdb->prepare("
|
586 |
+
SELECT * FROM {$wpdb->terms} t JOIN {$wpdb->term_taxonomy} x ON x.term_id = t.term_id WHERE t.term_id = %d AND x.taxonomy = %s", $tr_id, $taxonomy));
|
587 |
+
if(is_taxonomy_hierarchical($taxonomy)){
|
588 |
+
$terms_array[] = $translated_term->term_id;
|
589 |
} else {
|
590 |
+
$terms_array[] = $translated_term->name;
|
591 |
}
|
592 |
}
|
593 |
}
|
594 |
+
|
595 |
+
wp_set_post_terms($tr_product_id, $terms_array, $taxonomy);
|
596 |
+
|
597 |
+
}
|
598 |
}
|
599 |
}
|
600 |
|
1113 |
$sitepress->save_settings($wpml_settings);
|
1114 |
}
|
1115 |
}
|
1116 |
+
|
1117 |
/**
|
1118 |
* Filters upsell/crosell products in the correct language.
|
1119 |
*/
|
1246 |
}
|
1247 |
|
1248 |
/**
|
1249 |
+
* This function takes care of synchronizing original product
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1250 |
*/
|
1251 |
+
function sync_post_action($post_id, $post){
|
1252 |
global $wpdb, $pagenow, $sitepress, $sitepress_settings,$woocommerce_wpml;
|
1253 |
$default_language = $sitepress->get_default_language();
|
1254 |
$current_language = $sitepress->get_current_language();
|
1300 |
|
1301 |
// If we reach this point, we go ahead with sync.
|
1302 |
// Remove filter to avoid double sync
|
1303 |
+
remove_action('save_post', array($this, 'sync_post_action'), 11, 2);
|
1304 |
|
1305 |
//media sync
|
1306 |
update_post_meta($post_id, '_wpml_media_duplicate', 1);
|
1396 |
global $wpdb;
|
1397 |
$original_default_attributes = get_post_meta($orig_post_id, '_default_attributes', TRUE);
|
1398 |
if(!empty($original_default_attributes)){
|
1399 |
+
$unserialized_default_attributes = array();
|
1400 |
+
foreach(maybe_unserialize($original_default_attributes) as $attribute => $default_term_slug){
|
1401 |
// get the correct language
|
1402 |
if (substr($attribute, 0, 3) == 'pa_') {
|
1403 |
//attr is taxonomy
|
1404 |
$default_term = get_term_by('slug', $default_term_slug, $attribute);
|
1405 |
+
$tr_id = icl_object_id($default_term->term_id, $attribute, false, $lang);
|
1406 |
|
1407 |
+
if($tr_id){
|
1408 |
+
$translated_term = $wpdb->get_row($wpdb->prepare("
|
1409 |
+
SELECT * FROM {$wpdb->terms} t JOIN {$wpdb->term_taxonomy} x ON x.term_id = t.term_id WHERE t.term_id = %d AND x.taxonomy = %s", $tr_id, $attribute));
|
1410 |
+
$unserialized_default_attributes[$attribute] = $translated_term->slug;
|
|
|
|
|
1411 |
}
|
1412 |
}else{
|
1413 |
//custom attr
|
1526 |
$product_type = $type;
|
1527 |
}
|
1528 |
if($product_type == 'variable'){
|
1529 |
+
$contents[] = __('Variations','wpml-wcml');
|
1530 |
}elseif($product_type != 'grouped'){
|
1531 |
+
$contents[] = __('Sale price','wpml-wcml');
|
1532 |
+
$contents[] = __('Regular price','wpml-wcml');
|
1533 |
}
|
1534 |
}
|
1535 |
|
1536 |
+
global $sitepress,$wpseo_metabox;
|
1537 |
$settings = $sitepress->get_settings();
|
1538 |
foreach(get_post_custom_keys($product_id) as $meta_key){
|
1539 |
if(isset($settings['translation-management']['custom_fields_translation'][$meta_key]) && $settings['translation-management']['custom_fields_translation'][$meta_key] == 2){
|
1542 |
}
|
1543 |
|
1544 |
if($this->check_custom_field_is_single_value($product_id,$meta_key)){
|
1545 |
+
if(defined('WPSEO_VERSION')){
|
1546 |
+
if(!is_null($wpseo_metabox) && in_array($meta_key,$this->yoast_seo_fields)){
|
1547 |
+
$wpseo_metabox_values = $wpseo_metabox->get_meta_boxes('product');
|
1548 |
+
$contents[] = $wpseo_metabox_values[str_replace('_yoast_wpseo_','',$meta_key)]['title'];
|
1549 |
+
continue;
|
1550 |
+
}
|
1551 |
+
}
|
1552 |
+
|
1553 |
$custom_key_label = str_replace('_',' ',$meta_key);
|
1554 |
$contents[] = trim($custom_key_label[0]) ? ucfirst($custom_key_label) : ucfirst(substr($custom_key_label,1));
|
1555 |
}
|
1764 |
}
|
1765 |
}
|
1766 |
|
1767 |
+
$variables['label'] = substr($variables['label'],0,strlen($variables['label'])-3);
|
1768 |
$variables_all[$variation->ID] = $variables;
|
1769 |
}
|
1770 |
}
|
2018 |
}
|
2019 |
|
2020 |
function icl_pro_translation_completed($new_post_id) {
|
2021 |
+
$this->sync_post_action($new_post_id, get_post($new_post_id));
|
2022 |
}
|
2023 |
|
2024 |
function translate_cart_contents($item, $values, $key) {
|
2091 |
return $title;
|
2092 |
}
|
2093 |
|
2094 |
+
function icl_make_duplicate($master_post_id, $lang, $postarr, $id){
|
2095 |
if(get_post_type($master_post_id)=='product'){
|
2096 |
+
$this->product_test_content_action(array($master_post_id), 'duplicate', $lang, true);
|
2097 |
}
|
2098 |
}
|
2099 |
|
2111 |
return $new_found_products;
|
2112 |
}
|
2113 |
|
2114 |
+
function wcml_refresh_fragments(){
|
2115 |
+
global $woocommerce,$woocommerce_wpml;
|
2116 |
+
add_action('woocommerce_before_calculate_totals',array($woocommerce_wpml->currencies,'woocommerce_calculate_totals'));
|
2117 |
+
$woocommerce->cart->calculate_totals();
|
2118 |
+
$this->wcml_refresh_text_domain();
|
2119 |
+
}
|
2120 |
+
|
2121 |
+
function wcml_refresh_text_domain(){
|
2122 |
+
global $woocommerce;
|
2123 |
+
$domain = 'woocommerce';
|
2124 |
+
unload_textdomain($domain);
|
2125 |
+
$woocommerce->load_plugin_textdomain();
|
2126 |
+
}
|
2127 |
+
|
2128 |
+
|
2129 |
+
function _mce_set_plugins($settings) {
|
2130 |
+
if (is_rtl()) {
|
2131 |
+
if(!empty($settings['plugins'])){
|
2132 |
+
$this->tinymce_plugins_for_rtl = $settings['plugins'];
|
2133 |
+
}else{
|
2134 |
+
$settings['plugins'] = $this->tinymce_plugins_for_rtl;
|
2135 |
+
}
|
2136 |
+
}
|
2137 |
+
return $settings;
|
2138 |
+
}
|
2139 |
}
|
inc/store-pages.class.php
CHANGED
@@ -108,11 +108,10 @@ class WCML_Store_Pages{
|
|
108 |
}
|
109 |
// brand page
|
110 |
if (is_tax('product_brand')) {
|
111 |
-
$
|
112 |
-
|
113 |
}
|
114 |
}
|
115 |
-
$sitepress->switch_lang();
|
116 |
return $languages;
|
117 |
}
|
118 |
|
@@ -121,7 +120,9 @@ class WCML_Store_Pages{
|
|
121 |
if ($sitepress->get_default_language() != $sitepress->get_current_language()) {
|
122 |
if (!empty($q->query_vars['pagename'])) {
|
123 |
$shop_page = get_post( woocommerce_get_page_id('shop') );
|
124 |
-
|
|
|
|
|
125 |
unset($q->query_vars['page']);
|
126 |
unset($q->query_vars['pagename']);
|
127 |
$q->query_vars['post_type'] = 'product';
|
@@ -137,6 +138,19 @@ class WCML_Store_Pages{
|
|
137 |
global $sitepress,$wp_rewrite,$woocommerce_wpml;
|
138 |
$miss_lang = $this->get_missing_store_pages();
|
139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
if ($miss_lang) {
|
141 |
$wp_rewrite = new WP_Rewrite();
|
142 |
$current_language = $sitepress->get_current_language();
|
@@ -163,6 +177,7 @@ class WCML_Store_Pages{
|
|
163 |
$trnsl_id = icl_object_id($orig_id, 'page', false, $mis_lang);
|
164 |
if ($orig_id && (is_null($trnsl_id) || get_post_status($trnsl_id)!='publish')) {
|
165 |
$orig_page = get_post($orig_id);
|
|
|
166 |
$sitepress->switch_lang($mis_lang);
|
167 |
$woocommerce_wpml->load_locale();
|
168 |
$args['post_title'] = __($orig_page->post_title,'wpml-wcml');
|
@@ -182,10 +197,14 @@ class WCML_Store_Pages{
|
|
182 |
if(!is_null($trnsl_id)){
|
183 |
$sitepress->set_element_language_details($trnsl_id, 'post_' . $orig_page->post_type, false, $mis_lang);
|
184 |
}
|
185 |
-
|
186 |
}
|
187 |
}
|
188 |
}
|
|
|
|
|
|
|
|
|
189 |
}
|
190 |
}
|
191 |
|
108 |
}
|
109 |
// brand page
|
110 |
if (is_tax('product_brand')) {
|
111 |
+
$translated_id = icl_object_id( get_queried_object_id(), 'product_brand', true, $language['language_code'] );
|
112 |
+
$language['url'] = get_term_link( $translated_id, 'product_brand' );
|
113 |
}
|
114 |
}
|
|
|
115 |
return $languages;
|
116 |
}
|
117 |
|
120 |
if ($sitepress->get_default_language() != $sitepress->get_current_language()) {
|
121 |
if (!empty($q->query_vars['pagename'])) {
|
122 |
$shop_page = get_post( woocommerce_get_page_id('shop') );
|
123 |
+
// we should explode by / for children page
|
124 |
+
$query_var_page = explode('/',$q->query_vars['pagename']);
|
125 |
+
if (in_array($shop_page->post_name,$query_var_page)) {
|
126 |
unset($q->query_vars['page']);
|
127 |
unset($q->query_vars['pagename']);
|
128 |
$q->query_vars['post_type'] = 'product';
|
138 |
global $sitepress,$wp_rewrite,$woocommerce_wpml;
|
139 |
$miss_lang = $this->get_missing_store_pages();
|
140 |
|
141 |
+
//dummy array for names
|
142 |
+
$names = array( __('Cart','wpml-wcml'),
|
143 |
+
__('Checkout','wpml-wcml'),
|
144 |
+
__('Checkout → Pay','wpml-wcml'),
|
145 |
+
__('Order Received','wpml-wcml'),
|
146 |
+
__('My Account','wpml-wcml'),
|
147 |
+
__('Change Password','wpml-wcml'),
|
148 |
+
__('Edit My Address','wpml-wcml'),
|
149 |
+
__('Logout','wpml-wcml'),
|
150 |
+
__('Lost Password','wpml-wcml'),
|
151 |
+
__('View Order','wpml-wcml'),
|
152 |
+
__('Shop','wpml-wcml'));
|
153 |
+
|
154 |
if ($miss_lang) {
|
155 |
$wp_rewrite = new WP_Rewrite();
|
156 |
$current_language = $sitepress->get_current_language();
|
177 |
$trnsl_id = icl_object_id($orig_id, 'page', false, $mis_lang);
|
178 |
if ($orig_id && (is_null($trnsl_id) || get_post_status($trnsl_id)!='publish')) {
|
179 |
$orig_page = get_post($orig_id);
|
180 |
+
unload_textdomain('wpml-wcml');
|
181 |
$sitepress->switch_lang($mis_lang);
|
182 |
$woocommerce_wpml->load_locale();
|
183 |
$args['post_title'] = __($orig_page->post_title,'wpml-wcml');
|
197 |
if(!is_null($trnsl_id)){
|
198 |
$sitepress->set_element_language_details($trnsl_id, 'post_' . $orig_page->post_type, false, $mis_lang);
|
199 |
}
|
200 |
+
|
201 |
}
|
202 |
}
|
203 |
}
|
204 |
+
unload_textdomain('wpml-wcml');
|
205 |
+
$sitepress->switch_lang($current_language);
|
206 |
+
$woocommerce_wpml->load_locale();
|
207 |
+
wp_redirect(admin_url('admin.php?page=wpml-wcml')); exit;
|
208 |
}
|
209 |
}
|
210 |
|
inc/terms.class.php
CHANGED
@@ -145,6 +145,7 @@ class WCML_Terms{
|
|
145 |
}
|
146 |
|
147 |
function _switch_wc_locale(){
|
|
|
148 |
$locale = !empty($this->_tmp_locale_val) ? $this->_tmp_locale_val : $sitepress->get_locale($sitepress->get_current_language());
|
149 |
return $locale;
|
150 |
}
|
@@ -179,7 +180,7 @@ class WCML_Terms{
|
|
179 |
if($term_language->language_code == $strings_language){
|
180 |
$base = _x($base_sl, 'slug', 'woocommerce');
|
181 |
$base_translated = $base_sl;
|
182 |
-
}
|
183 |
$base = _x($base_sl, 'slug', 'woocommerce');
|
184 |
|
185 |
// switch wc locale
|
@@ -595,6 +596,7 @@ class WCML_Terms{
|
|
595 |
<input type="hidden" name="taxonomy" value="<?php echo $taxonomy ?>" />
|
596 |
<input type="hidden" name="wcml_nonce" value="<?php echo wp_create_nonce('wcml_sync_product_variations') ?>" />
|
597 |
<input type="hidden" name="last_post_id" value="" />
|
|
|
598 |
|
599 |
<p>
|
600 |
<input class="button-secondary" type="submit" value="<?php esc_attr_e("Synchronize attributes and update product variations", 'wpml-wcml') ?>" />
|
@@ -605,7 +607,7 @@ class WCML_Terms{
|
|
605 |
</form>
|
606 |
|
607 |
|
608 |
-
<p><?php _e('This will automatically generate
|
609 |
<?php if(!empty($wcml_settings['variations_needed'][$taxonomy])): ?>
|
610 |
<p><?php printf(__('Currently, there are %s variations that need to be created.', 'wpml-wcml'), '<strong>' . $wcml_settings['variations_needed'][$taxonomy] . '</strong>') ?></p>
|
611 |
<?php endif; ?>
|
@@ -645,14 +647,18 @@ class WCML_Terms{
|
|
645 |
static function wcml_sync_product_variations($taxonomy){
|
646 |
global $woocommerce_wpml, $wpdb, $sitepress;
|
647 |
|
648 |
-
$VARIATIONS_THRESHOLD =
|
649 |
|
650 |
$wcml_settings = $woocommerce_wpml->get_settings();
|
651 |
$response = array();
|
652 |
|
653 |
$taxonomy = $_POST['taxonomy'];
|
654 |
|
655 |
-
$
|
|
|
|
|
|
|
|
|
656 |
|
657 |
$post_ids = $wpdb->get_col($wpdb->prepare("
|
658 |
SELECT DISTINCT tr.object_id
|
@@ -676,21 +682,37 @@ class WCML_Terms{
|
|
676 |
$trid = $sitepress->get_element_trid($post_id, 'post_product');
|
677 |
$translations = $sitepress->get_element_translations($trid, 'post_product');
|
678 |
|
|
|
|
|
679 |
foreach($translations as $translation){
|
680 |
-
|
|
|
681 |
$woocommerce_wpml->products->sync_product_taxonomies($post_id, $translation->element_id, $translation->language_code);
|
682 |
$woocommerce_wpml->products->sync_product_variations($post_id, $translation->element_id, $translation->language_code, false, true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
683 |
}
|
684 |
}
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
|
|
689 |
break;
|
690 |
}
|
691 |
|
|
|
|
|
692 |
}
|
693 |
-
|
694 |
$response['go'] = 1;
|
695 |
|
696 |
}else{
|
145 |
}
|
146 |
|
147 |
function _switch_wc_locale(){
|
148 |
+
global $sitepress;
|
149 |
$locale = !empty($this->_tmp_locale_val) ? $this->_tmp_locale_val : $sitepress->get_locale($sitepress->get_current_language());
|
150 |
return $locale;
|
151 |
}
|
180 |
if($term_language->language_code == $strings_language){
|
181 |
$base = _x($base_sl, 'slug', 'woocommerce');
|
182 |
$base_translated = $base_sl;
|
183 |
+
}else{
|
184 |
$base = _x($base_sl, 'slug', 'woocommerce');
|
185 |
|
186 |
// switch wc locale
|
596 |
<input type="hidden" name="taxonomy" value="<?php echo $taxonomy ?>" />
|
597 |
<input type="hidden" name="wcml_nonce" value="<?php echo wp_create_nonce('wcml_sync_product_variations') ?>" />
|
598 |
<input type="hidden" name="last_post_id" value="" />
|
599 |
+
<input type="hidden" name="languages_processed" value="0" />
|
600 |
|
601 |
<p>
|
602 |
<input class="button-secondary" type="submit" value="<?php esc_attr_e("Synchronize attributes and update product variations", 'wpml-wcml') ?>" />
|
607 |
</form>
|
608 |
|
609 |
|
610 |
+
<p><?php _e('This will automatically generate variations for translated products corresponding to recently translated attributes.'); ?></p>
|
611 |
<?php if(!empty($wcml_settings['variations_needed'][$taxonomy])): ?>
|
612 |
<p><?php printf(__('Currently, there are %s variations that need to be created.', 'wpml-wcml'), '<strong>' . $wcml_settings['variations_needed'][$taxonomy] . '</strong>') ?></p>
|
613 |
<?php endif; ?>
|
647 |
static function wcml_sync_product_variations($taxonomy){
|
648 |
global $woocommerce_wpml, $wpdb, $sitepress;
|
649 |
|
650 |
+
$VARIATIONS_THRESHOLD = 20;
|
651 |
|
652 |
$wcml_settings = $woocommerce_wpml->get_settings();
|
653 |
$response = array();
|
654 |
|
655 |
$taxonomy = $_POST['taxonomy'];
|
656 |
|
657 |
+
$languages_processed = intval($_POST['languages_processed']);
|
658 |
+
|
659 |
+
$condition = $languages_processed?'>=':'>';
|
660 |
+
|
661 |
+
$where = isset($_POST['last_post_id']) && $_POST['last_post_id'] ? ' ID '.$condition.' ' . intval($_POST['last_post_id']) . ' AND ' : '';
|
662 |
|
663 |
$post_ids = $wpdb->get_col($wpdb->prepare("
|
664 |
SELECT DISTINCT tr.object_id
|
682 |
$trid = $sitepress->get_element_trid($post_id, 'post_product');
|
683 |
$translations = $sitepress->get_element_translations($trid, 'post_product');
|
684 |
|
685 |
+
$i = 1;
|
686 |
+
|
687 |
foreach($translations as $translation){
|
688 |
+
|
689 |
+
if($i > $languages_processed && $translation->element_id != $post_id){
|
690 |
$woocommerce_wpml->products->sync_product_taxonomies($post_id, $translation->element_id, $translation->language_code);
|
691 |
$woocommerce_wpml->products->sync_product_variations($post_id, $translation->element_id, $translation->language_code, false, true);
|
692 |
+
$woocommerce_wpml->products->create_product_translation_package($post_id,$trid, $translation->language_code,ICL_TM_COMPLETE);
|
693 |
+
$variations_processed += $terms_count*2;
|
694 |
+
$response['languages_processed'] = $i;
|
695 |
+
$i++;
|
696 |
+
//check if sum of 2 iterations doesn't exceed $VARIATIONS_THRESHOLD
|
697 |
+
if($variations_processed >= $VARIATIONS_THRESHOLD){
|
698 |
+
break;
|
699 |
+
}
|
700 |
+
}else{
|
701 |
+
$i++;
|
702 |
}
|
703 |
}
|
704 |
+
$response['last_post_id'] = $post_id;
|
705 |
+
if(--$i == count($translations)){
|
706 |
+
$response['languages_processed'] = 0;
|
707 |
+
$languages_processed = 0;
|
708 |
+
}else{
|
709 |
break;
|
710 |
}
|
711 |
|
712 |
+
$posts_processed ++;
|
713 |
+
|
714 |
}
|
715 |
+
|
716 |
$response['go'] = 1;
|
717 |
|
718 |
}else{
|
locale/orig/wpml-wcml.po
CHANGED
@@ -1,591 +1,568 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
"
|
7 |
-
"Content-
|
8 |
-
"
|
9 |
-
"
|
10 |
-
"
|
11 |
-
"
|
12 |
-
"
|
13 |
-
"
|
14 |
-
|
15 |
-
msgid "
|
16 |
-
msgstr ""
|
17 |
-
|
18 |
-
msgid "
|
19 |
-
msgstr ""
|
20 |
-
|
21 |
-
msgid "
|
22 |
-
msgstr ""
|
23 |
-
|
24 |
-
msgid "
|
25 |
-
msgstr ""
|
26 |
-
|
27 |
-
msgid "
|
28 |
-
msgstr ""
|
29 |
-
|
30 |
-
msgid "
|
31 |
-
msgstr ""
|
32 |
-
|
33 |
-
msgid "
|
34 |
-
msgstr ""
|
35 |
-
|
36 |
-
msgid "
|
37 |
-
msgstr ""
|
38 |
-
|
39 |
-
msgid "
|
40 |
-
msgstr ""
|
41 |
-
|
42 |
-
msgid "
|
43 |
-
msgstr ""
|
44 |
-
|
45 |
-
msgid "
|
46 |
-
msgstr ""
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
msgid ""
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
msgid ""
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
msgstr ""
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
msgid ""
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
msgid "
|
103 |
-
msgstr ""
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
msgid "
|
115 |
-
msgstr ""
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
msgid "
|
127 |
-
msgstr ""
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
msgid "
|
139 |
-
msgstr ""
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
msgid "
|
151 |
-
msgstr ""
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
msgid "
|
163 |
-
msgstr ""
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
msgid "
|
172 |
-
msgstr ""
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
msgid "
|
202 |
-
msgstr ""
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
msgid "
|
214 |
-
msgstr ""
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
"
|
232 |
-
msgstr ""
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
msgid "
|
244 |
-
msgstr ""
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
msgid "
|
259 |
-
msgstr ""
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
msgid "
|
274 |
-
msgstr ""
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
msgid "
|
289 |
-
msgstr ""
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
"
|
301 |
-
msgstr ""
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
msgid "
|
322 |
-
msgstr ""
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
msgid "
|
337 |
-
msgstr ""
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
"
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
msgid "
|
349 |
-
msgstr ""
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
msgid "
|
367 |
-
msgstr ""
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
msgid "
|
373 |
-
msgstr ""
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
msgid "
|
394 |
-
msgstr ""
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
"
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
msgid "
|
406 |
-
msgstr ""
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
msgid "
|
412 |
-
msgstr ""
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
msgid "WooCommerce
|
427 |
-
msgstr ""
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
msgid "
|
442 |
-
msgstr ""
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
msgid "
|
451 |
-
msgstr ""
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
msgid "
|
463 |
-
msgstr ""
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
msgid "
|
472 |
-
msgstr ""
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
msgid "
|
484 |
-
msgstr ""
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
msgid "
|
490 |
-
msgstr ""
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
msgid "
|
505 |
-
msgstr ""
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
msgid "
|
520 |
-
msgstr ""
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
msgid "
|
532 |
-
msgstr ""
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
msgid "
|
544 |
-
msgstr ""
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
msgid "
|
550 |
-
msgstr ""
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
msgid "
|
562 |
-
msgstr ""
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
msgid "Close"
|
570 |
-
msgstr ""
|
571 |
-
|
572 |
-
#: D:\xampp\htdocs\wpml_local\wp-content\plugins\woocommerce-multilingual/menu/management.php:522
|
573 |
-
msgid "Ok"
|
574 |
-
msgstr ""
|
575 |
-
|
576 |
-
#: D:\xampp\htdocs\wpml_local\wp-content\plugins\woocommerce-multilingual/menu/management.php:534
|
577 |
-
msgid "Please enter attributes values and save translation"
|
578 |
-
msgstr ""
|
579 |
-
|
580 |
-
#: D:\xampp\htdocs\wpml_local\wp-content\plugins\woocommerce-multilingual/menu/management.php:624
|
581 |
-
msgid "Send products to translation"
|
582 |
-
msgstr ""
|
583 |
-
|
584 |
-
#: D:\xampp\htdocs\wpml_local\wp-content\plugins\woocommerce-multilingual/menu/settings_tab.php:221
|
585 |
-
#, php-format
|
586 |
-
msgid "Exchange rate to %s (*)"
|
587 |
-
msgstr ""
|
588 |
-
|
589 |
-
#: D:\xampp\htdocs\wpml_local\wp-content\plugins\woocommerce-multilingual/menu/settings_tab.php:230
|
590 |
-
msgid "Exchange rate"
|
591 |
-
msgstr ""
|
1 |
+
# This file was generated by WPML
|
2 |
+
# WPML is a WordPress plugin that can turn any WordPress site into a full featured multilingual content management system.
|
3 |
+
# http://wpml.org
|
4 |
+
msgid ""
|
5 |
+
msgstr ""
|
6 |
+
"Content-Type: text/plain; charset=utf-8\n"
|
7 |
+
"Content-Transfer-Encoding: 8bit\n"
|
8 |
+
"Project-Id-Version: \n"
|
9 |
+
"POT-Creation-Date: \n"
|
10 |
+
"PO-Revision-Date: \n"
|
11 |
+
"Last-Translator: \n"
|
12 |
+
"Language-Team: \n"
|
13 |
+
"MIME-Version: 1.0\n"
|
14 |
+
|
15 |
+
msgid "WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href=\"%s\">WPML</a> versions prior %s."
|
16 |
+
msgstr ""
|
17 |
+
|
18 |
+
msgid "WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href=\"%s\">WPML Translation Management</a> versions prior %s."
|
19 |
+
msgstr ""
|
20 |
+
|
21 |
+
msgid "WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href=\"%s\">WPML String Translation</a> versions prior %s."
|
22 |
+
msgstr ""
|
23 |
+
|
24 |
+
msgid "WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href=\"%s\">WPML Media</a> versions prior %s."
|
25 |
+
msgstr ""
|
26 |
+
|
27 |
+
msgid "and"
|
28 |
+
msgstr ""
|
29 |
+
|
30 |
+
msgid "WooCommerce Multilingual is enabled but not effective. It requires %s in order to work."
|
31 |
+
msgstr ""
|
32 |
+
|
33 |
+
msgid "Permalink settings"
|
34 |
+
msgstr ""
|
35 |
+
|
36 |
+
msgid "Configure products slug translation"
|
37 |
+
msgstr ""
|
38 |
+
|
39 |
+
msgid "If you want to translate product slugs, you need to disable the shop prefix for products in <a href=\"%s\">WooCommerce Settings</a>"
|
40 |
+
msgstr ""
|
41 |
+
|
42 |
+
msgid "If you want different slugs for shop pages (%s/%s), you need to disable the shop prefix for products in <a href=\"%s\">WooCommerce Settings</a>"
|
43 |
+
msgstr ""
|
44 |
+
|
45 |
+
msgid "Invalid nonce"
|
46 |
+
msgstr ""
|
47 |
+
|
48 |
+
msgid "Title missing"
|
49 |
+
msgstr ""
|
50 |
+
|
51 |
+
msgid "Not translated"
|
52 |
+
msgstr ""
|
53 |
+
|
54 |
+
msgid "Not translated - needs update"
|
55 |
+
msgstr ""
|
56 |
+
|
57 |
+
msgid "In progress"
|
58 |
+
msgstr ""
|
59 |
+
|
60 |
+
msgid "Complete"
|
61 |
+
msgstr ""
|
62 |
+
|
63 |
+
msgid "You should not add products in other languages, as this may cause synchronization problems between product translations."
|
64 |
+
msgstr ""
|
65 |
+
|
66 |
+
msgid "Please add the product in <b>%s</b> and then use the WooCommerce Multilingual admin screen to translate it."
|
67 |
+
msgstr ""
|
68 |
+
|
69 |
+
msgid "The recommended way to translate WooCommerce products is using the <b><a href=\"%s\">WooCommerce Multilingual admin</a></b> page. Please use this page only for translating elements that are not available in the WooCommerce Multilingual products translation table."
|
70 |
+
msgstr ""
|
71 |
+
|
72 |
+
msgid "Title"
|
73 |
+
msgstr ""
|
74 |
+
|
75 |
+
msgid "Content"
|
76 |
+
msgstr ""
|
77 |
+
|
78 |
+
msgid "Excerpt"
|
79 |
+
msgstr ""
|
80 |
+
|
81 |
+
msgid "Images"
|
82 |
+
msgstr ""
|
83 |
+
|
84 |
+
msgid "Please translate all attributes"
|
85 |
+
msgstr ""
|
86 |
+
|
87 |
+
msgid "Cart"
|
88 |
+
msgstr ""
|
89 |
+
|
90 |
+
msgid "Checkout"
|
91 |
+
msgstr ""
|
92 |
+
|
93 |
+
msgid "Checkout → Pay"
|
94 |
+
msgstr ""
|
95 |
+
|
96 |
+
msgid "Order Received"
|
97 |
+
msgstr ""
|
98 |
+
|
99 |
+
msgid "My Account"
|
100 |
+
msgstr ""
|
101 |
+
|
102 |
+
msgid "Change Password"
|
103 |
+
msgstr ""
|
104 |
+
|
105 |
+
msgid "Edit My Address"
|
106 |
+
msgstr ""
|
107 |
+
|
108 |
+
msgid "Logout"
|
109 |
+
msgstr ""
|
110 |
+
|
111 |
+
msgid "Lost Password"
|
112 |
+
msgstr ""
|
113 |
+
|
114 |
+
msgid "View Order"
|
115 |
+
msgstr ""
|
116 |
+
|
117 |
+
msgid "Shop"
|
118 |
+
msgstr ""
|
119 |
+
|
120 |
+
msgid "To translate %s please use the %s translation%s page, inside the %sWooCommerce Multilingual admin%s."
|
121 |
+
msgstr ""
|
122 |
+
|
123 |
+
msgid "Wait! There is a better way to translate %s. Please go to the %s translation%s page, inside the %sWooCommerce Multilingual admin%s, and translate from there."
|
124 |
+
msgstr ""
|
125 |
+
|
126 |
+
msgid "%s do not require translation."
|
127 |
+
msgstr ""
|
128 |
+
|
129 |
+
msgid "Change"
|
130 |
+
msgstr ""
|
131 |
+
|
132 |
+
msgid "Some %s are missing translations (%d translations missing)."
|
133 |
+
msgstr ""
|
134 |
+
|
135 |
+
msgid "Translate now"
|
136 |
+
msgstr ""
|
137 |
+
|
138 |
+
msgid "All %s are translated."
|
139 |
+
msgstr ""
|
140 |
+
|
141 |
+
msgid "Currently, there are %s variations that need to be created."
|
142 |
+
msgstr ""
|
143 |
+
|
144 |
+
msgid "%d products left"
|
145 |
+
msgstr ""
|
146 |
+
|
147 |
+
msgid "Synchronization complete!"
|
148 |
+
msgstr ""
|
149 |
+
|
150 |
+
msgid "This will automatically generate variations for translated products corresponding to recently translated attributes."
|
151 |
+
msgstr ""
|
152 |
+
|
153 |
+
msgid "Synchronize attributes and update product variations"
|
154 |
+
msgstr ""
|
155 |
+
|
156 |
+
msgid "Looks like you are upgrading from a previous version of WooCommerce Multilingual. Would you like to automatically create translated variations and images?"
|
157 |
+
msgstr ""
|
158 |
+
|
159 |
+
msgid "Yes, go to the troubleshooting page"
|
160 |
+
msgstr ""
|
161 |
+
|
162 |
+
msgid "No - dismiss"
|
163 |
+
msgstr ""
|
164 |
+
|
165 |
+
msgid "Please enter string in %s (the strings language)"
|
166 |
+
msgstr ""
|
167 |
+
|
168 |
+
msgid "You need to enter attribute names in %s (even though your site's default language is %s). Then, translate it to %s and the rest of the site's languages using in the %sWooCommerce Multlingual admin%s."
|
169 |
+
msgstr ""
|
170 |
+
|
171 |
+
msgid "product"
|
172 |
+
msgstr ""
|
173 |
+
|
174 |
+
msgid "WooCommerce Multilingual"
|
175 |
+
msgstr ""
|
176 |
+
|
177 |
+
msgid "General settings"
|
178 |
+
msgstr ""
|
179 |
+
|
180 |
+
msgid "Products"
|
181 |
+
msgstr ""
|
182 |
+
|
183 |
+
msgid "You have untranslated terms!"
|
184 |
+
msgstr ""
|
185 |
+
|
186 |
+
msgid "Collapse"
|
187 |
+
msgstr ""
|
188 |
+
|
189 |
+
msgid "Expand"
|
190 |
+
msgstr ""
|
191 |
+
|
192 |
+
msgid "Please set images for product"
|
193 |
+
msgstr ""
|
194 |
+
|
195 |
+
msgid "Please save translation before translate images texts"
|
196 |
+
msgstr ""
|
197 |
+
|
198 |
+
msgid "Caption"
|
199 |
+
msgstr ""
|
200 |
+
|
201 |
+
msgid "Description"
|
202 |
+
msgstr ""
|
203 |
+
|
204 |
+
msgid "Enter translation"
|
205 |
+
msgstr ""
|
206 |
+
|
207 |
+
msgid "%d products"
|
208 |
+
msgstr ""
|
209 |
+
|
210 |
+
msgid "This product is an exact duplicate of the %s product."
|
211 |
+
msgstr ""
|
212 |
+
|
213 |
+
msgid "edit product"
|
214 |
+
msgstr ""
|
215 |
+
|
216 |
+
msgid "Save"
|
217 |
+
msgstr ""
|
218 |
+
|
219 |
+
msgid "Update"
|
220 |
+
msgstr ""
|
221 |
+
|
222 |
+
msgid "WooCommerce Products"
|
223 |
+
msgstr ""
|
224 |
+
|
225 |
+
msgid "Any category"
|
226 |
+
msgstr ""
|
227 |
+
|
228 |
+
msgid "All products"
|
229 |
+
msgstr ""
|
230 |
+
|
231 |
+
msgid "Not translated or needs updating"
|
232 |
+
msgstr ""
|
233 |
+
|
234 |
+
msgid "Needs updating"
|
235 |
+
msgstr ""
|
236 |
+
|
237 |
+
msgid "Translation in progress"
|
238 |
+
msgstr ""
|
239 |
+
|
240 |
+
msgid "Translation complete"
|
241 |
+
msgstr ""
|
242 |
+
|
243 |
+
msgid "All languages"
|
244 |
+
msgstr ""
|
245 |
+
|
246 |
+
msgid "Search"
|
247 |
+
msgstr ""
|
248 |
+
|
249 |
+
msgid "Reset"
|
250 |
+
msgstr ""
|
251 |
+
|
252 |
+
msgid "Cleanup test content"
|
253 |
+
msgstr ""
|
254 |
+
|
255 |
+
msgid "Send to translation"
|
256 |
+
msgstr ""
|
257 |
+
|
258 |
+
msgid "Apply"
|
259 |
+
msgstr ""
|
260 |
+
|
261 |
+
msgid "Go to the first page"
|
262 |
+
msgstr ""
|
263 |
+
|
264 |
+
msgid "Go to the previous page"
|
265 |
+
msgstr ""
|
266 |
+
|
267 |
+
msgid "of"
|
268 |
+
msgstr ""
|
269 |
+
|
270 |
+
msgid "Go to the next page"
|
271 |
+
msgstr ""
|
272 |
+
|
273 |
+
msgid "Go to the last page"
|
274 |
+
msgstr ""
|
275 |
+
|
276 |
+
msgid "Show all products"
|
277 |
+
msgstr ""
|
278 |
+
|
279 |
+
msgid "Type"
|
280 |
+
msgstr ""
|
281 |
+
|
282 |
+
msgid "Product"
|
283 |
+
msgstr ""
|
284 |
+
|
285 |
+
msgid "Close"
|
286 |
+
msgstr ""
|
287 |
+
|
288 |
+
msgid "Edit translation"
|
289 |
+
msgstr ""
|
290 |
+
|
291 |
+
msgid "Language"
|
292 |
+
msgstr ""
|
293 |
+
|
294 |
+
msgid "Edit independently."
|
295 |
+
msgstr ""
|
296 |
+
|
297 |
+
msgid "Undo (keep this product as a duplicate)"
|
298 |
+
msgstr ""
|
299 |
+
|
300 |
+
msgid "Waiting for translator"
|
301 |
+
msgstr ""
|
302 |
+
|
303 |
+
msgid "Choose a file"
|
304 |
+
msgstr ""
|
305 |
+
|
306 |
+
msgid "Show content"
|
307 |
+
msgstr ""
|
308 |
+
|
309 |
+
msgid "Translation missing"
|
310 |
+
msgstr ""
|
311 |
+
|
312 |
+
msgid "Original content:"
|
313 |
+
msgstr ""
|
314 |
+
|
315 |
+
msgid "Please enter translation:"
|
316 |
+
msgstr ""
|
317 |
+
|
318 |
+
msgid "Cancel"
|
319 |
+
msgstr ""
|
320 |
+
|
321 |
+
msgid "Ok"
|
322 |
+
msgstr ""
|
323 |
+
|
324 |
+
msgid "name"
|
325 |
+
msgstr ""
|
326 |
+
|
327 |
+
msgid "values"
|
328 |
+
msgstr ""
|
329 |
+
|
330 |
+
msgid "Send products to translation"
|
331 |
+
msgstr ""
|
332 |
+
|
333 |
+
msgid "Upload file"
|
334 |
+
msgstr ""
|
335 |
+
|
336 |
+
msgid "WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href=\"%s\">WPML</a> versions prior 2.0.5."
|
337 |
+
msgstr ""
|
338 |
+
|
339 |
+
msgid "%s plugin is installed and activated."
|
340 |
+
msgstr ""
|
341 |
+
|
342 |
+
msgid "%s plugin is either not installed or not activated."
|
343 |
+
msgstr ""
|
344 |
+
|
345 |
+
msgid "%1$s is installed, but with incorrect version. You need %1$s %2$s or higher. "
|
346 |
+
msgstr ""
|
347 |
+
|
348 |
+
msgid "Your store's base currency is %s. To change it, go to the %s page."
|
349 |
+
msgstr ""
|
350 |
+
|
351 |
+
msgid "Exchange rate to %s"
|
352 |
+
msgstr ""
|
353 |
+
|
354 |
+
msgid "Plugins Status"
|
355 |
+
msgstr ""
|
356 |
+
|
357 |
+
msgid "Check required plugins"
|
358 |
+
msgstr ""
|
359 |
+
|
360 |
+
msgid "WooCommerce Multilingual depends on several plugins to work. If any required plugin is missing, you should install and activate it."
|
361 |
+
msgstr ""
|
362 |
+
|
363 |
+
msgid "Update WPML"
|
364 |
+
msgstr ""
|
365 |
+
|
366 |
+
msgid "Get WPML"
|
367 |
+
msgstr ""
|
368 |
+
|
369 |
+
msgid "Get WPML Media"
|
370 |
+
msgstr ""
|
371 |
+
|
372 |
+
msgid "Get WPML Translation Management"
|
373 |
+
msgstr ""
|
374 |
+
|
375 |
+
msgid "Get WPML String Translation"
|
376 |
+
msgstr ""
|
377 |
+
|
378 |
+
msgid "Download WooCommerce"
|
379 |
+
msgstr ""
|
380 |
+
|
381 |
+
msgid "WooCommerce Store Pages"
|
382 |
+
msgstr ""
|
383 |
+
|
384 |
+
msgid "Translated store pages"
|
385 |
+
msgstr ""
|
386 |
+
|
387 |
+
msgid "To run a multilingual e-commerce site, you need to have several WooCommerce shop pages in all the site's language. If they are missing, we will create them automatically for you."
|
388 |
+
msgstr ""
|
389 |
+
|
390 |
+
msgid "One or more WooCommerce pages have not been created"
|
391 |
+
msgstr ""
|
392 |
+
|
393 |
+
msgid "WooCommerce store pages don't exist for this language:"
|
394 |
+
msgstr ""
|
395 |
+
|
396 |
+
msgid "WooCommerce store pages don't exist for these languages:"
|
397 |
+
msgstr ""
|
398 |
+
|
399 |
+
msgid "Create missing store pages"
|
400 |
+
msgstr ""
|
401 |
+
|
402 |
+
msgid "Hide this message"
|
403 |
+
msgstr ""
|
404 |
+
|
405 |
+
msgid "Show missing languages"
|
406 |
+
msgstr ""
|
407 |
+
|
408 |
+
msgid "WooCommerce store pages are translated to all the site's languages."
|
409 |
+
msgstr ""
|
410 |
+
|
411 |
+
msgid "Taxonomies missing translations"
|
412 |
+
msgstr ""
|
413 |
+
|
414 |
+
msgid "Ignore"
|
415 |
+
msgstr ""
|
416 |
+
|
417 |
+
msgid "Right now, there are no taxonomy terms needing translation."
|
418 |
+
msgstr ""
|
419 |
+
|
420 |
+
msgid "Product Translation Interface"
|
421 |
+
msgstr ""
|
422 |
+
|
423 |
+
msgid "Product translation interface"
|
424 |
+
msgstr ""
|
425 |
+
|
426 |
+
msgid "The recommended way to translate products is using the products translation table in the WooCommerce Multilingual admin. Choose to go to the native WooCommerce interface, if your products include custom sections that require direct access."
|
427 |
+
msgstr ""
|
428 |
+
|
429 |
+
msgid "Choose what to do when clicking on the translation controls for products:"
|
430 |
+
msgstr ""
|
431 |
+
|
432 |
+
msgid "Go to the product translation table in WooCommerce Multilingual"
|
433 |
+
msgstr ""
|
434 |
+
|
435 |
+
msgid "Go to the native WooCommerce product editing screen"
|
436 |
+
msgstr ""
|
437 |
+
|
438 |
+
msgid "File Paths Synchronization "
|
439 |
+
msgstr ""
|
440 |
+
|
441 |
+
msgid "Synchronization for download paths"
|
442 |
+
msgstr ""
|
443 |
+
|
444 |
+
msgid "If you are using downloadable products, you can choose to have their paths synchronized, or seperate for each language."
|
445 |
+
msgstr ""
|
446 |
+
|
447 |
+
msgid "Use the same file paths in all languages"
|
448 |
+
msgstr ""
|
449 |
+
|
450 |
+
msgid "Different file paths for each language"
|
451 |
+
msgstr ""
|
452 |
+
|
453 |
+
msgid "Manage Currencies"
|
454 |
+
msgstr ""
|
455 |
+
|
456 |
+
msgid "Currency management"
|
457 |
+
msgstr ""
|
458 |
+
|
459 |
+
msgid "You can use different currencies and amounts for products in different languages. Once enabled, add currencies and choose a currency for each language."
|
460 |
+
msgstr ""
|
461 |
+
|
462 |
+
msgid "Enable multi-currency"
|
463 |
+
msgstr ""
|
464 |
+
|
465 |
+
msgid "Automatically calculate pricing in different currencies, based on the exchange rate"
|
466 |
+
msgstr ""
|
467 |
+
|
468 |
+
msgid "I will manage the pricing in each currency myself"
|
469 |
+
msgstr ""
|
470 |
+
|
471 |
+
msgid "Currency code"
|
472 |
+
msgstr ""
|
473 |
+
|
474 |
+
msgid "Changed"
|
475 |
+
msgstr ""
|
476 |
+
|
477 |
+
msgid "Please fill field"
|
478 |
+
msgstr ""
|
479 |
+
|
480 |
+
msgid "Only numeric"
|
481 |
+
msgstr ""
|
482 |
+
|
483 |
+
msgid "Edit"
|
484 |
+
msgstr ""
|
485 |
+
|
486 |
+
msgid "Delete"
|
487 |
+
msgstr ""
|
488 |
+
|
489 |
+
msgid "(*) This exchange rate is not applied automatically because you chose to set pricing manually in different currencies."
|
490 |
+
msgstr ""
|
491 |
+
|
492 |
+
msgid "Add currency"
|
493 |
+
msgstr ""
|
494 |
+
|
495 |
+
msgid "Currency"
|
496 |
+
msgstr ""
|
497 |
+
|
498 |
+
msgid "Troubleshooting page"
|
499 |
+
msgstr ""
|
500 |
+
|
501 |
+
msgid "Taxonomies without translation"
|
502 |
+
msgstr ""
|
503 |
+
|
504 |
+
msgid "To run a fully translated site, you should translate all taxonomy terms. Some store elements, such as variations, depend on taxonomy translation."
|
505 |
+
msgstr ""
|
506 |
+
|
507 |
+
msgid "This taxonomy requires translation."
|
508 |
+
msgstr ""
|
509 |
+
|
510 |
+
msgid "This taxonomy does not require translation."
|
511 |
+
msgstr ""
|
512 |
+
|
513 |
+
msgid "Troubleshooting"
|
514 |
+
msgstr ""
|
515 |
+
|
516 |
+
msgid "Please make backup of your database before start synchronization"
|
517 |
+
msgstr ""
|
518 |
+
|
519 |
+
msgid "Sync variables products"
|
520 |
+
msgstr ""
|
521 |
+
|
522 |
+
msgid "Update products count:"
|
523 |
+
msgstr ""
|
524 |
+
|
525 |
+
msgid "products with variations"
|
526 |
+
msgstr ""
|
527 |
+
|
528 |
+
msgid "Sync products variations:"
|
529 |
+
msgstr ""
|
530 |
+
|
531 |
+
msgid "left"
|
532 |
+
msgstr ""
|
533 |
+
|
534 |
+
msgid "Start"
|
535 |
+
msgstr ""
|
536 |
+
|
537 |
+
msgid "Please add variations to product"
|
538 |
+
msgstr ""
|
539 |
+
|
540 |
+
msgid "Please save translation before translate variations prices"
|
541 |
+
msgstr ""
|
542 |
+
|
543 |
+
msgid "Regular price"
|
544 |
+
msgstr ""
|
545 |
+
|
546 |
+
msgid "Sale price"
|
547 |
+
msgstr ""
|
548 |
+
|
549 |
+
msgid "Download URL"
|
550 |
+
msgstr ""
|
551 |
+
|
552 |
+
msgid "How to translate products"
|
553 |
+
msgstr ""
|
554 |
+
|
555 |
+
msgid "How to translate attributes"
|
556 |
+
msgstr ""
|
557 |
+
|
558 |
+
msgid "How to translate product categories"
|
559 |
+
msgstr ""
|
560 |
+
|
561 |
+
msgid "Would you like to see a quick overview?"
|
562 |
+
msgstr ""
|
563 |
+
|
564 |
+
msgid "Learn how to turn your e-commerce site multilingual"
|
565 |
+
msgstr ""
|
566 |
+
|
567 |
+
msgid "Dismiss"
|
568 |
+
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
locale/wpml-wcml-ar.mo
ADDED
Binary file
|
locale/wpml-wcml-de_DE.mo
ADDED
Binary file
|
locale/wpml-wcml-el.mo
ADDED
Binary file
|
locale/wpml-wcml-es_ES.mo
ADDED
Binary file
|
locale/wpml-wcml-fr_FR.mo
ADDED
Binary file
|
locale/wpml-wcml-he_IL.mo
ADDED
Binary file
|
locale/wpml-wcml-it_IT.mo
ADDED
Binary file
|
locale/wpml-wcml-ja.mo
ADDED
Binary file
|
locale/wpml-wcml-ko_KO.mo
ADDED
Binary file
|
locale/wpml-wcml-nl_NL.mo
ADDED
Binary file
|
locale/wpml-wcml-pl_PL.mo
ADDED
Binary file
|
locale/wpml-wcml-pt_BR.mo
ADDED
Binary file
|
locale/wpml-wcml-pt_PT.mo
ADDED
Binary file
|
locale/wpml-wcml-ru_RU.mo
ADDED
Binary file
|
locale/wpml-wcml-sv_SE.mo
ADDED
Binary file
|
locale/wpml-wcml-vn.mo
ADDED
Binary file
|
locale/wpml-wcml-zh_CN.mo
ADDED
Binary file
|
locale/wpml-wcml-zh_TW.mo
ADDED
Binary file
|
menu/sub/products.php
CHANGED
@@ -102,10 +102,12 @@ if($lm){
|
|
102 |
<?php endif; ?>
|
103 |
<input type="hidden" class="icl_def_language" value="<?php echo $default_language ?>" />
|
104 |
<input type="hidden" id="upd_product_nonce" value="<?php echo wp_create_nonce('update_product_actions'); ?>" />
|
|
|
105 |
<table class="widefat fixed wcml_products" cellspacing="0">
|
106 |
<thead>
|
107 |
<tr>
|
108 |
-
<th scope="col"
|
|
|
109 |
<th scope="col" width="20%"><?php _e('Product', 'wpml-wcml') ?></th>
|
110 |
<th scope="col" width="73%"><?php echo $woocommerce_wpml->products->get_translation_flags($active_languages,$default_language); ?></th>
|
111 |
</tr>
|
@@ -115,12 +117,13 @@ if($lm){
|
|
115 |
$lang_codes = array();
|
116 |
foreach ($active_languages as $language) {
|
117 |
if($default_language == $language['code'] || current_user_can('manage_options') || (wpml_check_user_is_translator($default_language,$language['code']) && !current_user_can('manage_options')) ){
|
118 |
-
if(!isset($_GET['slang']) || (isset($_GET['slang']) && ($_GET['slang'] == $language['code'] || $default_language == $language['code'] || $_GET['slang'] == '')))
|
119 |
-
$lang_codes[$language['code']] = $
|
120 |
}
|
121 |
}
|
|
|
122 |
unset($lang_codes[$default_language]);
|
123 |
-
$lang_codes = array($default_language => $
|
124 |
?>
|
125 |
<?php foreach ($products as $product) :
|
126 |
$product_id = icl_object_id($product->ID,'product',true,$default_language);
|
@@ -135,6 +138,19 @@ if($lm){
|
|
135 |
<td>
|
136 |
<input type="checkbox" name="product[]" value="<?php echo $product_id ?>" />
|
137 |
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
<td>
|
139 |
<?php echo $product->post_title ?>
|
140 |
</td>
|
@@ -146,7 +162,7 @@ if($lm){
|
|
146 |
</td>
|
147 |
</tr>
|
148 |
<tr class="outer" data-prid="<?php echo $product->ID; ?>">
|
149 |
-
<td colspan="
|
150 |
<div class="wcml_product_row" id="prid_<?php echo $product->ID; ?>" <?php echo isset($pr_edit) ? 'style="display:block;"':''; ?>>
|
151 |
<div class="inner">
|
152 |
<table class="fixed wcml_products_translation">
|
@@ -170,20 +186,20 @@ if($lm){
|
|
170 |
</thead>
|
171 |
<tbody>
|
172 |
<?php foreach ($lang_codes as $key=>$lang) : ?>
|
173 |
-
<?php if($key != $default_language && isset($product_translations[$key])
|
174 |
-
&& get_post_meta($product_translations[$key]->element_id, '_icl_lang_duplicate_of', true) == $product->ID):
|
175 |
$is_duplicate_product = true; ?>
|
176 |
-
|
177 |
<td> </td>
|
178 |
<td colspan="<?php echo count($product_contents); ?>">
|
179 |
<span class="js-wcml_duplicate_product_notice_<?php echo $key ?>" >
|
180 |
-
<?php printf(__('This product is an exact duplicate of the %s product.', 'wcml-wpml'),
|
181 |
$lang_codes[$sitepress->get_default_language()]); ?>
|
182 |
<a href="#edit-<?php echo $product_id ?>_<?php echo $key ?>"><?php _e('Edit independently.', 'wpml-wcml') ?></a>
|
183 |
</span>
|
184 |
<span class="js-wcml_duplicate_product_undo_<?php echo $key ?>" style="display: none;" >
|
185 |
<a href="#undo-<?php echo $product_id ?>_<?php echo $key ?>"><?php _e('Undo (keep this product as a duplicate)', 'wpml-wcml') ?></a>
|
186 |
-
</span>
|
187 |
</td>
|
188 |
</tr>
|
189 |
<?php else: $is_duplicate_product = false; ?>
|
@@ -214,7 +230,7 @@ if($lm){
|
|
214 |
}
|
215 |
}
|
216 |
}
|
217 |
-
$currency_code = $wpdb->get_var($wpdb->prepare("SELECT c.code FROM ". $wpdb->prefix ."icl_currencies as c LEFT JOIN ". $wpdb->prefix ."icl_languages_currencies as lc ON c.id=lc.currency_id WHERE lc.language_code = %s",$key));
|
218 |
foreach ($product_contents as $product_content) : ?>
|
219 |
<td>
|
220 |
<?php
|
@@ -261,7 +277,7 @@ if($lm){
|
|
261 |
<?php else: ?>
|
262 |
<button type="button" class="button-secondary wcml_edit_conten<?php if($is_duplicate_product): ?> js-dup-disabled<?php endif;?>"<?php if($is_duplicate_product): ?> disabled="disabled"<?php endif;?>><?php _e('Edit translation', 'wpml-wcml') ?></button>
|
263 |
<?php if($missing_translation): ?>
|
264 |
-
|
265 |
<p class="missing-translation">
|
266 |
<i class="icon-warning-sign"></i>
|
267 |
<?php _e('Translation missing', 'wpml-wcml'); ?>
|
@@ -390,7 +406,7 @@ if($lm){
|
|
390 |
<?php endif; ?>
|
391 |
|
392 |
<?php endif;?>
|
393 |
-
|
394 |
</form>
|
395 |
<?php if($products): ?>
|
396 |
<form method="post" name="translation-dashboard-filter" action="admin.php?page=<?php echo WPML_TM_FOLDER ?>/menu/main.php&sm=dashboard" >
|
102 |
<?php endif; ?>
|
103 |
<input type="hidden" class="icl_def_language" value="<?php echo $default_language ?>" />
|
104 |
<input type="hidden" id="upd_product_nonce" value="<?php echo wp_create_nonce('update_product_actions'); ?>" />
|
105 |
+
<?php wp_nonce_field('wcml_test_actions', 'wcml_nonce'); ?>
|
106 |
<table class="widefat fixed wcml_products" cellspacing="0">
|
107 |
<thead>
|
108 |
<tr>
|
109 |
+
<th scope="col"><input type="checkbox" value="" class="wcml_check_all"/></th>
|
110 |
+
<th scope="col" width="5%"><?php _e('Type', 'wpml-wcml') ?></th>
|
111 |
<th scope="col" width="20%"><?php _e('Product', 'wpml-wcml') ?></th>
|
112 |
<th scope="col" width="73%"><?php echo $woocommerce_wpml->products->get_translation_flags($active_languages,$default_language); ?></th>
|
113 |
</tr>
|
117 |
$lang_codes = array();
|
118 |
foreach ($active_languages as $language) {
|
119 |
if($default_language == $language['code'] || current_user_can('manage_options') || (wpml_check_user_is_translator($default_language,$language['code']) && !current_user_can('manage_options')) ){
|
120 |
+
if(!isset($_GET['slang']) || (isset($_GET['slang']) && ($_GET['slang'] == $language['code'] || $default_language == $language['code'] || $_GET['slang'] == 'all')))
|
121 |
+
$lang_codes[$language['code']] = $language['display_name'];
|
122 |
}
|
123 |
}
|
124 |
+
$default_language_display_name = $lang_codes[$default_language];
|
125 |
unset($lang_codes[$default_language]);
|
126 |
+
$lang_codes = array($default_language => $default_language_display_name)+$lang_codes;
|
127 |
?>
|
128 |
<?php foreach ($products as $product) :
|
129 |
$product_id = icl_object_id($product->ID,'product',true,$default_language);
|
138 |
<td>
|
139 |
<input type="checkbox" name="product[]" value="<?php echo $product_id ?>" />
|
140 |
</td>
|
141 |
+
<td>
|
142 |
+
<?php
|
143 |
+
$prod = get_product( $product->ID );
|
144 |
+
$icon_class_sufix = $prod->product_type;
|
145 |
+
if ( $prod -> is_virtual() ) {
|
146 |
+
$icon_class_sufix = 'virtual';
|
147 |
+
}
|
148 |
+
else if ( $prod -> is_downloadable() ) {
|
149 |
+
$icon_class_sufix = 'downloadable';
|
150 |
+
}
|
151 |
+
?>
|
152 |
+
<i class="icon-woo-<?php echo $icon_class_sufix; ?>" title="<?php echo $icon_class_sufix; ?>"></i>
|
153 |
+
</td>
|
154 |
<td>
|
155 |
<?php echo $product->post_title ?>
|
156 |
</td>
|
162 |
</td>
|
163 |
</tr>
|
164 |
<tr class="outer" data-prid="<?php echo $product->ID; ?>">
|
165 |
+
<td colspan="4">
|
166 |
<div class="wcml_product_row" id="prid_<?php echo $product->ID; ?>" <?php echo isset($pr_edit) ? 'style="display:block;"':''; ?>>
|
167 |
<div class="inner">
|
168 |
<table class="fixed wcml_products_translation">
|
186 |
</thead>
|
187 |
<tbody>
|
188 |
<?php foreach ($lang_codes as $key=>$lang) : ?>
|
189 |
+
<?php if($key != $default_language && isset($product_translations[$key])
|
190 |
+
&& get_post_meta($product_translations[$key]->element_id, '_icl_lang_duplicate_of', true) == $product->ID):
|
191 |
$is_duplicate_product = true; ?>
|
192 |
+
<tr class="wcml_duplicate_product_notice">
|
193 |
<td> </td>
|
194 |
<td colspan="<?php echo count($product_contents); ?>">
|
195 |
<span class="js-wcml_duplicate_product_notice_<?php echo $key ?>" >
|
196 |
+
<?php printf(__('This product is an exact duplicate of the %s product.', 'wcml-wpml'),
|
197 |
$lang_codes[$sitepress->get_default_language()]); ?>
|
198 |
<a href="#edit-<?php echo $product_id ?>_<?php echo $key ?>"><?php _e('Edit independently.', 'wpml-wcml') ?></a>
|
199 |
</span>
|
200 |
<span class="js-wcml_duplicate_product_undo_<?php echo $key ?>" style="display: none;" >
|
201 |
<a href="#undo-<?php echo $product_id ?>_<?php echo $key ?>"><?php _e('Undo (keep this product as a duplicate)', 'wpml-wcml') ?></a>
|
202 |
+
</span>
|
203 |
</td>
|
204 |
</tr>
|
205 |
<?php else: $is_duplicate_product = false; ?>
|
230 |
}
|
231 |
}
|
232 |
}
|
233 |
+
$currency_code = $wpdb->get_var($wpdb->prepare("SELECT c.code FROM ". $wpdb->prefix ."icl_currencies as c LEFT JOIN ". $wpdb->prefix ."icl_languages_currencies as lc ON c.id=lc.currency_id WHERE lc.language_code = %s",$key));
|
234 |
foreach ($product_contents as $product_content) : ?>
|
235 |
<td>
|
236 |
<?php
|
277 |
<?php else: ?>
|
278 |
<button type="button" class="button-secondary wcml_edit_conten<?php if($is_duplicate_product): ?> js-dup-disabled<?php endif;?>"<?php if($is_duplicate_product): ?> disabled="disabled"<?php endif;?>><?php _e('Edit translation', 'wpml-wcml') ?></button>
|
279 |
<?php if($missing_translation): ?>
|
280 |
+
<span class="wcml_field_translation_<?php echo $product_content ?>_<?php echo $key ?>">
|
281 |
<p class="missing-translation">
|
282 |
<i class="icon-warning-sign"></i>
|
283 |
<?php _e('Translation missing', 'wpml-wcml'); ?>
|
406 |
<?php endif; ?>
|
407 |
|
408 |
<?php endif;?>
|
409 |
+
|
410 |
</form>
|
411 |
<?php if($products): ?>
|
412 |
<form method="post" name="translation-dashboard-filter" action="admin.php?page=<?php echo WPML_TM_FOLDER ?>/menu/main.php&sm=dashboard" >
|
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.0
|
7 |
Tested up to: 3.7.1
|
8 |
-
Stable tag: 3.0
|
9 |
|
10 |
Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
|
11 |
|
@@ -31,7 +31,7 @@ After installing, go to WPML->WooCommerce Multilingual. The 'General settings' t
|
|
31 |
|
32 |
Then, continue to the 'Products' and any categories, tags and custom taxonomy that you use.
|
33 |
|
34 |
-
When you need help, go to [
|
35 |
|
36 |
= Downloads =
|
37 |
|
@@ -39,6 +39,17 @@ This version of WooCommerce Multilingual works with WooCommerce 2.x.
|
|
39 |
|
40 |
You will also need [WPML](http://wpml.org), together with the String Translation and the Translation Management modules, which are part of the [Multilingual CMS](http://wpml.org/purchase/) package.
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
== Installation ==
|
43 |
|
44 |
1. Upload 'woocommerce-multilingual' to the '/wp-content/plugins/' directory
|
@@ -66,6 +77,23 @@ In order for the checkout and store pages to appear translated, you need to crea
|
|
66 |
|
67 |
== Changelog ==
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
= 3.0 =
|
70 |
* Brand new GUI and workflow
|
71 |
* Support for easy taxonomy translation
|
5 |
License: GPLv2
|
6 |
Requires at least: 3.0
|
7 |
Tested up to: 3.7.1
|
8 |
+
Stable tag: 3.0.1
|
9 |
|
10 |
Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
|
11 |
|
31 |
|
32 |
Then, continue to the 'Products' and any categories, tags and custom taxonomy that you use.
|
33 |
|
34 |
+
When you need help, go to [WooCommerce Multilingual support forum](http://wpml.org/forums/topic-tag/woocommerce/).
|
35 |
|
36 |
= Downloads =
|
37 |
|
39 |
|
40 |
You will also need [WPML](http://wpml.org), together with the String Translation and the Translation Management modules, which are part of the [Multilingual CMS](http://wpml.org/purchase/) package.
|
41 |
|
42 |
+
= Minimum versions for WPML and modules =
|
43 |
+
|
44 |
+
WooCommerce Multilingual checks that the following versions of WPML and its components are active:
|
45 |
+
|
46 |
+
* WPML Multilingual CMS - 3.0
|
47 |
+
* WPML String Translation - 2.0
|
48 |
+
* WPML Translation Managenet - 1.9
|
49 |
+
* WPML Media - 2.1
|
50 |
+
|
51 |
+
Without having all these running, WooCommerce Multilingual will not be able to run.
|
52 |
+
|
53 |
== Installation ==
|
54 |
|
55 |
1. Upload 'woocommerce-multilingual' to the '/wp-content/plugins/' directory
|
77 |
|
78 |
== Changelog ==
|
79 |
|
80 |
+
= 3.0.1 =
|
81 |
+
* Replaced deprecated jQuery function live()
|
82 |
+
* Fixed bug: language names not localized on products editor page
|
83 |
+
* Fixed bug: Can't set "Custom post type" to translate
|
84 |
+
* Fixed bug: Translation fields not visible - In certain circumstances (e.g. search) the translation fields corresponding to the translated languages were missing
|
85 |
+
* Fixed alignment for �Update/Save� button in the products translation editor
|
86 |
+
* Fixed bug: Default selection not copied to duplicate products
|
87 |
+
* Fixed bug: Price doesn't change when change language on the cart page when set "I will manage the pricing in each currency myself"
|
88 |
+
* Resolved one compatibility issue with Woosidebars
|
89 |
+
* Direct translators to the products translation editor automatically (instead of the standard post translation editor)
|
90 |
+
* Fixed bug: In some situations (different child categories with the same name) the wrong categories were set to a duplicated product.
|
91 |
+
* Enhancement: Add icons for products in the products translation editor
|
92 |
+
* Register WooCommerce strings (defined as admin texts in the wpml config file) automatically on plugin activation
|
93 |
+
* WPML (+addons) - new versions required.
|
94 |
+
* lcfirst is only available since php 5.3
|
95 |
+
* Identify fields on known plugins and show their human name in our product translation table (support for WordPress SEO for now)
|
96 |
+
|
97 |
= 3.0 =
|
98 |
* Brand new GUI and workflow
|
99 |
* Support for easy taxonomy translation
|
woocommerce_wpml.class.php
CHANGED
@@ -67,15 +67,15 @@ class woocommerce_wpml {
|
|
67 |
|
68 |
//set translate product by default
|
69 |
$this->translate_product_slug();
|
70 |
-
|
71 |
if(is_admin() && isset($_GET['page']) && $_GET['page'] == 'wpml-wcml'){
|
72 |
-
remove_action( 'wp_before_admin_bar_render', array($sitepress, 'admin_language_switcher') );
|
73 |
}
|
74 |
}
|
75 |
|
76 |
function translate_product_slug(){
|
77 |
global $sitepress, $wpdb,$woocommerce, $sitepress_settings;
|
78 |
-
|
79 |
if(!defined('WOOCOMMERCE_VERSION') || (!isset($GLOBALS['ICL_Pro_Translation']) || is_null($GLOBALS['ICL_Pro_Translation']))){
|
80 |
return;
|
81 |
}
|
@@ -88,24 +88,16 @@ class woocommerce_wpml {
|
|
88 |
return;
|
89 |
}
|
90 |
|
91 |
-
if($sitepress_settings['posts_slug_translation']['on'] == 0 && isset($sitepress_settings['posts_slug_translation']['types'])){
|
92 |
-
foreach($sitepress_settings['posts_slug_translation']['types'] as $key=>$type){
|
93 |
-
if($key != $slug){
|
94 |
-
$sitepress_settings['posts_slug_translation']['types'][$key] = 0;
|
95 |
-
}
|
96 |
-
}
|
97 |
-
}
|
98 |
-
|
99 |
if(!empty($permalinks['product_base']) && isset($sitepress_settings['posts_slug_translation']['types'][$slug])){
|
100 |
$iclsettings['posts_slug_translation']['types'][$slug] = 0;
|
101 |
-
$sitepress->save_settings($iclsettings);
|
102 |
}
|
103 |
-
|
104 |
if( empty($sitepress_settings['theme_localization_type']) || $sitepress_settings['theme_localization_type'] != 1 ){
|
105 |
-
$sitepress->save_settings(array('theme_localization_type' => 1));
|
106 |
}
|
107 |
-
|
108 |
-
|
109 |
if($string->status != ICL_STRING_TRANSLATION_COMPLETE){
|
110 |
//get translations from .mo files
|
111 |
$current_language = $sitepress->get_current_language();
|
@@ -193,9 +185,16 @@ class woocommerce_wpml {
|
|
193 |
$version_in_db = get_option('_wcml_version');
|
194 |
if(!get_option('icl_is_created_languages_currencies') || ($version_in_db && version_compare($version_in_db, WCML_VERSION, '<'))){
|
195 |
$this->currencies->install();
|
|
|
196 |
update_option('icl_is_wcml_installed', 'yes');
|
197 |
}
|
198 |
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
if(is_null($this->settings['trnsl_interface'])){
|
200 |
$this->settings['trnsl_interface'] = 1;
|
201 |
$this->update_settings();
|
@@ -237,19 +236,27 @@ class woocommerce_wpml {
|
|
237 |
|
238 |
function load_css_and_js() {
|
239 |
if(isset($_GET['page']) && in_array($_GET['page'], array('wpml-wcml',basename(WCML_PLUGIN_PATH).'/menu/sub/troubleshooting.php'))) {
|
240 |
-
|
241 |
|
242 |
if ( !wp_style_is( 'toolset-font-awesome', 'registered' ) ) { // check if style are already registered
|
243 |
wp_register_style('toolset-font-awesome', WCML_PLUGIN_URL . '/assets/css/font-awesome.min.css', null, WCML_VERSION); // register if not
|
244 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
wp_enqueue_style('toolset-font-awesome'); // enqueue styles
|
246 |
-
wp_enqueue_style('
|
|
|
|
|
|
|
247 |
wp_enqueue_media();
|
248 |
-
wp_enqueue_script('wcml-tm-scripts'
|
249 |
-
wp_enqueue_script('jquery-cookie'
|
250 |
-
wp_enqueue_script('cleditor'
|
251 |
wp_enqueue_script('suggest');
|
252 |
-
wp_enqueue_style('wp-pointer');
|
253 |
wp_enqueue_script('wp-pointer');
|
254 |
}
|
255 |
}
|
@@ -323,27 +330,27 @@ class woocommerce_wpml {
|
|
323 |
global $sitepress;
|
324 |
return html_entity_decode($sitepress->convert_url($link));
|
325 |
}
|
326 |
-
|
327 |
function filter_woocommerce_permalinks_option($value){
|
328 |
global $wpdb, $sitepress_settings;
|
329 |
-
|
330 |
if(isset($value['product_base']) && $value['product_base']){
|
331 |
-
icl_register_string('URL slugs - ' . trim($value['product_base'] ,'/'), 'Url slug: ' . trim($value['product_base'] ,'/'), trim($value['product_base'] ,'/'));
|
332 |
// only register. it'll have to be translated via the string translation
|
333 |
}
|
334 |
-
|
335 |
if(isset($value['category_base']) && $value['category_base']){
|
336 |
-
icl_register_string('URL product_cat slugs - ' . trim($value['category_base'] ,'/'), 'Url product_cat slug: ' . trim($value['category_base'] ,'/'), trim($value['category_base'] ,'/'));
|
337 |
}
|
338 |
|
339 |
if(isset($value['tag_base']) && $value['tag_base']){
|
340 |
-
icl_register_string('URL product_tag slugs - ' . trim($value['tag_base'] ,'/'), 'Url product_tag slug: ' . trim($value['tag_base'] ,'/'), trim($value['tag_base'] ,'/'));
|
341 |
}
|
342 |
-
|
343 |
$value['product_base'] = trim($value['product_base'], '/');
|
344 |
-
|
345 |
-
return $value;
|
346 |
-
|
347 |
}
|
348 |
|
349 |
function add_language_to_paypal($args) {
|
@@ -352,4 +359,17 @@ class woocommerce_wpml {
|
|
352 |
return $args;
|
353 |
}
|
354 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
355 |
}
|
67 |
|
68 |
//set translate product by default
|
69 |
$this->translate_product_slug();
|
70 |
+
|
71 |
if(is_admin() && isset($_GET['page']) && $_GET['page'] == 'wpml-wcml'){
|
72 |
+
remove_action( 'wp_before_admin_bar_render', array($sitepress, 'admin_language_switcher') );
|
73 |
}
|
74 |
}
|
75 |
|
76 |
function translate_product_slug(){
|
77 |
global $sitepress, $wpdb,$woocommerce, $sitepress_settings;
|
78 |
+
|
79 |
if(!defined('WOOCOMMERCE_VERSION') || (!isset($GLOBALS['ICL_Pro_Translation']) || is_null($GLOBALS['ICL_Pro_Translation']))){
|
80 |
return;
|
81 |
}
|
88 |
return;
|
89 |
}
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
if(!empty($permalinks['product_base']) && isset($sitepress_settings['posts_slug_translation']['types'][$slug])){
|
92 |
$iclsettings['posts_slug_translation']['types'][$slug] = 0;
|
93 |
+
$sitepress->save_settings($iclsettings);
|
94 |
}
|
95 |
+
|
96 |
if( empty($sitepress_settings['theme_localization_type']) || $sitepress_settings['theme_localization_type'] != 1 ){
|
97 |
+
$sitepress->save_settings(array('theme_localization_type' => 1));
|
98 |
}
|
99 |
+
|
100 |
+
|
101 |
if($string->status != ICL_STRING_TRANSLATION_COMPLETE){
|
102 |
//get translations from .mo files
|
103 |
$current_language = $sitepress->get_current_language();
|
185 |
$version_in_db = get_option('_wcml_version');
|
186 |
if(!get_option('icl_is_created_languages_currencies') || ($version_in_db && version_compare($version_in_db, WCML_VERSION, '<'))){
|
187 |
$this->currencies->install();
|
188 |
+
|
189 |
update_option('icl_is_wcml_installed', 'yes');
|
190 |
}
|
191 |
|
192 |
+
if(!isset($this->settings['wc_admin_options_saved'])){
|
193 |
+
$this->handle_admin_texts();
|
194 |
+
$this->settings['wc_admin_options_saved'] = 1;
|
195 |
+
$this->update_settings();
|
196 |
+
}
|
197 |
+
|
198 |
if(is_null($this->settings['trnsl_interface'])){
|
199 |
$this->settings['trnsl_interface'] = 1;
|
200 |
$this->update_settings();
|
236 |
|
237 |
function load_css_and_js() {
|
238 |
if(isset($_GET['page']) && in_array($_GET['page'], array('wpml-wcml',basename(WCML_PLUGIN_PATH).'/menu/sub/troubleshooting.php'))) {
|
239 |
+
|
240 |
|
241 |
if ( !wp_style_is( 'toolset-font-awesome', 'registered' ) ) { // check if style are already registered
|
242 |
wp_register_style('toolset-font-awesome', WCML_PLUGIN_URL . '/assets/css/font-awesome.min.css', null, WCML_VERSION); // register if not
|
243 |
}
|
244 |
+
wp_register_style('wpml-wcml', WCML_PLUGIN_URL . '/assets/css/management.css', array('toolset-font-awesome'), WCML_VERSION);
|
245 |
+
wp_register_style('cleditor', WCML_PLUGIN_URL . '/assets/css/jquery.cleditor.css', null, WCML_VERSION);
|
246 |
+
wp_register_script('wcml-tm-scripts', WCML_PLUGIN_URL . '/assets/js/scripts.js', array('jquery'), WCML_VERSION);
|
247 |
+
wp_register_script('jquery-cookie', WCML_PLUGIN_URL . '/assets/js/jquery.cookie.js', array('jquery'), WCML_VERSION);
|
248 |
+
wp_register_script('cleditor', WCML_PLUGIN_URL . '/assets/js/jquery.cleditor.min.js', array('jquery'), WCML_VERSION);
|
249 |
+
|
250 |
wp_enqueue_style('toolset-font-awesome'); // enqueue styles
|
251 |
+
wp_enqueue_style('wpml-wcml');
|
252 |
+
wp_enqueue_style('cleditor');
|
253 |
+
wp_enqueue_style('wp-pointer');
|
254 |
+
|
255 |
wp_enqueue_media();
|
256 |
+
wp_enqueue_script('wcml-tm-scripts');
|
257 |
+
wp_enqueue_script('jquery-cookie');
|
258 |
+
wp_enqueue_script('cleditor');
|
259 |
wp_enqueue_script('suggest');
|
|
|
260 |
wp_enqueue_script('wp-pointer');
|
261 |
}
|
262 |
}
|
330 |
global $sitepress;
|
331 |
return html_entity_decode($sitepress->convert_url($link));
|
332 |
}
|
333 |
+
|
334 |
function filter_woocommerce_permalinks_option($value){
|
335 |
global $wpdb, $sitepress_settings;
|
336 |
+
|
337 |
if(isset($value['product_base']) && $value['product_base']){
|
338 |
+
icl_register_string('URL slugs - ' . trim($value['product_base'] ,'/'), 'Url slug: ' . trim($value['product_base'] ,'/'), trim($value['product_base'] ,'/'));
|
339 |
// only register. it'll have to be translated via the string translation
|
340 |
}
|
341 |
+
|
342 |
if(isset($value['category_base']) && $value['category_base']){
|
343 |
+
icl_register_string('URL product_cat slugs - ' . trim($value['category_base'] ,'/'), 'Url product_cat slug: ' . trim($value['category_base'] ,'/'), trim($value['category_base'] ,'/'));
|
344 |
}
|
345 |
|
346 |
if(isset($value['tag_base']) && $value['tag_base']){
|
347 |
+
icl_register_string('URL product_tag slugs - ' . trim($value['tag_base'] ,'/'), 'Url product_tag slug: ' . trim($value['tag_base'] ,'/'), trim($value['tag_base'] ,'/'));
|
348 |
}
|
349 |
+
|
350 |
$value['product_base'] = trim($value['product_base'], '/');
|
351 |
+
|
352 |
+
return $value;
|
353 |
+
|
354 |
}
|
355 |
|
356 |
function add_language_to_paypal($args) {
|
359 |
return $args;
|
360 |
}
|
361 |
|
362 |
+
|
363 |
+
function handle_admin_texts(){
|
364 |
+
if(class_exists('woocommerce')){
|
365 |
+
//emails texts
|
366 |
+
$emails = new WC_Emails();
|
367 |
+
foreach($emails->emails as $email){
|
368 |
+
$option_name = $email->plugin_id.$email->id.'_settings';
|
369 |
+
if(!get_option($option_name)){
|
370 |
+
add_option($option_name,$email->settings);
|
371 |
+
}
|
372 |
+
}
|
373 |
+
}
|
374 |
+
}
|
375 |
}
|
wpml-config.xml
CHANGED
@@ -80,52 +80,6 @@
|
|
80 |
<key name="woocommerce_customer_processing_order_settings">
|
81 |
<key name="subject" />
|
82 |
<key name="heading" />
|
83 |
-
</key>
|
84 |
-
<key name="wc_fields_billing">
|
85 |
-
<key name="billing_country">
|
86 |
-
<key name="label" />
|
87 |
-
<key name="placeholder" />
|
88 |
-
</key>
|
89 |
-
<key name="billing_first_name">
|
90 |
-
<key name="label" />
|
91 |
-
<key name="placeholder" />
|
92 |
-
</key>
|
93 |
-
<key name="billing_last_name">
|
94 |
-
<key name="label" />
|
95 |
-
<key name="placeholder" />
|
96 |
-
</key>
|
97 |
-
<key name="billing_company">
|
98 |
-
<key name="label" />
|
99 |
-
<key name="placeholder" />
|
100 |
-
</key>
|
101 |
-
<key name="billing_address_1">
|
102 |
-
<key name="label" />
|
103 |
-
<key name="placeholder" />
|
104 |
-
</key>
|
105 |
-
<key name="billing_address_2">
|
106 |
-
<key name="label" />
|
107 |
-
<key name="placeholder" />
|
108 |
-
</key>
|
109 |
-
<key name="billing_postcode">
|
110 |
-
<key name="label" />
|
111 |
-
<key name="placeholder" />
|
112 |
-
</key>
|
113 |
-
<key name="billing_city">
|
114 |
-
<key name="label" />
|
115 |
-
<key name="placeholder" />
|
116 |
-
</key>
|
117 |
-
<key name="billing_state">
|
118 |
-
<key name="label" />
|
119 |
-
<key name="placeholder" />
|
120 |
-
</key>
|
121 |
-
<key name="billing_email">
|
122 |
-
<key name="label" />
|
123 |
-
<key name="placeholder" />
|
124 |
-
</key>
|
125 |
-
<key name="billing_phone">
|
126 |
-
<key name="label" />
|
127 |
-
<key name="placeholder" />
|
128 |
-
</key>
|
129 |
-
</key>
|
130 |
</admin-texts>
|
131 |
</wpml-config>
|
80 |
<key name="woocommerce_customer_processing_order_settings">
|
81 |
<key name="subject" />
|
82 |
<key name="heading" />
|
83 |
+
</key>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
</admin-texts>
|
85 |
</wpml-config>
|
wpml-woocommerce.php
CHANGED
@@ -5,11 +5,11 @@
|
|
5 |
Description: Allows running fully multilingual e-Commerce sites with WooCommerce and WPML. <a href="http://wpml.org/documentation/related-projects/woocommerce-multilingual/">Documentation</a>.
|
6 |
Author: ICanLocalize
|
7 |
Author URI: http://wpml.org/
|
8 |
-
Version: 3.0
|
9 |
*/
|
10 |
|
11 |
if(defined('WCML_VERSION')) return;
|
12 |
-
define('WCML_VERSION', '3.0');
|
13 |
define('WCML_PLUGIN_PATH', dirname(__FILE__));
|
14 |
define('WCML_PLUGIN_FOLDER', basename(WCML_PLUGIN_PATH));
|
15 |
define('WCML_PLUGIN_URL', plugins_url() . '/' . WCML_PLUGIN_FOLDER);
|
5 |
Description: Allows running fully multilingual e-Commerce sites with WooCommerce and WPML. <a href="http://wpml.org/documentation/related-projects/woocommerce-multilingual/">Documentation</a>.
|
6 |
Author: ICanLocalize
|
7 |
Author URI: http://wpml.org/
|
8 |
+
Version: 3.0.1
|
9 |
*/
|
10 |
|
11 |
if(defined('WCML_VERSION')) return;
|
12 |
+
define('WCML_VERSION', '3.0.1');
|
13 |
define('WCML_PLUGIN_PATH', dirname(__FILE__));
|
14 |
define('WCML_PLUGIN_FOLDER', basename(WCML_PLUGIN_PATH));
|
15 |
define('WCML_PLUGIN_URL', plugins_url() . '/' . WCML_PLUGIN_FOLDER);
|