Version Description
- In some cases product translation can be converted to a simple product instead of correct type after saving
- Fix not recalculated ratings after remove rating from admin
- Fix no link to reviews in other languages if no reviews left in current one
- Fix "set_product_language" REST API call not supported "PUT" method
- Fix endpoints on My Account page when using a custom base permalink
- Fix stock_status synchronization for variable products with stock management on product level
- Fixed performance issues while translating Product via WPML Translation Editor with a lot of variations
- Fixed overridden discounted item price when manually creating/editing order from the admin
- Fixed customer email language when changing order from "On Hold" to "Processing"
- Fixed product gallery being synchronized even if WPML media duplication option is disabled
- Fixed custom "Sing-up Fee" price for variation Subscription not saved
- Fixed variation not available in second language in some cases when original language is German or Danish
- Fix mixed endpoint contexts/domains and their translations/language
- Fixed inability to add reviews after bought product
Download this release
Release Info
Developer | sergey.r |
Plugin | WooCommerce Multilingual – run WooCommerce with WPML |
Version | 4.6.3 |
Comparing to | |
See all releases |
Code changes from version 4.6.2.1 to 4.6.3
- changelog/4.6.2.1.md +0 -1
- changelog/4.6.3.md +15 -0
- classes/rest-api-support/class-wcml-rest-api-support.php +1 -1
- compatibility/class-wcml-the-events-calendar.php +6 -0
- compatibility/class-wcml-wc-subscriptions.php +1 -1
- inc/class-wcml-attributes.php +18 -9
- inc/class-wcml-comments.php +50 -29
- inc/class-wcml-emails.php +23 -8
- inc/class-wcml-endpoints.php +5 -4
- inc/class-wcml-media.php +36 -16
- inc/class-wcml-orders.php +8 -0
- inc/class-wcml-products.php +59 -18
- inc/class-wcml-tp-support.php +6 -6
- inc/currencies/class-wcml-multi-currency-orders.php +19 -15
- inc/translation-editor/class-wcml-editor-ui-product-job.php +8 -8
- inc/translation-editor/class-wcml-synchronize-product-data.php +27 -9
- inc/translation-editor/class-wcml-synchronize-variations-data.php +11 -8
- readme.txt +18 -2
- res/js/lock_fields.js +5 -4
- res/js/lock_fields.min.js +1 -1
- vendor/autoload.php +1 -1
- vendor/autoload_52.php +1 -1
- vendor/composer/autoload_real.php +7 -7
- vendor/composer/autoload_real_52.php +3 -3
- vendor/composer/autoload_static.php +5 -5
- wpml-woocommerce.php +4 -4
changelog/4.6.2.1.md
CHANGED
@@ -1,3 +1,2 @@
|
|
1 |
# Fixes
|
2 |
-
* [wcml-2783] -
|
3 |
* [wcml-2782] Fix performance issues with WooCommerce 3.6.*
|
1 |
# Fixes
|
|
|
2 |
* [wcml-2782] Fix performance issues with WooCommerce 3.6.*
|
changelog/4.6.3.md
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Fixes
|
2 |
+
* [wcml-2801] In some cases product translation can be converted to a simple product instead of correct type after saving
|
3 |
+
* [wcml-2796] Fix not recalculated ratings after remove rating from admin
|
4 |
+
* [wcml-2794] Fix no link to reviews in other languages if no reviews left in current one
|
5 |
+
* [wcml-2789] Fix "set_product_language" REST API call not supported "PUT" method
|
6 |
+
* [wcml-2788] Fix endpoints on My Account page when using a custom base permalink
|
7 |
+
* [wcml-2786] Fix stock_status synchronization for variable products with stock management on product level
|
8 |
+
* [wcml-2785] Fixed performance issues while translating Product via WPML Translation Editor with a lot of variations
|
9 |
+
* [wcml-2765] Fixed overridden discounted item price when manually creating/editing order from the admin
|
10 |
+
* [wcml-2758] Fixed customer email language when changing order from "On Hold" to "Processing"
|
11 |
+
* [wcml-2753] Fixed product gallery being synchronized even if WPML media duplication option is disabled
|
12 |
+
* [wcml-2736] Fixed custom "Sing-up Fee" price for variation Subscription not saved
|
13 |
+
* [wcml-2688] Fixed variation not available in second language in some cases when original language is German or Danish
|
14 |
+
* [wcml-2637] Fix mixed endpoint contexts/domains and their translations/language
|
15 |
+
* [wcml-2567] Fixed inability to add reviews after bought product
|
classes/rest-api-support/class-wcml-rest-api-support.php
CHANGED
@@ -219,7 +219,7 @@ class WCML_REST_API_Support{
|
|
219 |
|
220 |
$data = $request->get_params();
|
221 |
|
222 |
-
if( isset( $data['lang'] ) &&
|
223 |
$active_languages = $this->sitepress->get_active_languages();
|
224 |
if( !isset( $active_languages[$data['lang']] ) ){
|
225 |
throw new WCML_REST_Invalid_Language_Exception( $data['lang'] );
|
219 |
|
220 |
$data = $request->get_params();
|
221 |
|
222 |
+
if( isset( $data['lang'] ) && in_array( $request->get_method(), array( 'POST', 'PUT' ), true ) ){
|
223 |
$active_languages = $this->sitepress->get_active_languages();
|
224 |
if( !isset( $active_languages[$data['lang']] ) ){
|
225 |
throw new WCML_REST_Invalid_Language_Exception( $data['lang'] );
|
compatibility/class-wcml-the-events-calendar.php
CHANGED
@@ -41,6 +41,7 @@ class WCML_The_Events_Calendar{
|
|
41 |
} else {
|
42 |
add_action( 'event_tickets_rsvp_tickets_generated', array( $this, 'sync_rsvp_fields_on_attendee_created' ), 10, 3 );
|
43 |
add_filter( 'tribe_get_organizer_ids', array( $this, 'get_translated_organizer_ids' ), 10, 2 );
|
|
|
44 |
}
|
45 |
|
46 |
}
|
@@ -488,5 +489,10 @@ class WCML_The_Events_Calendar{
|
|
488 |
}
|
489 |
return $organizer_ids;
|
490 |
}
|
|
|
|
|
|
|
|
|
|
|
491 |
}
|
492 |
|
41 |
} else {
|
42 |
add_action( 'event_tickets_rsvp_tickets_generated', array( $this, 'sync_rsvp_fields_on_attendee_created' ), 10, 3 );
|
43 |
add_filter( 'tribe_get_organizer_ids', array( $this, 'get_translated_organizer_ids' ), 10, 2 );
|
44 |
+
add_filter( 'tribe_events_cost_unformatted', array( $this, 'convert_events_cost' ), 10, 1 );
|
45 |
}
|
46 |
|
47 |
}
|
489 |
}
|
490 |
return $organizer_ids;
|
491 |
}
|
492 |
+
|
493 |
+
public function convert_events_cost( $cost ) {
|
494 |
+
return apply_filters( 'wcml_raw_price_amount', $cost );
|
495 |
+
}
|
496 |
+
|
497 |
}
|
498 |
|
compatibility/class-wcml-wc-subscriptions.php
CHANGED
@@ -140,7 +140,7 @@ class WCML_WC_Subscriptions{
|
|
140 |
}
|
141 |
|
142 |
if( $variation_id && isset( $_POST[ '_custom_variation_subscription_sign_up_fee' ][ $code ][ $variation_id ] ) ){
|
143 |
-
$prices[ '_subscription_sign_up_fee' ] = wc_format_decimal( $_POST[ '
|
144 |
}
|
145 |
|
146 |
return $prices;
|
140 |
}
|
141 |
|
142 |
if( $variation_id && isset( $_POST[ '_custom_variation_subscription_sign_up_fee' ][ $code ][ $variation_id ] ) ){
|
143 |
+
$prices[ '_subscription_sign_up_fee' ] = wc_format_decimal( $_POST[ '_custom_variation_subscription_sign_up_fee' ][ $code ][ $variation_id ] );
|
144 |
}
|
145 |
|
146 |
return $prices;
|
inc/class-wcml-attributes.php
CHANGED
@@ -537,7 +537,7 @@ class WCML_Attributes{
|
|
537 |
*/
|
538 |
function filter_attribute_name( $attribute_name, $product_id, $return_sanitized = false ) {
|
539 |
|
540 |
-
if ( !
|
541 |
$orig_lang = $this->woocommerce_wpml->products->get_original_product_language( $product_id );
|
542 |
$current_language = $this->sitepress->get_current_language();
|
543 |
|
@@ -554,18 +554,27 @@ class WCML_Attributes{
|
|
554 |
return $attribute_name;
|
555 |
}
|
556 |
|
557 |
-
|
558 |
|
559 |
-
|
|
|
|
|
|
|
560 |
|
561 |
-
|
562 |
-
|
563 |
-
|
|
|
|
|
564 |
|
565 |
-
|
|
|
|
|
566 |
|
567 |
-
|
568 |
-
|
|
|
|
|
569 |
|
570 |
public function is_a_taxonomy( $attribute ){
|
571 |
|
537 |
*/
|
538 |
function filter_attribute_name( $attribute_name, $product_id, $return_sanitized = false ) {
|
539 |
|
540 |
+
if ( !is_admin() && $product_id ) {
|
541 |
$orig_lang = $this->woocommerce_wpml->products->get_original_product_language( $product_id );
|
542 |
$current_language = $this->sitepress->get_current_language();
|
543 |
|
554 |
return $attribute_name;
|
555 |
}
|
556 |
|
557 |
+
public function filter_adding_to_cart_product_attributes_names( $attributes ) {
|
558 |
|
559 |
+
if (
|
560 |
+
( isset( $_REQUEST['add-to-cart'] ) ) ||
|
561 |
+
( isset( $_REQUEST['wc-ajax'] ) && 'get_variation' === $_REQUEST['wc-ajax'] && isset( $_REQUEST['product_id'] ) )
|
562 |
+
) {
|
563 |
|
564 |
+
if ( isset( $_REQUEST['add-to-cart'] ) ) {
|
565 |
+
$product_id = $_REQUEST['add-to-cart'];
|
566 |
+
} else {
|
567 |
+
$product_id = $_REQUEST['product_id'];
|
568 |
+
}
|
569 |
|
570 |
+
foreach ( $attributes as $key => $attribute ) {
|
571 |
+
$attributes[ $key ]['name'] = $this->filter_attribute_name( $attributes[ $key ]['name'], $product_id );
|
572 |
+
}
|
573 |
|
574 |
+
}
|
575 |
+
|
576 |
+
return $attributes;
|
577 |
+
}
|
578 |
|
579 |
public function is_a_taxonomy( $attribute ){
|
580 |
|
inc/class-wcml-comments.php
CHANGED
@@ -33,8 +33,12 @@ class WCML_Comments {
|
|
33 |
|
34 |
add_filter( 'get_post_metadata', array( $this, 'filter_average_rating' ), 10, 4 );
|
35 |
add_filter( 'comments_clauses', array( $this, 'comments_clauses' ), 10, 2 );
|
36 |
-
|
|
|
37 |
add_filter( 'wpml_is_comment_query_filtered', array( $this, 'is_comment_query_filtered' ), 10, 2 );
|
|
|
|
|
|
|
38 |
}
|
39 |
|
40 |
/**
|
@@ -68,8 +72,10 @@ class WCML_Comments {
|
|
68 |
$reviews_count = 0;
|
69 |
|
70 |
foreach ( $translations as $translation ) {
|
71 |
-
$
|
72 |
-
|
|
|
|
|
73 |
|
74 |
if ( is_array( $ratings ) ) {
|
75 |
foreach ( $ratings as $rating => $count ) {
|
@@ -80,6 +86,9 @@ class WCML_Comments {
|
|
80 |
|
81 |
if( $review_count ){
|
82 |
$reviews_count += $review_count;
|
|
|
|
|
|
|
83 |
}
|
84 |
}
|
85 |
|
@@ -162,36 +171,33 @@ class WCML_Comments {
|
|
162 |
|
163 |
/**
|
164 |
* Display link to show rating in all/current language
|
165 |
-
*
|
166 |
-
* @param array $args
|
167 |
-
* @return array
|
168 |
*/
|
169 |
-
public function comments_link(
|
170 |
-
|
171 |
-
$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
172 |
-
$current_language = $this->sitepress->get_current_language();
|
173 |
-
|
174 |
-
if ( ! isset( $_GET['clang'] ) || $current_language === $_GET['clang'] ) {
|
175 |
-
$comments_link = add_query_arg( array( 'clang' => 'all' ), $current_url );
|
176 |
-
$all_languages_reviews_count = $this->get_reviews_count( 'all' );
|
177 |
-
$current_language_reviews_count = $this->get_reviews_count();
|
178 |
-
|
179 |
-
if( $all_languages_reviews_count > $current_language_reviews_count ){
|
180 |
-
$comments_link_text = sprintf( __( 'Show reviews in all languages (%s)', 'woocommerce-multilingual'), $all_languages_reviews_count);
|
181 |
-
}
|
182 |
-
} elseif ( 'all' === $_GET['clang'] ) {
|
183 |
|
184 |
-
|
185 |
-
$
|
186 |
-
$
|
187 |
-
$comments_link_text = sprintf( __( 'Show only reviews in %s (%s)', 'woocommerce-multilingual'), $language_details['display_name'], $current_language_reviews_count );
|
188 |
-
}
|
189 |
|
190 |
-
|
191 |
-
|
192 |
-
|
|
|
193 |
|
194 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
}
|
196 |
|
197 |
/**
|
@@ -264,4 +270,19 @@ class WCML_Comments {
|
|
264 |
return $reviews_count;
|
265 |
}
|
266 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
267 |
}
|
33 |
|
34 |
add_filter( 'get_post_metadata', array( $this, 'filter_average_rating' ), 10, 4 );
|
35 |
add_filter( 'comments_clauses', array( $this, 'comments_clauses' ), 10, 2 );
|
36 |
+
add_action( 'comment_form_before', array( $this, 'comments_link' ) );
|
37 |
+
|
38 |
add_filter( 'wpml_is_comment_query_filtered', array( $this, 'is_comment_query_filtered' ), 10, 2 );
|
39 |
+
add_action( 'trashed_comment', array( $this, 'recalculate_average_rating_on_comment_hook' ), 10, 2 );
|
40 |
+
add_action( 'deleted_comment', array( $this, 'recalculate_average_rating_on_comment_hook' ), 10, 2 );
|
41 |
+
add_action( 'untrashed_comment', array( $this, 'recalculate_average_rating_on_comment_hook' ), 10, 2 );
|
42 |
}
|
43 |
|
44 |
/**
|
72 |
$reviews_count = 0;
|
73 |
|
74 |
foreach ( $translations as $translation ) {
|
75 |
+
$product = wc_get_product( $translation );
|
76 |
+
|
77 |
+
$ratings = WC_Comments::get_rating_counts_for_product( $product );
|
78 |
+
$review_count = WC_Comments::get_review_count_for_product( $product );
|
79 |
|
80 |
if ( is_array( $ratings ) ) {
|
81 |
foreach ( $ratings as $rating => $count ) {
|
86 |
|
87 |
if( $review_count ){
|
88 |
$reviews_count += $review_count;
|
89 |
+
}else{
|
90 |
+
update_post_meta( $translation, self::WCML_AVERAGE_RATING_KEY, null );
|
91 |
+
update_post_meta( $translation, self::WCML_REVIEW_COUNT_KEY, null );
|
92 |
}
|
93 |
}
|
94 |
|
171 |
|
172 |
/**
|
173 |
* Display link to show rating in all/current language
|
|
|
|
|
|
|
174 |
*/
|
175 |
+
public function comments_link( ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
|
177 |
+
if( is_product() ){
|
178 |
+
$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
179 |
+
$current_language = $this->sitepress->get_current_language();
|
|
|
|
|
180 |
|
181 |
+
if ( ! isset( $_GET['clang'] ) || $current_language === $_GET['clang'] ) {
|
182 |
+
$comments_link = add_query_arg( array( 'clang' => 'all' ), $current_url );
|
183 |
+
$all_languages_reviews_count = $this->get_reviews_count( 'all' );
|
184 |
+
$current_language_reviews_count = $this->get_reviews_count();
|
185 |
|
186 |
+
if( $all_languages_reviews_count > $current_language_reviews_count ){
|
187 |
+
$comments_link_text = sprintf( __( 'Show reviews in all languages (%s)', 'woocommerce-multilingual'), $all_languages_reviews_count);
|
188 |
+
}
|
189 |
+
} elseif ( 'all' === $_GET['clang'] ) {
|
190 |
+
|
191 |
+
$current_language_reviews_count = $this->get_reviews_count();
|
192 |
+
$comments_link = add_query_arg( array( 'clang' => $current_language ), $current_url );
|
193 |
+
$language_details = $this->sitepress->get_language_details( $current_language );
|
194 |
+
$comments_link_text = sprintf( __( 'Show only reviews in %s (%s)', 'woocommerce-multilingual'), $language_details['display_name'], $current_language_reviews_count );
|
195 |
+
}
|
196 |
+
|
197 |
+
if( isset( $comments_link_text ) && $comments_link_text ){
|
198 |
+
echo '<p><a id="lang-comments-link" href="' . $comments_link . '">' . $comments_link_text . '</a></p>';
|
199 |
+
}
|
200 |
+
}
|
201 |
}
|
202 |
|
203 |
/**
|
270 |
return $reviews_count;
|
271 |
}
|
272 |
|
273 |
+
/**
|
274 |
+
* @param int $comment_id
|
275 |
+
* @param WP_Comment|null $comment
|
276 |
+
*/
|
277 |
+
public function recalculate_average_rating_on_comment_hook( $comment_id, $comment ){
|
278 |
+
|
279 |
+
if( !$comment ){
|
280 |
+
$comment = get_comment( $comment_id );
|
281 |
+
}
|
282 |
+
|
283 |
+
if( in_array( get_post_type( $comment->comment_post_ID ), array( 'product', 'product_variation' ) ) ){
|
284 |
+
$this->recalculate_comment_rating( (int)$comment->comment_post_ID );
|
285 |
+
}
|
286 |
+
}
|
287 |
+
|
288 |
}
|
inc/class-wcml-emails.php
CHANGED
@@ -43,11 +43,17 @@ class WCML_Emails{
|
|
43 |
|
44 |
add_action( 'wp_ajax_woocommerce_mark_order_status', array( $this, 'email_refresh_in_ajax' ), 9 );
|
45 |
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
|
|
50 |
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
foreach( array( 'pending', 'failed', 'cancelled' ) as $state ) {
|
53 |
add_action( 'woocommerce_order_status_' . $state . '_to_on-hold_notification', array(
|
@@ -65,10 +71,7 @@ class WCML_Emails{
|
|
65 |
|
66 |
//change order status
|
67 |
add_action( 'woocommerce_order_status_completed', array( $this, 'refresh_email_lang_complete' ), 9 );
|
68 |
-
|
69 |
-
$this,
|
70 |
-
'refresh_email_lang'
|
71 |
-
), 9 );
|
72 |
add_action( 'woocommerce_order_status_pending_to_on-hold_notification', array(
|
73 |
$this,
|
74 |
'refresh_email_lang'
|
@@ -129,6 +132,9 @@ class WCML_Emails{
|
|
129 |
|
130 |
add_filter( 'woocommerce_email_heading_customer_on_hold_order', array( $this, 'customer_on_hold_order_heading' ) );
|
131 |
add_filter( 'woocommerce_email_subject_customer_on_hold_order', array( $this, 'customer_on_hold_order_subject' ) );
|
|
|
|
|
|
|
132 |
}
|
133 |
|
134 |
function email_refresh_in_ajax() {
|
@@ -225,6 +231,15 @@ class WCML_Emails{
|
|
225 |
$this->translate_email_headings( $order_id, 'WC_Email_Customer_Processing_Order', 'woocommerce_customer_processing_order_settings' );
|
226 |
}
|
227 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
public function email_heading_on_hold( $order_id ){
|
229 |
$this->translate_email_headings( $order_id, 'WC_Email_Customer_On_Hold_Order', 'woocommerce_customer_on_hold_order_settings' );
|
230 |
}
|
43 |
|
44 |
add_action( 'wp_ajax_woocommerce_mark_order_status', array( $this, 'email_refresh_in_ajax' ), 9 );
|
45 |
|
46 |
+
foreach( array( 'pending', 'failed', 'cancelled', 'on-hold' ) as $state ) {
|
47 |
+
add_action( 'woocommerce_order_status_' . $state . '_to_processing_notification', array(
|
48 |
+
$this,
|
49 |
+
'email_heading_processing'
|
50 |
+
), 9 );
|
51 |
|
52 |
+
add_action( 'woocommerce_order_status_' . $state . '_to_processing_notification', array(
|
53 |
+
$this,
|
54 |
+
'refresh_email_lang'
|
55 |
+
), 9 );
|
56 |
+
}
|
57 |
|
58 |
foreach( array( 'pending', 'failed', 'cancelled' ) as $state ) {
|
59 |
add_action( 'woocommerce_order_status_' . $state . '_to_on-hold_notification', array(
|
71 |
|
72 |
//change order status
|
73 |
add_action( 'woocommerce_order_status_completed', array( $this, 'refresh_email_lang_complete' ), 9 );
|
74 |
+
|
|
|
|
|
|
|
75 |
add_action( 'woocommerce_order_status_pending_to_on-hold_notification', array(
|
76 |
$this,
|
77 |
'refresh_email_lang'
|
132 |
|
133 |
add_filter( 'woocommerce_email_heading_customer_on_hold_order', array( $this, 'customer_on_hold_order_heading' ) );
|
134 |
add_filter( 'woocommerce_email_subject_customer_on_hold_order', array( $this, 'customer_on_hold_order_subject' ) );
|
135 |
+
|
136 |
+
add_filter( 'woocommerce_email_heading_customer_processing_order', array( $this, 'customer_processing_order_heading' ) );
|
137 |
+
add_filter( 'woocommerce_email_subject_customer_processing_order', array( $this, 'customer_processing_order_subject' ) );
|
138 |
}
|
139 |
|
140 |
function email_refresh_in_ajax() {
|
231 |
$this->translate_email_headings( $order_id, 'WC_Email_Customer_Processing_Order', 'woocommerce_customer_processing_order_settings' );
|
232 |
}
|
233 |
|
234 |
+
public function customer_processing_order_heading( $heading ){
|
235 |
+
return $this->get_translated_order_strings( 'heading', $heading, 'WC_Email_Customer_Processing_Order' );
|
236 |
+
}
|
237 |
+
|
238 |
+
public function customer_processing_order_subject( $subject ){
|
239 |
+
return $this->get_translated_order_strings( 'subject', $subject, 'WC_Email_Customer_Processing_Order' );
|
240 |
+
}
|
241 |
+
|
242 |
+
|
243 |
public function email_heading_on_hold( $order_id ){
|
244 |
$this->translate_email_headings( $order_id, 'WC_Email_Customer_On_Hold_Order', 'woocommerce_customer_on_hold_order_settings' );
|
245 |
}
|
inc/class-wcml-endpoints.php
CHANGED
@@ -132,12 +132,13 @@ class WCML_Endpoints {
|
|
132 |
$my_account_page_id = wc_get_page_id( 'myaccount' );
|
133 |
|
134 |
if ( $my_account_page_id ) {
|
135 |
-
|
136 |
-
|
137 |
-
|
|
|
138 |
|
139 |
$reserved_requests[] = $account_base;
|
140 |
-
$reserved_requests[] = '/^' . $account_base . '/'; // regex version
|
141 |
$is_page_display_as_translated = $this->sitepress->is_display_as_translated_post_type( 'page' );
|
142 |
|
143 |
if( ! $is_page_display_as_translated ){
|
132 |
$my_account_page_id = wc_get_page_id( 'myaccount' );
|
133 |
|
134 |
if ( $my_account_page_id ) {
|
135 |
+
|
136 |
+
$account_base = get_page_uri( $my_account_page_id );
|
137 |
+
|
138 |
+
if ( $account_base ) {
|
139 |
|
140 |
$reserved_requests[] = $account_base;
|
141 |
+
$reserved_requests[] = '/^' . str_replace( '/', "\/", $account_base ) . '/'; // regex version
|
142 |
$is_page_display_as_translated = $this->sitepress->is_display_as_translated_post_type( 'page' );
|
143 |
|
144 |
if( ! $is_page_display_as_translated ){
|
inc/class-wcml-media.php
CHANGED
@@ -104,25 +104,27 @@ class WCML_Media{
|
|
104 |
|
105 |
public function sync_product_gallery( $product_id ) {
|
106 |
|
107 |
-
$
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
$
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
|
|
|
|
|
|
120 |
}
|
121 |
-
$duplicated_ids .= $duplicated_id . ',';
|
122 |
}
|
|
|
|
|
123 |
}
|
124 |
-
$duplicated_ids = substr( $duplicated_ids, 0, strlen( $duplicated_ids ) - 1 );
|
125 |
-
update_post_meta( $translation->element_id, '_product_image_gallery', $duplicated_ids );
|
126 |
}
|
127 |
}
|
128 |
}
|
@@ -147,4 +149,22 @@ class WCML_Media{
|
|
147 |
unset( $this->products_being_synced[ $product_id ] );
|
148 |
}
|
149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
}
|
104 |
|
105 |
public function sync_product_gallery( $product_id ) {
|
106 |
|
107 |
+
if( $this->is_media_duplication_enabled( $product_id ) ){
|
108 |
+
$product_gallery = get_post_meta( $product_id, '_product_image_gallery', true );
|
109 |
+
$gallery_ids = explode( ',', $product_gallery );
|
110 |
+
|
111 |
+
$trid = $this->sitepress->get_element_trid( $product_id, 'post_product' );
|
112 |
+
$translations = $this->sitepress->get_element_translations( $trid, 'post_product', true );
|
113 |
+
foreach ( $translations as $translation ) {
|
114 |
+
$duplicated_ids = '';
|
115 |
+
if ( ! $translation->original ) {
|
116 |
+
foreach ( $gallery_ids as $image_id ) {
|
117 |
+
if ( get_post( $image_id ) ) {
|
118 |
+
$duplicated_id = apply_filters( 'translate_object_id', $image_id, 'attachment', false, $translation->language_code );
|
119 |
+
if ( is_null( $duplicated_id ) && $image_id ) {
|
120 |
+
$duplicated_id = $this->create_base_media_translation( $image_id, $translation->element_id, $translation->language_code );
|
121 |
+
}
|
122 |
+
$duplicated_ids .= $duplicated_id . ',';
|
123 |
}
|
|
|
124 |
}
|
125 |
+
$duplicated_ids = substr( $duplicated_ids, 0, strlen( $duplicated_ids ) - 1 );
|
126 |
+
update_post_meta( $translation->element_id, '_product_image_gallery', $duplicated_ids );
|
127 |
}
|
|
|
|
|
128 |
}
|
129 |
}
|
130 |
}
|
149 |
unset( $this->products_being_synced[ $product_id ] );
|
150 |
}
|
151 |
|
152 |
+
public function is_media_duplication_enabled( $product_id ){
|
153 |
+
|
154 |
+
$setting_value = get_post_meta( $product_id, $this->sitepress->get_wp_api()->constant( 'WPML_Admin_Post_Actions::DUPLICATE_MEDIA_META_KEY' ), true );
|
155 |
+
|
156 |
+
if( '' === $setting_value ){
|
157 |
+
// fallback to global setting
|
158 |
+
$media_options = get_option( '_wpml_media', array() );
|
159 |
+
|
160 |
+
$global_setting_key = $this->sitepress->get_wp_api()->constant( 'WPML_Admin_Post_Actions::DUPLICATE_MEDIA_GLOBAL_KEY' );
|
161 |
+
if ( isset( $media_options['new_content_settings'][ $global_setting_key ] ) ) {
|
162 |
+
$setting_value = $media_options['new_content_settings'][ $global_setting_key ];
|
163 |
+
}
|
164 |
+
}
|
165 |
+
|
166 |
+
return (bool) $setting_value;
|
167 |
+
|
168 |
+
}
|
169 |
+
|
170 |
}
|
inc/class-wcml-orders.php
CHANGED
@@ -114,6 +114,10 @@ class WCML_Orders {
|
|
114 |
|
115 |
function woocommerce_order_get_items( $items, $order ){
|
116 |
|
|
|
|
|
|
|
|
|
117 |
if( isset( $_GET[ 'post' ] ) && get_post_type( $_GET[ 'post' ] ) == 'shop_order' ) {
|
118 |
// on order edit page use admin default language
|
119 |
$language_to_filter = $this->sitepress->get_user_admin_language( get_current_user_id(), true );
|
@@ -208,6 +212,10 @@ class WCML_Orders {
|
|
208 |
|
209 |
}
|
210 |
|
|
|
|
|
|
|
|
|
211 |
public function backend_before_order_itemmeta( $item_id, $item, $product ){
|
212 |
global $sitepress;
|
213 |
|
114 |
|
115 |
function woocommerce_order_get_items( $items, $order ){
|
116 |
|
117 |
+
if ( $this->is_order_saving_action() ) {
|
118 |
+
return $items;
|
119 |
+
}
|
120 |
+
|
121 |
if( isset( $_GET[ 'post' ] ) && get_post_type( $_GET[ 'post' ] ) == 'shop_order' ) {
|
122 |
// on order edit page use admin default language
|
123 |
$language_to_filter = $this->sitepress->get_user_admin_language( get_current_user_id(), true );
|
212 |
|
213 |
}
|
214 |
|
215 |
+
private function is_order_saving_action(){
|
216 |
+
return isset( $_POST['post_type'] ) && $_POST['post_type'] === 'shop_order' && isset( $_POST['wc_order_action'] );
|
217 |
+
}
|
218 |
+
|
219 |
public function backend_before_order_itemmeta( $item_id, $item, $product ){
|
220 |
global $sitepress;
|
221 |
|
inc/class-wcml-products.php
CHANGED
@@ -45,7 +45,7 @@ class WCML_Products{
|
|
45 |
add_filter( 'post_row_actions', array( $this, 'filter_product_actions' ), 10, 2 );
|
46 |
|
47 |
add_action( 'wp_ajax_wpml_switch_post_language', array( $this, 'switch_product_variations_language' ), 9 );
|
48 |
-
|
49 |
} else {
|
50 |
add_filter( 'woocommerce_json_search_found_products', array( $this, 'filter_found_products_by_language' ) );
|
51 |
add_filter( 'woocommerce_related_products_args', array( $this, 'filter_related_products_args' ) );
|
@@ -131,23 +131,16 @@ class WCML_Products{
|
|
131 |
|
132 |
public function is_downloadable_product( $product ) {
|
133 |
|
134 |
-
|
|
|
135 |
|
136 |
$found = false;
|
137 |
$is_downloadable = $this->wpml_cache->get( $cache_key, $found );
|
138 |
if ( ! $found ) {
|
139 |
if ( $product->is_downloadable() ) {
|
140 |
$is_downloadable = true;
|
141 |
-
} elseif ( $this->is_variable_product( $
|
142 |
-
|
143 |
-
if ( ! empty( $variations ) ) {
|
144 |
-
foreach ( $variations as $variation ) {
|
145 |
-
if ( $variation['is_downloadable'] ) {
|
146 |
-
$is_downloadable = true;
|
147 |
-
break;
|
148 |
-
}
|
149 |
-
}
|
150 |
-
}
|
151 |
}
|
152 |
$this->wpml_cache->set( $cache_key, $is_downloadable );
|
153 |
}
|
@@ -156,6 +149,17 @@ class WCML_Products{
|
|
156 |
|
157 |
}
|
158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
public function is_grouped_product($product_id){
|
160 |
$get_variation_term_taxonomy_id = $this->wpdb->get_var( "SELECT tt.term_taxonomy_id FROM {$this->wpdb->terms} AS t LEFT JOIN {$this->wpdb->term_taxonomy} AS tt ON t.term_id = tt.term_id WHERE t.name = 'grouped'" );
|
161 |
$is_grouped_product = $this->wpdb->get_var( $this->wpdb->prepare( "SELECT count(object_id) FROM {$this->wpdb->term_relationships} WHERE object_id = %d AND term_taxonomy_id = %d ",$product_id,$get_variation_term_taxonomy_id ) );
|
@@ -660,17 +664,34 @@ class WCML_Products{
|
|
660 |
|
661 |
public function is_customer_bought_product( $value, $customer_email, $user_id, $product_id ){
|
662 |
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
$value = wc_customer_bought_product( $customer_email, $user_id, $this->get_original_product_id( $product_id ) );
|
667 |
-
|
668 |
-
add_filter( 'woocommerce_pre_customer_bought_product', array( $this, 'is_customer_bought_product' ), 10, 4 );
|
669 |
}
|
670 |
|
671 |
return $value;
|
672 |
}
|
673 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
674 |
public function filter_product_data( $data, $product_id, $meta_key ) {
|
675 |
|
676 |
if ( ! $meta_key ) {
|
@@ -726,4 +747,24 @@ class WCML_Products{
|
|
726 |
return $this->wpdb->get_var( $this->wpdb->prepare( "SELECT meta_value FROM {$this->wpdb->postmeta} WHERE `meta_key` = '_price' AND post_id = %d ", $product_id ) );
|
727 |
}
|
728 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
729 |
}
|
45 |
add_filter( 'post_row_actions', array( $this, 'filter_product_actions' ), 10, 2 );
|
46 |
|
47 |
add_action( 'wp_ajax_wpml_switch_post_language', array( $this, 'switch_product_variations_language' ), 9 );
|
48 |
+
add_filter( 'woocommerce_product_type_query', array( $this, 'override_product_type_query' ), 10, 2 );
|
49 |
} else {
|
50 |
add_filter( 'woocommerce_json_search_found_products', array( $this, 'filter_found_products_by_language' ) );
|
51 |
add_filter( 'woocommerce_related_products_args', array( $this, 'filter_related_products_args' ) );
|
131 |
|
132 |
public function is_downloadable_product( $product ) {
|
133 |
|
134 |
+
$product_id = $product->get_id();
|
135 |
+
$cache_key = 'is_downloadable_product_' . $product_id;
|
136 |
|
137 |
$found = false;
|
138 |
$is_downloadable = $this->wpml_cache->get( $cache_key, $found );
|
139 |
if ( ! $found ) {
|
140 |
if ( $product->is_downloadable() ) {
|
141 |
$is_downloadable = true;
|
142 |
+
} elseif ( $this->is_variable_product( $product_id ) ) {
|
143 |
+
$is_downloadable = $this->is_downloadable_variations( $this->woocommerce_wpml->sync_variations_data->get_product_variations( $product_id ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
}
|
145 |
$this->wpml_cache->set( $cache_key, $is_downloadable );
|
146 |
}
|
149 |
|
150 |
}
|
151 |
|
152 |
+
private function is_downloadable_variations( $variations ) {
|
153 |
+
if ( $variations && is_array( $variations ) ) {
|
154 |
+
$variation_ids = wp_list_pluck( $variations, 'ID' );
|
155 |
+
$sql = 'SELECT count(*) FROM ' . $this->wpdb->prefix . 'postmeta WHERE post_id IN (' . wpml_prepare_in( $variation_ids, '%d' ) . ') AND meta_key = %s AND meta_value = %s ';
|
156 |
+
|
157 |
+
return (bool) $this->wpdb->get_var( $this->wpdb->prepare( $sql, '_downloadable', 'yes' ) );
|
158 |
+
}
|
159 |
+
|
160 |
+
return false;
|
161 |
+
}
|
162 |
+
|
163 |
public function is_grouped_product($product_id){
|
164 |
$get_variation_term_taxonomy_id = $this->wpdb->get_var( "SELECT tt.term_taxonomy_id FROM {$this->wpdb->terms} AS t LEFT JOIN {$this->wpdb->term_taxonomy} AS tt ON t.term_id = tt.term_id WHERE t.name = 'grouped'" );
|
165 |
$is_grouped_product = $this->wpdb->get_var( $this->wpdb->prepare( "SELECT count(object_id) FROM {$this->wpdb->term_relationships} WHERE object_id = %d AND term_taxonomy_id = %d ",$product_id,$get_variation_term_taxonomy_id ) );
|
664 |
|
665 |
public function is_customer_bought_product( $value, $customer_email, $user_id, $product_id ){
|
666 |
|
667 |
+
if( $this->is_customer_bought_original( $customer_email, $user_id, $product_id ) ){
|
668 |
+
return true;
|
|
|
|
|
|
|
|
|
669 |
}
|
670 |
|
671 |
return $value;
|
672 |
}
|
673 |
|
674 |
+
private function is_customer_bought_original( $customer_email, $user_id, $product_id ) {
|
675 |
+
|
676 |
+
if ( ! $this->is_original_product( $product_id ) ) {
|
677 |
+
remove_filter( 'woocommerce_pre_customer_bought_product', array(
|
678 |
+
$this,
|
679 |
+
'is_customer_bought_product'
|
680 |
+
), 10, 4 );
|
681 |
+
|
682 |
+
$bought_original = wc_customer_bought_product( $customer_email, $user_id, $this->get_original_product_id( $product_id ) );
|
683 |
+
|
684 |
+
add_filter( 'woocommerce_pre_customer_bought_product', array(
|
685 |
+
$this,
|
686 |
+
'is_customer_bought_product'
|
687 |
+
), 10, 4 );
|
688 |
+
|
689 |
+
return (bool) $bought_original;
|
690 |
+
}
|
691 |
+
|
692 |
+
return false;
|
693 |
+
}
|
694 |
+
|
695 |
public function filter_product_data( $data, $product_id, $meta_key ) {
|
696 |
|
697 |
if ( ! $meta_key ) {
|
747 |
return $this->wpdb->get_var( $this->wpdb->prepare( "SELECT meta_value FROM {$this->wpdb->postmeta} WHERE `meta_key` = '_price' AND post_id = %d ", $product_id ) );
|
748 |
}
|
749 |
|
750 |
+
/**
|
751 |
+
* return not cached value for product
|
752 |
+
*
|
753 |
+
* @param bool $product_type
|
754 |
+
* @param int $product_id
|
755 |
+
*
|
756 |
+
* @return bool|string
|
757 |
+
*/
|
758 |
+
public function override_product_type_query( $product_type, $product_id ) {
|
759 |
+
|
760 |
+
if ( 'product' === get_post_type( $product_id ) ) {
|
761 |
+
$product_type = 'simple';
|
762 |
+
$terms = get_the_terms( $product_id, 'product_type' );
|
763 |
+
if ( $terms ) {
|
764 |
+
$product_type = sanitize_title( current( $terms )->name );
|
765 |
+
}
|
766 |
+
}
|
767 |
+
|
768 |
+
return $product_type;
|
769 |
+
}
|
770 |
}
|
inc/class-wcml-tp-support.php
CHANGED
@@ -151,7 +151,7 @@ class WCML_TP_Support {
|
|
151 |
|
152 |
public function append_variation_descriptions_translation_package( $package, $post ) {
|
153 |
|
154 |
-
if ( $post->post_type
|
155 |
|
156 |
/** @var WC_Product_Variable $product */
|
157 |
$product = wc_get_product( $post->ID );
|
@@ -160,18 +160,18 @@ class WCML_TP_Support {
|
|
160 |
|
161 |
if ( ! empty( $product ) && in_array( $product->get_type(), $allowed_variations_types, true ) ) {
|
162 |
|
163 |
-
$variations = $
|
164 |
|
165 |
foreach ( $variations as $variation ) {
|
166 |
|
167 |
-
|
168 |
|
169 |
-
|
|
|
170 |
'translate' => 1,
|
171 |
-
'data' => $this->tp->encode_field_data(
|
172 |
'format' => 'base64'
|
173 |
);
|
174 |
-
|
175 |
}
|
176 |
|
177 |
}
|
151 |
|
152 |
public function append_variation_descriptions_translation_package( $package, $post ) {
|
153 |
|
154 |
+
if ( 'product' === $post->post_type ) {
|
155 |
|
156 |
/** @var WC_Product_Variable $product */
|
157 |
$product = wc_get_product( $post->ID );
|
160 |
|
161 |
if ( ! empty( $product ) && in_array( $product->get_type(), $allowed_variations_types, true ) ) {
|
162 |
|
163 |
+
$variations = $this->woocommerce_wpml->sync_variations_data->get_product_variations( $post->ID );
|
164 |
|
165 |
foreach ( $variations as $variation ) {
|
166 |
|
167 |
+
$description = get_post_meta( $variation->ID, '_variation_description', true );
|
168 |
|
169 |
+
if ( $description ) {
|
170 |
+
$package['contents'][ 'wc_variation_description:' . $variation->ID ] = array(
|
171 |
'translate' => 1,
|
172 |
+
'data' => $this->tp->encode_field_data( $description, 'base64' ),
|
173 |
'format' => 'base64'
|
174 |
);
|
|
|
175 |
}
|
176 |
|
177 |
}
|
inc/currencies/class-wcml-multi-currency-orders.php
CHANGED
@@ -337,27 +337,31 @@ class WCML_Multi_Currency_Orders {
|
|
337 |
$original_product_id = $this->woocommerce_wpml->products->get_original_product_id( $product_id );
|
338 |
|
339 |
$converted_price = get_post_meta( $original_product_id, '_price_' . $order_currency, true );
|
340 |
-
$converted_totals = array( '
|
341 |
|
342 |
foreach ( array_keys( $converted_totals ) as $key ) {
|
343 |
|
344 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
345 |
|
346 |
-
$meta_key = '_wcml_converted_' . $key;
|
347 |
-
if (
|
348 |
-
! $item->meta_exists( $meta_key ) ||
|
349 |
-
( $item->meta_exists( '_wcml_total_qty' ) && $item->get_quantity() !== (int) $item->get_meta( '_wcml_total_qty' ) )
|
350 |
-
) {
|
351 |
-
$item_price = $this->multi_currency->prices->raw_price_filter( $item->get_product()->get_price(), $order_currency );
|
352 |
-
$converted_totals[ $key ] = $this->get_converted_item_meta( $key, $item_price, false, $item, $order_currency, $coupons );
|
353 |
-
$item->update_meta_data( $meta_key, $converted_totals[ $key ] );
|
354 |
} else {
|
355 |
-
$converted_totals[ $key ] = $
|
356 |
}
|
357 |
-
|
358 |
-
} else {
|
359 |
-
$converted_totals[ $key ] = $this->get_converted_item_meta( $key, $converted_price, true, $item, $order_currency, $coupons );
|
360 |
-
}
|
361 |
|
362 |
call_user_func_array( array( $item, 'set_' . $key ), array( $converted_totals[ $key ] ) );
|
363 |
}
|
337 |
$original_product_id = $this->woocommerce_wpml->products->get_original_product_id( $product_id );
|
338 |
|
339 |
$converted_price = get_post_meta( $original_product_id, '_price_' . $order_currency, true );
|
340 |
+
$converted_totals = array( 'total' => 0, 'subtotal' => 0 );
|
341 |
|
342 |
foreach ( array_keys( $converted_totals ) as $key ) {
|
343 |
|
344 |
+
if ( 'total' === $key && $item->get_total() !== $item->get_subtotal() ) {
|
345 |
+
$converted_totals[ $key ] = $item->get_total();
|
346 |
+
}else{
|
347 |
+
if ( ! $converted_price ) {
|
348 |
+
|
349 |
+
$meta_key = '_wcml_converted_' . $key;
|
350 |
+
if (
|
351 |
+
! $item->meta_exists( $meta_key ) ||
|
352 |
+
( $item->meta_exists( '_wcml_total_qty' ) && $item->get_quantity() !== (int) $item->get_meta( '_wcml_total_qty' ) )
|
353 |
+
) {
|
354 |
+
$item_price = $this->multi_currency->prices->raw_price_filter( $item->get_product()->get_price(), $order_currency );
|
355 |
+
$converted_totals[ $key ] = $this->get_converted_item_meta( $key, $item_price, false, $item, $order_currency, $coupons );
|
356 |
+
$item->update_meta_data( $meta_key, $converted_totals[ $key ] );
|
357 |
+
} else {
|
358 |
+
$converted_totals[ $key ] = $item->get_meta( $meta_key );
|
359 |
+
}
|
360 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
361 |
} else {
|
362 |
+
$converted_totals[ $key ] = $this->get_converted_item_meta( $key, $converted_price, true, $item, $order_currency, $coupons );
|
363 |
}
|
364 |
+
}
|
|
|
|
|
|
|
365 |
|
366 |
call_user_func_array( array( $item, 'set_' . $key ), array( $converted_totals[ $key ] ) );
|
367 |
}
|
inc/translation-editor/class-wcml-editor-ui-product-job.php
CHANGED
@@ -206,14 +206,14 @@ class WCML_Editor_UI_Product_Job extends WPML_Editor_UI_Job {
|
|
206 |
}
|
207 |
|
208 |
if( $this->woocommerce_wpml->products->is_variable_product( $this->product_id ) ){
|
209 |
-
|
210 |
|
211 |
if( !empty( $variations ) ){
|
212 |
$variations_data_section = new WPML_Editor_UI_Field_Section( __( 'Variations data', 'woocommerce-multilingual' ) );
|
213 |
foreach( $variations as $variation ){
|
214 |
-
$var_custom_fields = $this->get_product_custom_fields_to_translate( $variation
|
215 |
if( $var_custom_fields ){
|
216 |
-
$this->add_custom_fields_ui_section( $variations_data_section, $var_custom_fields, $variation
|
217 |
}
|
218 |
}
|
219 |
$this->add_field( $variations_data_section );
|
@@ -446,15 +446,15 @@ class WCML_Editor_UI_Product_Job extends WPML_Editor_UI_Job {
|
|
446 |
$element_data = $this->add_custom_field_to_element_data( $element_data, $this->product_id, isset( $translation->ID ) ? $translation->ID : false, false );
|
447 |
|
448 |
if( $is_variable_product ){
|
449 |
-
|
450 |
|
451 |
if( !empty( $variations ) ){
|
452 |
foreach( $variations as $variation ){
|
453 |
-
$element_data[ '_variation_description'.$variation
|
454 |
-
$translated_variation_id = apply_filters( 'translate_object_id', $variation
|
455 |
-
$element_data[ '_variation_description'.$variation
|
456 |
|
457 |
-
$element_data = $this->add_custom_field_to_element_data( $element_data, $variation
|
458 |
}
|
459 |
}
|
460 |
}
|
206 |
}
|
207 |
|
208 |
if( $this->woocommerce_wpml->products->is_variable_product( $this->product_id ) ){
|
209 |
+
$variations = $this->woocommerce_wpml->sync_variations_data->get_product_variations( $this->product_id );
|
210 |
|
211 |
if( !empty( $variations ) ){
|
212 |
$variations_data_section = new WPML_Editor_UI_Field_Section( __( 'Variations data', 'woocommerce-multilingual' ) );
|
213 |
foreach( $variations as $variation ){
|
214 |
+
$var_custom_fields = $this->get_product_custom_fields_to_translate( $variation->ID );
|
215 |
if( $var_custom_fields ){
|
216 |
+
$this->add_custom_fields_ui_section( $variations_data_section, $var_custom_fields, $variation->ID );
|
217 |
}
|
218 |
}
|
219 |
$this->add_field( $variations_data_section );
|
446 |
$element_data = $this->add_custom_field_to_element_data( $element_data, $this->product_id, isset( $translation->ID ) ? $translation->ID : false, false );
|
447 |
|
448 |
if( $is_variable_product ){
|
449 |
+
$variations = $this->woocommerce_wpml->sync_variations_data->get_product_variations( $this->product_id );
|
450 |
|
451 |
if( !empty( $variations ) ){
|
452 |
foreach( $variations as $variation ){
|
453 |
+
$element_data[ '_variation_description'.$variation->ID ] = array( 'original' => strip_tags( get_post_meta( $variation->ID, '_variation_description', true ) ) );
|
454 |
+
$translated_variation_id = apply_filters( 'translate_object_id', $variation->ID, 'product_variation', false, $this->get_target_language() );
|
455 |
+
$element_data[ '_variation_description'.$variation->ID ][ 'translation' ] = $translated_variation_id ? get_post_meta( $translated_variation_id, '_variation_description', true ) : '';
|
456 |
|
457 |
+
$element_data = $this->add_custom_field_to_element_data( $element_data, $variation->ID, $translated_variation_id, true );
|
458 |
}
|
459 |
}
|
460 |
}
|
inc/translation-editor/class-wcml-synchronize-product-data.php
CHANGED
@@ -311,8 +311,8 @@ class WCML_Synchronize_Product_Data{
|
|
311 |
}
|
312 |
|
313 |
/**
|
314 |
-
* @param $product
|
315 |
-
* @param $translated_product
|
316 |
*/
|
317 |
public function sync_product_stock( $product, $translated_product = false ) {
|
318 |
$stock = $product->get_stock_quantity();
|
@@ -322,13 +322,15 @@ class WCML_Synchronize_Product_Data{
|
|
322 |
remove_action( 'woocommerce_variation_set_stock', array( $this, 'sync_product_stock_hook' ) );
|
323 |
|
324 |
if( $translated_product ){
|
325 |
-
|
|
|
326 |
}else{
|
327 |
$translations = $this->post_translations->get_element_translations( $product_id );
|
328 |
foreach( $translations as $translation ){
|
329 |
if( $product_id !== $translation ){
|
330 |
$_product = wc_get_product( $translation );
|
331 |
-
|
|
|
332 |
}
|
333 |
}
|
334 |
}
|
@@ -337,6 +339,21 @@ class WCML_Synchronize_Product_Data{
|
|
337 |
add_action( 'woocommerce_variation_set_stock', array( $this, 'sync_product_stock_hook' ) );
|
338 |
}
|
339 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
340 |
/**
|
341 |
* @param $product
|
342 |
*/
|
@@ -399,7 +416,7 @@ class WCML_Synchronize_Product_Data{
|
|
399 |
$translations = $this->post_translations->get_element_translations( $product_id, false, true );
|
400 |
|
401 |
foreach ( $translations as $translation ) {
|
402 |
-
|
403 |
$this->wc_taxonomies_recount_after_stock_change( $translation );
|
404 |
}
|
405 |
}
|
@@ -532,10 +549,11 @@ class WCML_Synchronize_Product_Data{
|
|
532 |
|
533 |
if( is_null( $post_fields ) ){
|
534 |
$post_fields = array();
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
|
|
539 |
}
|
540 |
|
541 |
$custom_filed_key = $is_variation && $original_product_id ? $custom_field.$original_product_id : $custom_field;
|
311 |
}
|
312 |
|
313 |
/**
|
314 |
+
* @param WC_Product $product
|
315 |
+
* @param WC_Product $translated_product
|
316 |
*/
|
317 |
public function sync_product_stock( $product, $translated_product = false ) {
|
318 |
$stock = $product->get_stock_quantity();
|
322 |
remove_action( 'woocommerce_variation_set_stock', array( $this, 'sync_product_stock_hook' ) );
|
323 |
|
324 |
if( $translated_product ){
|
325 |
+
$this->update_stock_value( $translated_product, $stock );
|
326 |
+
wc_update_product_stock_status( $translated_product->get_id(), $product->get_stock_status() );
|
327 |
}else{
|
328 |
$translations = $this->post_translations->get_element_translations( $product_id );
|
329 |
foreach( $translations as $translation ){
|
330 |
if( $product_id !== $translation ){
|
331 |
$_product = wc_get_product( $translation );
|
332 |
+
$this->update_stock_value( $_product, $stock );
|
333 |
+
wc_update_product_stock_status( $translation, $product->get_stock_status() );
|
334 |
}
|
335 |
}
|
336 |
}
|
339 |
add_action( 'woocommerce_variation_set_stock', array( $this, 'sync_product_stock_hook' ) );
|
340 |
}
|
341 |
|
342 |
+
/**
|
343 |
+
* @param WC_Product $product
|
344 |
+
* @param int $stock_quantity
|
345 |
+
*/
|
346 |
+
private function update_stock_value( $product, $stock_quantity ){
|
347 |
+
|
348 |
+
$product_id_with_stock = $product->get_stock_managed_by_id();
|
349 |
+
$data_store = WC_Data_Store::load( 'product' );
|
350 |
+
$data_store->update_product_stock( $product_id_with_stock, $stock_quantity, 'set' );
|
351 |
+
delete_transient( 'wc_low_stock_count' );
|
352 |
+
delete_transient( 'wc_outofstock_count' );
|
353 |
+
delete_transient( 'wc_product_children_' . ( $product->is_type( 'variation' ) ? $product->get_parent_id() : $product->get_id() ) );
|
354 |
+
wp_cache_delete( 'product-' . $product_id_with_stock, 'products' );
|
355 |
+
}
|
356 |
+
|
357 |
/**
|
358 |
* @param $product
|
359 |
*/
|
416 |
$translations = $this->post_translations->get_element_translations( $product_id, false, true );
|
417 |
|
418 |
foreach ( $translations as $translation ) {
|
419 |
+
wc_update_product_stock_status( $translation, $status );
|
420 |
$this->wc_taxonomies_recount_after_stock_change( $translation );
|
421 |
}
|
422 |
}
|
549 |
|
550 |
if( is_null( $post_fields ) ){
|
551 |
$post_fields = array();
|
552 |
+
if ( isset( $_POST['data'] ) ) {
|
553 |
+
$job_data = array();
|
554 |
+
parse_str( $_POST['data'], $job_data );
|
555 |
+
$post_fields = $job_data['fields'];
|
556 |
+
}
|
557 |
}
|
558 |
|
559 |
$custom_filed_key = $is_variation && $original_product_id ? $custom_field.$original_product_id : $custom_field;
|
inc/translation-editor/class-wcml-synchronize-variations-data.php
CHANGED
@@ -110,14 +110,17 @@ class WCML_Synchronize_Variations_Data{
|
|
110 |
//unset variation from array to delete variations that no longer exist
|
111 |
unset( $current_variations[ $key ] );
|
112 |
// Update variation
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
|
|
|
|
|
|
121 |
} else {
|
122 |
// Add new variation
|
123 |
$guid = $post_data->guid;
|
110 |
//unset variation from array to delete variations that no longer exist
|
111 |
unset( $current_variations[ $key ] );
|
112 |
// Update variation
|
113 |
+
$this->wpdb->update(
|
114 |
+
$this->wpdb->posts,
|
115 |
+
array(
|
116 |
+
'post_status' => $post_data->post_status,
|
117 |
+
'post_modified' => $post_data->post_modified,
|
118 |
+
'post_modified_gmt' => $post_data->post_modified_gmt,
|
119 |
+
'post_parent' => $tr_product_id, // current post ID
|
120 |
+
'menu_order' => $post_data->menu_order
|
121 |
+
),
|
122 |
+
array( 'ID' => $variation_id )
|
123 |
+
);
|
124 |
} else {
|
125 |
// Add new variation
|
126 |
$guid = $post_data->guid;
|
readme.txt
CHANGED
@@ -4,8 +4,8 @@ Donate link: http://wpml.org/documentation/related-projects/woocommerce-multilin
|
|
4 |
Tags: CMS, woocommerce, commerce, ecommerce, e-commerce, products, WPML, multilingual, e-shop, shop
|
5 |
License: GPLv2
|
6 |
Requires at least: 4.7
|
7 |
-
Tested up to: 5.2
|
8 |
-
Stable tag: 4.6.
|
9 |
|
10 |
Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
|
11 |
|
@@ -140,6 +140,22 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
|
|
140 |
|
141 |
== Changelog ==
|
142 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
= 4.6.2.1 =
|
144 |
* Fix performance issues with WooCommerce 3.6.*
|
145 |
|
4 |
Tags: CMS, woocommerce, commerce, ecommerce, e-commerce, products, WPML, multilingual, e-shop, shop
|
5 |
License: GPLv2
|
6 |
Requires at least: 4.7
|
7 |
+
Tested up to: 5.2.1
|
8 |
+
Stable tag: 4.6.3
|
9 |
|
10 |
Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
|
11 |
|
140 |
|
141 |
== Changelog ==
|
142 |
|
143 |
+
= 4.6.3 =
|
144 |
+
* In some cases product translation can be converted to a simple product instead of correct type after saving
|
145 |
+
* Fix not recalculated ratings after remove rating from admin
|
146 |
+
* Fix no link to reviews in other languages if no reviews left in current one
|
147 |
+
* Fix "set_product_language" REST API call not supported "PUT" method
|
148 |
+
* Fix endpoints on My Account page when using a custom base permalink
|
149 |
+
* Fix stock_status synchronization for variable products with stock management on product level
|
150 |
+
* Fixed performance issues while translating Product via WPML Translation Editor with a lot of variations
|
151 |
+
* Fixed overridden discounted item price when manually creating/editing order from the admin
|
152 |
+
* Fixed customer email language when changing order from "On Hold" to "Processing"
|
153 |
+
* Fixed product gallery being synchronized even if WPML media duplication option is disabled
|
154 |
+
* Fixed custom "Sing-up Fee" price for variation Subscription not saved
|
155 |
+
* Fixed variation not available in second language in some cases when original language is German or Danish
|
156 |
+
* Fix mixed endpoint contexts/domains and their translations/language
|
157 |
+
* Fixed inability to add reviews after bought product
|
158 |
+
|
159 |
= 4.6.2.1 =
|
160 |
* Fix performance issues with WooCommerce 3.6.*
|
161 |
|
res/js/lock_fields.js
CHANGED
@@ -47,10 +47,11 @@ jQuery(document).ready(function($){
|
|
47 |
buttons = buttons.concat( non_standard_fields.classes );
|
48 |
|
49 |
if( unlock_fields.file_paths == 1 ){
|
50 |
-
buttons.push('upload_file_button');
|
51 |
-
buttons.push('insert');
|
52 |
-
buttons.push('delete');
|
53 |
-
|
|
|
54 |
click: function(e) {
|
55 |
return false;
|
56 |
}
|
47 |
buttons = buttons.concat( non_standard_fields.classes );
|
48 |
|
49 |
if( unlock_fields.file_paths == 1 ){
|
50 |
+
buttons.push('downloadable_files .upload_file_button');
|
51 |
+
buttons.push('downloadable_files .insert');
|
52 |
+
buttons.push('downloadable_files .delete');
|
53 |
+
|
54 |
+
$('.downloadable_files .upload_file_button,.downloadable_files .insert,.downloadable_files .delete').bind({
|
55 |
click: function(e) {
|
56 |
return false;
|
57 |
}
|
res/js/lock_fields.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function($){var i;var ids=["_virtual","_downloadable","product-type","_backorders","_manage_stock","_stock","_low_stock_amount","_stock_status","_sold_individually","comment_status","_tax_status","_tax_class","parent_id","crosssell_ids","upsell_ids","grouped_products","product_shipping_class"];if(unlock_fields.file_paths==1){ids.push("_download_type")}ids=ids.concat(non_standard_fields.ids);$(".wcml_prod_hidden_notice").prependTo("#woocommerce-product-data");for(i=0;i<ids.length;i++){$("#"+ids[i]).attr("disabled","disabled");$("#"+ids[i]).after($(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())}var buttons=["add_variation","link_all_variations","attribute_taxonomy","save_attributes","add_new_attribute","product_attributes .remove_row","add_attribute","select_all_attributes","select_no_attributes","edit-visibility"];buttons=buttons.concat(non_standard_fields.classes);if(unlock_fields.file_paths==1){buttons.push("upload_file_button");buttons.push("insert");buttons.push("delete");$(".upload_file_button,.insert,.delete").bind({click:function(e){return false}})}for(i=0;i<buttons.length;i++){$("."+buttons[i]).attr("disabled","disabled");$("."+buttons[i]).after($(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())}$("#visibility .edit-visibility span").bind({click:function(e){return false}});$(".remove_variation").each(function(){$(this).attr("disabled","disabled");$(this).after($(".wcml_lock_img").clone().removeClass("wcml_lock_img").show().css("float","right"))});var inpt_names=["_width","_height","_sku","_length","_weight","product_length","_regular_price","_sale_price","_sale_price_dates_from","_sale_price_dates_to"];if(unlock_fields.file_paths==1){inpt_names.push("_download_limit");inpt_names.push("_download_expiry");inpt_names.push("_wc_file_names[]");inpt_names.push("_wc_file_urls[]")}inpt_names=inpt_names.concat(non_standard_fields.input_names);if(unlock_fields.menu_order==1){inpt_names.push("menu_order")}for(i=0;i<inpt_names.length;i++){$('input[name="'+inpt_names[i]+'"]').attr("readonly","readonly");$(".dimensions_field span.wrap").css("float","left");if(inpt_names[i]=="_width"||inpt_names[i]=="_height"||inpt_names[i]=="_length"){$('input[name="'+inpt_names[i]+'"]').css("margin-right",0);$('input[name="'+inpt_names[i]+'"]').css("float","none");$('input[name="'+inpt_names[i]+'"]').css("width","29%")}if(inpt_names[i]=="_sale_price_dates_to"){$('input[name="'+inpt_names[i]+'"]').after($(".wcml_lock_img").clone().removeClass("wcml_lock_img").css("float","left").show())}else{$('input[name="'+inpt_names[i]+'"]').after($(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())}}$('#product_attributes td textarea,#product_attributes input[type="text"]').each(function(){$(this).attr("readonly","readonly");$(this).after($(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())});$('#product_attributes input[type="checkbox"],#_featured').each(function(){$(this).attr("disabled","disabled");$(this).after($(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())});$('form#post input[type="submit"]').click(function(){for(i=0;i<ids.length;i++){$("#"+ids[i]).removeAttr("disabled")}$('.woocommerce_variation select,#variable_product_options .toolbar select,.woocommerce_variation input[type="checkbox"],#product_attributes input[type="checkbox"]').each(function(){$(this).removeAttr("disabled")})})});var wcml_lock_variation_fields=function(file_path_sync){var check_attr=jQuery(".woocommerce_variation>h3 select").attr("disabled");if(typeof check_attr!==typeof undefined&&check_attr!==false){return}jQuery(".woocommerce_variation>h3 select, #variable_product_options .toolbar select, .show_if_variation_manage_stock select").each(function(){jQuery(this).attr("disabled","disabled");jQuery(this).parent().append('<input type="hidden" name="'+jQuery(this).attr("name")+'" value="'+jQuery(this).val()+'" />');jQuery(this).after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())});var i=0;var inpt_names=["_width","_height","_sku","_length","_weight","product_length","_regular_price","_sale_price","_sale_price_dates_from","_sale_price_dates_to","_stock","_low_stock_amount","_download_limit","_download_expiry"];for(i=0;i<inpt_names.length;i++){jQuery('input[name^="variable'+inpt_names[i]+'"]').each(function(){jQuery(this).attr("readonly","readonly");jQuery(this).after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())})}var var_checkboxes=["_enabled","_is_downloadable","_is_virtual","_manage_stock"];for(i=0;i<var_checkboxes.length;i++){jQuery('input[name^="variable'+var_checkboxes[i]+'"]').each(function(){jQuery(this).attr("disabled","disabled");if(jQuery(this).prop("checked")){jQuery(this).parent().append('<input type="hidden" name="'+jQuery(this).attr("name")+'" value="'+jQuery(this).val()+'" />')}jQuery(this).after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())})}var var_selectboxes=["_stock_status","_shipping_class","_tax_class"];for(i=0;i<var_selectboxes.length;i++){jQuery('select[name^="variable'+var_selectboxes[i]+'"]').each(function(){jQuery(this).attr("disabled","disabled");jQuery(this).parent().append('<input type="hidden" name="'+jQuery(this).attr("name")+'" value="'+jQuery(this).val()+'" />');jQuery(this).after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())})}if(file_path_sync){for(var key in file_path_sync){if(file_path_sync[key]==1){jQuery('input[name^="_wc_variation_file_names['+key+']"]').each(function(){jQuery(this).attr("readonly","readonly")});jQuery('input[name^="_wc_variation_file_urls['+key+']"]').each(function(){jQuery(this).attr("readonly","readonly");jQuery(this).closest("tr").find(".upload_file_button").attr("disabled","disabled");jQuery(this).closest("tr").find(".delete").attr("disabled","disabled");jQuery(this).closest("tr").find(".delete").after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show().css("float","right"))});jQuery('input[name^="_wc_variation_file_urls['+key+']"]').closest("table").find(".insert").attr("disabled","disabled");jQuery('input[name^="_wc_variation_file_urls['+key+']"]').closest("table").find(".insert").after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show().css("float","left"))}}}};
|
1 |
+
jQuery(document).ready(function($){var i;var ids=["_virtual","_downloadable","product-type","_backorders","_manage_stock","_stock","_low_stock_amount","_stock_status","_sold_individually","comment_status","_tax_status","_tax_class","parent_id","crosssell_ids","upsell_ids","grouped_products","product_shipping_class"];if(unlock_fields.file_paths==1){ids.push("_download_type")}ids=ids.concat(non_standard_fields.ids);$(".wcml_prod_hidden_notice").prependTo("#woocommerce-product-data");for(i=0;i<ids.length;i++){$("#"+ids[i]).attr("disabled","disabled");$("#"+ids[i]).after($(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())}var buttons=["add_variation","link_all_variations","attribute_taxonomy","save_attributes","add_new_attribute","product_attributes .remove_row","add_attribute","select_all_attributes","select_no_attributes","edit-visibility"];buttons=buttons.concat(non_standard_fields.classes);if(unlock_fields.file_paths==1){buttons.push("downloadable_files .upload_file_button");buttons.push("downloadable_files .insert");buttons.push("downloadable_files .delete");$(".downloadable_files .upload_file_button,.downloadable_files .insert,.downloadable_files .delete").bind({click:function(e){return false}})}for(i=0;i<buttons.length;i++){$("."+buttons[i]).attr("disabled","disabled");$("."+buttons[i]).after($(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())}$("#visibility .edit-visibility span").bind({click:function(e){return false}});$(".remove_variation").each(function(){$(this).attr("disabled","disabled");$(this).after($(".wcml_lock_img").clone().removeClass("wcml_lock_img").show().css("float","right"))});var inpt_names=["_width","_height","_sku","_length","_weight","product_length","_regular_price","_sale_price","_sale_price_dates_from","_sale_price_dates_to"];if(unlock_fields.file_paths==1){inpt_names.push("_download_limit");inpt_names.push("_download_expiry");inpt_names.push("_wc_file_names[]");inpt_names.push("_wc_file_urls[]")}inpt_names=inpt_names.concat(non_standard_fields.input_names);if(unlock_fields.menu_order==1){inpt_names.push("menu_order")}for(i=0;i<inpt_names.length;i++){$('input[name="'+inpt_names[i]+'"]').attr("readonly","readonly");$(".dimensions_field span.wrap").css("float","left");if(inpt_names[i]=="_width"||inpt_names[i]=="_height"||inpt_names[i]=="_length"){$('input[name="'+inpt_names[i]+'"]').css("margin-right",0);$('input[name="'+inpt_names[i]+'"]').css("float","none");$('input[name="'+inpt_names[i]+'"]').css("width","29%")}if(inpt_names[i]=="_sale_price_dates_to"){$('input[name="'+inpt_names[i]+'"]').after($(".wcml_lock_img").clone().removeClass("wcml_lock_img").css("float","left").show())}else{$('input[name="'+inpt_names[i]+'"]').after($(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())}}$('#product_attributes td textarea,#product_attributes input[type="text"]').each(function(){$(this).attr("readonly","readonly");$(this).after($(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())});$('#product_attributes input[type="checkbox"],#_featured').each(function(){$(this).attr("disabled","disabled");$(this).after($(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())});$('form#post input[type="submit"]').click(function(){for(i=0;i<ids.length;i++){$("#"+ids[i]).removeAttr("disabled")}$('.woocommerce_variation select,#variable_product_options .toolbar select,.woocommerce_variation input[type="checkbox"],#product_attributes input[type="checkbox"]').each(function(){$(this).removeAttr("disabled")})})});var wcml_lock_variation_fields=function(file_path_sync){var check_attr=jQuery(".woocommerce_variation>h3 select").attr("disabled");if(typeof check_attr!==typeof undefined&&check_attr!==false){return}jQuery(".woocommerce_variation>h3 select, #variable_product_options .toolbar select, .show_if_variation_manage_stock select").each(function(){jQuery(this).attr("disabled","disabled");jQuery(this).parent().append('<input type="hidden" name="'+jQuery(this).attr("name")+'" value="'+jQuery(this).val()+'" />');jQuery(this).after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())});var i=0;var inpt_names=["_width","_height","_sku","_length","_weight","product_length","_regular_price","_sale_price","_sale_price_dates_from","_sale_price_dates_to","_stock","_low_stock_amount","_download_limit","_download_expiry"];for(i=0;i<inpt_names.length;i++){jQuery('input[name^="variable'+inpt_names[i]+'"]').each(function(){jQuery(this).attr("readonly","readonly");jQuery(this).after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())})}var var_checkboxes=["_enabled","_is_downloadable","_is_virtual","_manage_stock"];for(i=0;i<var_checkboxes.length;i++){jQuery('input[name^="variable'+var_checkboxes[i]+'"]').each(function(){jQuery(this).attr("disabled","disabled");if(jQuery(this).prop("checked")){jQuery(this).parent().append('<input type="hidden" name="'+jQuery(this).attr("name")+'" value="'+jQuery(this).val()+'" />')}jQuery(this).after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())})}var var_selectboxes=["_stock_status","_shipping_class","_tax_class"];for(i=0;i<var_selectboxes.length;i++){jQuery('select[name^="variable'+var_selectboxes[i]+'"]').each(function(){jQuery(this).attr("disabled","disabled");jQuery(this).parent().append('<input type="hidden" name="'+jQuery(this).attr("name")+'" value="'+jQuery(this).val()+'" />');jQuery(this).after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())})}if(file_path_sync){for(var key in file_path_sync){if(file_path_sync[key]==1){jQuery('input[name^="_wc_variation_file_names['+key+']"]').each(function(){jQuery(this).attr("readonly","readonly")});jQuery('input[name^="_wc_variation_file_urls['+key+']"]').each(function(){jQuery(this).attr("readonly","readonly");jQuery(this).closest("tr").find(".upload_file_button").attr("disabled","disabled");jQuery(this).closest("tr").find(".delete").attr("disabled","disabled");jQuery(this).closest("tr").find(".delete").after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show().css("float","right"))});jQuery('input[name^="_wc_variation_file_urls['+key+']"]').closest("table").find(".insert").attr("disabled","disabled");jQuery('input[name^="_wc_variation_file_urls['+key+']"]').closest("table").find(".insert").after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show().css("float","left"))}}}};
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit6de590272da4e9672c17db908f09e178::getLoader();
|
vendor/autoload_52.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInitbbd0c134ac587a0753eb6f856bac0721::getLoader();
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit0cec763d74f74b23be3d1b2c4d68ab88
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
-
call_user_func(\Composer\Autoload\
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
@@ -48,19 +48,19 @@ class ComposerAutoloaderInit0cec763d74f74b23be3d1b2c4d68ab88
|
|
48 |
$loader->register(true);
|
49 |
|
50 |
if ($useStaticLoader) {
|
51 |
-
$includeFiles = Composer\Autoload\
|
52 |
} else {
|
53 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
54 |
}
|
55 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
56 |
-
|
57 |
}
|
58 |
|
59 |
return $loader;
|
60 |
}
|
61 |
}
|
62 |
|
63 |
-
function
|
64 |
{
|
65 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
66 |
require $file;
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit6de590272da4e9672c17db908f09e178
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInit6de590272da4e9672c17db908f09e178', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit6de590272da4e9672c17db908f09e178', 'loadClassLoader'));
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit6de590272da4e9672c17db908f09e178::getInitializer($loader));
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
48 |
$loader->register(true);
|
49 |
|
50 |
if ($useStaticLoader) {
|
51 |
+
$includeFiles = Composer\Autoload\ComposerStaticInit6de590272da4e9672c17db908f09e178::$files;
|
52 |
} else {
|
53 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
54 |
}
|
55 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
56 |
+
composerRequire6de590272da4e9672c17db908f09e178($fileIdentifier, $file);
|
57 |
}
|
58 |
|
59 |
return $loader;
|
60 |
}
|
61 |
}
|
62 |
|
63 |
+
function composerRequire6de590272da4e9672c17db908f09e178($fileIdentifier, $file)
|
64 |
{
|
65 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
66 |
require $file;
|
vendor/composer/autoload_real_52.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real_52.php generated by xrstf/composer-php52
|
4 |
|
5 |
-
class
|
6 |
private static $loader;
|
7 |
|
8 |
public static function loadClassLoader($class) {
|
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitb2ca1656ba10a612c5e45d5e0a7ce3d6 {
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new xrstf_Composer52_ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$vendorDir = dirname(dirname(__FILE__));
|
27 |
$baseDir = dirname($vendorDir);
|
2 |
|
3 |
// autoload_real_52.php generated by xrstf/composer-php52
|
4 |
|
5 |
+
class ComposerAutoloaderInitbbd0c134ac587a0753eb6f856bac0721 {
|
6 |
private static $loader;
|
7 |
|
8 |
public static function loadClassLoader($class) {
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInitbbd0c134ac587a0753eb6f856bac0721', 'loadClassLoader'), true /*, true */);
|
23 |
self::$loader = $loader = new xrstf_Composer52_ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInitbbd0c134ac587a0753eb6f856bac0721', 'loadClassLoader'));
|
25 |
|
26 |
$vendorDir = dirname(dirname(__FILE__));
|
27 |
$baseDir = dirname($vendorDir);
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'b45b351e6b6f7487d819961fef2fda77' => __DIR__ . '/..' . '/jakeasmith/http_build_url/src/http_build_url.php',
|
@@ -242,10 +242,10 @@ class ComposerStaticInit0cec763d74f74b23be3d1b2c4d68ab88
|
|
242 |
public static function getInitializer(ClassLoader $loader)
|
243 |
{
|
244 |
return \Closure::bind(function () use ($loader) {
|
245 |
-
$loader->prefixLengthsPsr4 =
|
246 |
-
$loader->prefixDirsPsr4 =
|
247 |
-
$loader->prefixesPsr0 =
|
248 |
-
$loader->classMap =
|
249 |
|
250 |
}, null, ClassLoader::class);
|
251 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit6de590272da4e9672c17db908f09e178
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'b45b351e6b6f7487d819961fef2fda77' => __DIR__ . '/..' . '/jakeasmith/http_build_url/src/http_build_url.php',
|
242 |
public static function getInitializer(ClassLoader $loader)
|
243 |
{
|
244 |
return \Closure::bind(function () use ($loader) {
|
245 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit6de590272da4e9672c17db908f09e178::$prefixLengthsPsr4;
|
246 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit6de590272da4e9672c17db908f09e178::$prefixDirsPsr4;
|
247 |
+
$loader->prefixesPsr0 = ComposerStaticInit6de590272da4e9672c17db908f09e178::$prefixesPsr0;
|
248 |
+
$loader->classMap = ComposerStaticInit6de590272da4e9672c17db908f09e178::$classMap;
|
249 |
|
250 |
}, null, ClassLoader::class);
|
251 |
}
|
wpml-woocommerce.php
CHANGED
@@ -7,17 +7,17 @@
|
|
7 |
Author URI: http://www.onthegosystems.com/
|
8 |
Text Domain: woocommerce-multilingual
|
9 |
Requires at least: 4.7
|
10 |
-
Tested up to: 5.2
|
11 |
-
Version: 4.6.
|
12 |
WC requires at least: 3.3.0
|
13 |
-
WC tested up to: 3.6.
|
14 |
*/
|
15 |
|
16 |
if ( defined( 'WCML_VERSION' ) ) {
|
17 |
return;
|
18 |
}
|
19 |
|
20 |
-
define( 'WCML_VERSION', '4.6.
|
21 |
define( 'WCML_PLUGIN_PATH', dirname( __FILE__ ) );
|
22 |
define( 'WCML_PLUGIN_FOLDER', basename( WCML_PLUGIN_PATH ) );
|
23 |
define( 'WCML_LOCALE_PATH', WCML_PLUGIN_PATH . '/locale' );
|
7 |
Author URI: http://www.onthegosystems.com/
|
8 |
Text Domain: woocommerce-multilingual
|
9 |
Requires at least: 4.7
|
10 |
+
Tested up to: 5.2.1
|
11 |
+
Version: 4.6.3
|
12 |
WC requires at least: 3.3.0
|
13 |
+
WC tested up to: 3.6.3
|
14 |
*/
|
15 |
|
16 |
if ( defined( 'WCML_VERSION' ) ) {
|
17 |
return;
|
18 |
}
|
19 |
|
20 |
+
define( 'WCML_VERSION', '4.6.3' );
|
21 |
define( 'WCML_PLUGIN_PATH', dirname( __FILE__ ) );
|
22 |
define( 'WCML_PLUGIN_FOLDER', basename( WCML_PLUGIN_PATH ) );
|
23 |
define( 'WCML_LOCALE_PATH', WCML_PLUGIN_PATH . '/locale' );
|