Version Description
- Fixed small issue in WC Bookings where block cost in other currencies is not saved correctly
- Fix compatibility issue with WC Product Addons and not displayed label in secondary language
- Return back duplication logic for product image and gallery
- Fix warning in secondary language if you don't have any wc pages
- Fix wrong language for attribute in Product creation page
- Fixed bug in Product Search Widget when wpml language set as a parameter
- Fixed fatal error occurring in some cases when updating from older versions
- Fixed cosmetic issue when hovering over currencies
Download this release
Release Info
Developer | sergey.r |
Plugin | WooCommerce Multilingual – run WooCommerce with WPML |
Version | 4.3.3 |
Comparing to | |
See all releases |
Code changes from version 4.3.2.1 to 4.3.3
- changelog/4.3.3.md +9 -0
- classes/class-woocommerce-wpml.php +3 -2
- classes/media/class-wcml-update-product-gallery-translation.php +12 -9
- classes/multi-currency/class-wcml-exchange-rates.php +1 -1
- compatibility/class-wcml-bookings.php +6 -1
- compatibility/class-wcml-product-addons.php +1 -1
- inc/class-wcml-dependencies.php +0 -9
- inc/class-wcml-install.php +22 -22
- inc/class-wcml-media.php +58 -0
- inc/class-wcml-products.php +30 -19
- inc/class-wcml-troubleshooting.php +19 -1
- inc/class-wcml-wc-strings.php +52 -43
- inc/template-classes/class-wcml-troubleshooting-ui.php +2 -0
- inc/translation-editor/class-wcml-editor-ui-product-job.php +10 -15
- inc/translation-editor/class-wcml-synchronize-product-data.php +4 -0
- inc/translation-editor/class-wcml-synchronize-variations-data.php +4 -1
- readme.txt +11 -1
- res/js/multi-currency.js +4 -1
- res/js/multi-currency.min.js +1 -1
- res/js/troubleshooting.js +32 -1
- res/js/troubleshooting.min.js +1 -1
- templates/multi-currency/multi-currency.twig +15 -0
- templates/troubleshooting.twig +9 -0
- vendor/autoload.php +1 -1
- vendor/autoload_52.php +1 -1
- vendor/composer/autoload_real.php +4 -4
- vendor/composer/autoload_real_52.php +3 -3
- vendor/composer/autoload_static.php +5 -5
- wpml-woocommerce.php +18 -8
changelog/4.3.3.md
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Fixes
|
2 |
+
* [wcml-2464] Fixed small issue in WC Bookings where block cost in other currencies is not saved correctly
|
3 |
+
* [wcml-2456] Fix compatibility issue with WC Product Addons and not displayed label in secondary language
|
4 |
+
* [wcml-2455] Return back duplication logic for product image and gallery
|
5 |
+
* [wcml-2453] Fix warning in secondary language if you don't have any wc pages
|
6 |
+
* [wcml-2451] Fix wrong language for attribute in Product creation page
|
7 |
+
* [wcml-2446] Fixed bug in Product Search Widget when wpml language set as a parameter
|
8 |
+
* [wcml-2443] Fixed fatal error occurring in some cases when updating from older versions
|
9 |
+
* [wcml-2422] Fixed cosmetic issue when hovering over currencies
|
classes/class-woocommerce-wpml.php
CHANGED
@@ -137,8 +137,6 @@ class woocommerce_wpml {
|
|
137 |
|
138 |
$this->load_rest_api();
|
139 |
|
140 |
-
new WCML_Upgrade;
|
141 |
-
|
142 |
$this->dependencies = new WCML_Dependencies;
|
143 |
$this->check_dependencies = $this->dependencies->check();
|
144 |
|
@@ -155,6 +153,8 @@ class woocommerce_wpml {
|
|
155 |
return false;
|
156 |
}
|
157 |
|
|
|
|
|
158 |
$this->compatibility = new WCML_Compatibility( $sitepress, $this, $wpdb, new WPML_Element_Translation_Package );
|
159 |
|
160 |
$actions_that_need_mc = array(
|
@@ -227,6 +227,7 @@ class woocommerce_wpml {
|
|
227 |
$this->coupons->add_hooks();
|
228 |
$this->locale = new WCML_Locale( $this, $sitepress );
|
229 |
$this->media = new WCML_Media( $this, $sitepress, $wpdb );
|
|
|
230 |
$this->downloadable = new WCML_Downloadable_Products( $this, $sitepress );
|
231 |
$this->downloadable->add_hooks();
|
232 |
$this->page_builders = new WCML_Page_Builders( $sitepress );
|
137 |
|
138 |
$this->load_rest_api();
|
139 |
|
|
|
|
|
140 |
$this->dependencies = new WCML_Dependencies;
|
141 |
$this->check_dependencies = $this->dependencies->check();
|
142 |
|
153 |
return false;
|
154 |
}
|
155 |
|
156 |
+
new WCML_Upgrade;
|
157 |
+
|
158 |
$this->compatibility = new WCML_Compatibility( $sitepress, $this, $wpdb, new WPML_Element_Translation_Package );
|
159 |
|
160 |
$actions_that_need_mc = array(
|
227 |
$this->coupons->add_hooks();
|
228 |
$this->locale = new WCML_Locale( $this, $sitepress );
|
229 |
$this->media = new WCML_Media( $this, $sitepress, $wpdb );
|
230 |
+
$this->media->add_hooks();
|
231 |
$this->downloadable = new WCML_Downloadable_Products( $this, $sitepress );
|
232 |
$this->downloadable->add_hooks();
|
233 |
$this->page_builders = new WCML_Page_Builders( $sitepress );
|
classes/media/class-wcml-update-product-gallery-translation.php
CHANGED
@@ -47,17 +47,20 @@ class WCML_Update_Product_Gallery_Translation implements IWPML_Action {
|
|
47 |
* @throws \InvalidArgumentException
|
48 |
*/
|
49 |
private function get_translated_gallery( $source_post_id, WPML_Post_Element $updated_attachment_element ) {
|
|
|
|
|
50 |
$original_gallery_meta = get_post_meta( $source_post_id, '_product_image_gallery', true );
|
51 |
-
|
|
|
52 |
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
}
|
62 |
}
|
63 |
|
47 |
* @throws \InvalidArgumentException
|
48 |
*/
|
49 |
private function get_translated_gallery( $source_post_id, WPML_Post_Element $updated_attachment_element ) {
|
50 |
+
$meta_value = array();
|
51 |
+
|
52 |
$original_gallery_meta = get_post_meta( $source_post_id, '_product_image_gallery', true );
|
53 |
+
if ( '' !== $original_gallery_meta ) {
|
54 |
+
$original_gallery = explode( ',', $original_gallery_meta );
|
55 |
|
56 |
+
foreach ( $original_gallery as $original_attachment_id ) {
|
57 |
+
$attachment_element = $this->translation_element_factory->create( $original_attachment_id, 'post' );
|
58 |
+
$translated_attachment = $attachment_element->get_translation( $updated_attachment_element->get_language_code() );
|
59 |
+
if ( null !== $translated_attachment ) {
|
60 |
+
$meta_value[] = $translated_attachment->get_id();
|
61 |
+
} else {
|
62 |
+
$meta_value[] = $original_attachment_id;
|
63 |
+
}
|
64 |
}
|
65 |
}
|
66 |
|
classes/multi-currency/class-wcml-exchange-rates.php
CHANGED
@@ -196,7 +196,7 @@ class WCML_Exchange_Rates {
|
|
196 |
if ( isset( $post_data['exchange-rates-service'] ) ) {
|
197 |
|
198 |
// clear errors for replaced service
|
199 |
-
if ( $post_data['exchange-rates-service'] !== $this->settings['service'] ) {
|
200 |
$this->services[ $this->settings['service'] ]->clear_last_error();
|
201 |
}
|
202 |
|
196 |
if ( isset( $post_data['exchange-rates-service'] ) ) {
|
197 |
|
198 |
// clear errors for replaced service
|
199 |
+
if ( isset( $this->services[ $this->settings['service'] ] ) && $post_data['exchange-rates-service'] !== $this->settings['service'] ) {
|
200 |
$this->services[ $this->settings['service'] ]->clear_last_error();
|
201 |
}
|
202 |
|
compatibility/class-wcml-bookings.php
CHANGED
@@ -319,13 +319,18 @@ class WCML_Bookings {
|
|
319 |
break;
|
320 |
case 'wcml_wc_booking_block_cost':
|
321 |
case 'wcml_wc_booking_base_cost':
|
|
|
|
|
|
|
|
|
|
|
322 |
woocommerce_wp_text_input( array(
|
323 |
'id' => $field,
|
324 |
'class' => 'wcml_bookings_custom_price',
|
325 |
'name' => $field . '[' . $currency_code . ']',
|
326 |
'label' => get_woocommerce_currency_symbol( $currency_code ),
|
327 |
'description' => __( 'This is the cost per block booked. All other costs (for resources and persons) are added to this.', 'woocommerce-bookings' ),
|
328 |
-
'value' => get_post_meta( $post_id, $
|
329 |
'type' => 'number',
|
330 |
'desc_tip' => true,
|
331 |
'custom_attributes' => array(
|
319 |
break;
|
320 |
case 'wcml_wc_booking_block_cost':
|
321 |
case 'wcml_wc_booking_base_cost':
|
322 |
+
$block_cost_key = '_wc_booking_base_cost_';
|
323 |
+
if ($field === 'wcml_wc_booking_block_cost' ){
|
324 |
+
$block_cost_key = '_wc_booking_block_cost_';
|
325 |
+
}
|
326 |
+
$block_cost_key .= $currency_code;
|
327 |
woocommerce_wp_text_input( array(
|
328 |
'id' => $field,
|
329 |
'class' => 'wcml_bookings_custom_price',
|
330 |
'name' => $field . '[' . $currency_code . ']',
|
331 |
'label' => get_woocommerce_currency_symbol( $currency_code ),
|
332 |
'description' => __( 'This is the cost per block booked. All other costs (for resources and persons) are added to this.', 'woocommerce-bookings' ),
|
333 |
+
'value' => get_post_meta( $post_id, $block_cost_key, true ),
|
334 |
'type' => 'number',
|
335 |
'desc_tip' => true,
|
336 |
'custom_attributes' => array(
|
compatibility/class-wcml-product-addons.php
CHANGED
@@ -312,7 +312,7 @@ class WCML_Product_Addons {
|
|
312 |
|
313 |
public function set_global_ids_in_query_args( $args ) {
|
314 |
|
315 |
-
if (
|
316 |
|
317 |
remove_filter( 'get_terms_args', array( $this->sitepress, 'get_terms_args_filter' ), 10, 2 );
|
318 |
remove_filter( 'get_term', array( $this->sitepress, 'get_term_adjust_id' ), 1 );
|
312 |
|
313 |
public function set_global_ids_in_query_args( $args ) {
|
314 |
|
315 |
+
if ( !is_archive() ) {
|
316 |
|
317 |
remove_filter( 'get_terms_args', array( $this->sitepress, 'get_terms_args_filter' ), 10, 2 );
|
318 |
remove_filter( 'get_term', array( $this->sitepress, 'get_term_adjust_id' ), 1 );
|
inc/class-wcml-dependencies.php
CHANGED
@@ -5,7 +5,6 @@ class WCML_Dependencies {
|
|
5 |
const MIN_WPML = '3.4';
|
6 |
const MIN_WPML_TM = '1.9';
|
7 |
const MIN_WPML_ST = '2.0';
|
8 |
-
const MIN_WPML_MEDIA = '2.3';
|
9 |
const MIN_WOOCOMMERCE = '2.1';
|
10 |
|
11 |
private $missing = array();
|
@@ -135,14 +134,6 @@ class WCML_Dependencies {
|
|
135 |
</div>
|
136 |
<?php }
|
137 |
|
138 |
-
public function _old_wpml_media_warning() {
|
139 |
-
?>
|
140 |
-
<div class="message error">
|
141 |
-
<p><?php printf( __( 'WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href="%s">WPML Media</a> versions prior %s.',
|
142 |
-
'woocommerce-multilingual' ), $this->tracking_link->generate( 'https://wpml.org/' ), self::MIN_WPML_MEDIA ); ?></p>
|
143 |
-
</div>
|
144 |
-
<?php }
|
145 |
-
|
146 |
/**
|
147 |
* Adds default taxonomies notice.
|
148 |
*/
|
5 |
const MIN_WPML = '3.4';
|
6 |
const MIN_WPML_TM = '1.9';
|
7 |
const MIN_WPML_ST = '2.0';
|
|
|
8 |
const MIN_WOOCOMMERCE = '2.1';
|
9 |
|
10 |
private $missing = array();
|
134 |
</div>
|
135 |
<?php }
|
136 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
/**
|
138 |
* Adds default taxonomies notice.
|
139 |
*/
|
inc/class-wcml-install.php
CHANGED
@@ -285,33 +285,33 @@ class WCML_Install{
|
|
285 |
}
|
286 |
|
287 |
$sitepress->switch_locale( $language['code'] );
|
288 |
-
$
|
289 |
-
$
|
290 |
-
$
|
291 |
$sitepress->switch_locale();
|
292 |
|
293 |
// check if the term already exists
|
294 |
-
if (
|
295 |
-
$
|
296 |
-
} else {
|
297 |
-
$tmp = wp_insert_term( $tr_cat, 'product_cat' );
|
298 |
}
|
299 |
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
$
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
|
|
|
|
315 |
|
316 |
}
|
317 |
|
285 |
}
|
286 |
|
287 |
$sitepress->switch_locale( $language['code'] );
|
288 |
+
$translated_cat_name = __( 'Uncategorized', 'sitepress' );
|
289 |
+
$translated_cat_name = $translated_cat_name === 'Uncategorized' && $language['code'] !== 'en' ? 'Uncategorized @' . $language['code'] : $translated_cat_name;
|
290 |
+
$translated_term = get_term_by( 'name', $translated_cat_name, 'product_cat', ARRAY_A );
|
291 |
$sitepress->switch_locale();
|
292 |
|
293 |
// check if the term already exists
|
294 |
+
if ( !$translated_term ) {
|
295 |
+
$translated_term = wp_insert_term( $translated_cat_name, 'product_cat' );
|
|
|
|
|
296 |
}
|
297 |
|
298 |
+
if ( $translated_term && ! is_wp_error( $translated_term ) ) {
|
299 |
+
// add it to settings
|
300 |
+
$settings['default_categories'][ $language['code'] ] = $translated_term['term_taxonomy_id'];
|
301 |
+
|
302 |
+
//update translations table
|
303 |
+
$default_category_trid = $sitepress->get_element_trid(
|
304 |
+
get_option( 'default_product_cat' ),
|
305 |
+
'tax_product_cat'
|
306 |
+
);
|
307 |
+
$sitepress->set_element_language_details(
|
308 |
+
$translated_term['term_taxonomy_id'],
|
309 |
+
'tax_product_cat',
|
310 |
+
$default_category_trid,
|
311 |
+
$language['code'],
|
312 |
+
$default_language
|
313 |
+
);
|
314 |
+
}
|
315 |
|
316 |
}
|
317 |
|
inc/class-wcml-media.php
CHANGED
@@ -17,6 +17,11 @@ class WCML_Media{
|
|
17 |
$this->wpdb = $wpdb;
|
18 |
}
|
19 |
|
|
|
|
|
|
|
|
|
|
|
20 |
public function product_images_ids( $product_id ){
|
21 |
$product_images_ids = array();
|
22 |
|
@@ -68,4 +73,57 @@ class WCML_Media{
|
|
68 |
return $product_images_ids;
|
69 |
}
|
70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
}
|
17 |
$this->wpdb = $wpdb;
|
18 |
}
|
19 |
|
20 |
+
public function add_hooks(){
|
21 |
+
//when save new attachment duplicate product gallery
|
22 |
+
add_action( 'wpml_media_create_duplicate_attachment', array( $this, 'sync_product_gallery_duplicate_attachment' ), 11, 2 );
|
23 |
+
}
|
24 |
+
|
25 |
public function product_images_ids( $product_id ){
|
26 |
$product_images_ids = array();
|
27 |
|
73 |
return $product_images_ids;
|
74 |
}
|
75 |
|
76 |
+
public function sync_thumbnail_id( $orig_post_id, $trnsl_post_id, $lang ) {
|
77 |
+
if ( method_exists( 'WPML_Media_Attachments_Duplication', 'sync_post_thumbnail') ) {
|
78 |
+
$factory = new WPML_Media_Attachments_Duplication_Factory();
|
79 |
+
$media_duplicate = $factory->create();
|
80 |
+
$media_duplicate->sync_post_thumbnail( $orig_post_id );
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
public function sync_product_gallery( $product_id ) {
|
85 |
+
|
86 |
+
$product_gallery = get_post_meta( $product_id, '_product_image_gallery', true );
|
87 |
+
$gallery_ids = explode( ',', $product_gallery );
|
88 |
+
|
89 |
+
$trid = $this->sitepress->get_element_trid( $product_id, 'post_product' );
|
90 |
+
$translations = $this->sitepress->get_element_translations( $trid, 'post_product', true );
|
91 |
+
foreach ( $translations as $translation ) {
|
92 |
+
$duplicated_ids = '';
|
93 |
+
if ( ! $translation->original ) {
|
94 |
+
foreach ( $gallery_ids as $image_id ) {
|
95 |
+
if ( get_post( $image_id ) ) {
|
96 |
+
$duplicated_id = apply_filters( 'translate_object_id', $image_id, 'attachment', false, $translation->language_code );
|
97 |
+
if ( is_null( $duplicated_id ) && $image_id ) {
|
98 |
+
$duplicated_id = $this->create_base_media_translation( $image_id, $translation->language_code );
|
99 |
+
}
|
100 |
+
$duplicated_ids .= $duplicated_id . ',';
|
101 |
+
}
|
102 |
+
}
|
103 |
+
$duplicated_ids = substr( $duplicated_ids, 0, strlen( $duplicated_ids ) - 1 );
|
104 |
+
update_post_meta( $translation->element_id, '_product_image_gallery', $duplicated_ids );
|
105 |
+
}
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
public function create_base_media_translation( $attachment_id, $target_lang ) {
|
110 |
+
$duplicate_id = $this->sitepress->make_duplicate( $attachment_id, $target_lang );
|
111 |
+
delete_post_meta( $duplicate_id, '_icl_lang_duplicate_of' );
|
112 |
+
|
113 |
+
foreach ( array( '_wp_attachment_metadata', '_wp_attached_file' ) as $attachment_meta_key ) {
|
114 |
+
update_post_meta( $duplicate_id, $attachment_meta_key, get_post_meta( $attachment_id, $attachment_meta_key, true ) );
|
115 |
+
}
|
116 |
+
|
117 |
+
return $duplicate_id;
|
118 |
+
}
|
119 |
+
|
120 |
+
public function sync_product_gallery_duplicate_attachment( $att_id, $dup_att_id ) {
|
121 |
+
$product_id = wp_get_post_parent_id( $att_id );
|
122 |
+
$post_type = get_post_type( $product_id );
|
123 |
+
if ( $post_type != 'product' ) {
|
124 |
+
return;
|
125 |
+
}
|
126 |
+
$this->sync_product_gallery( $product_id );
|
127 |
+
}
|
128 |
+
|
129 |
}
|
inc/class-wcml-products.php
CHANGED
@@ -37,33 +37,44 @@ class WCML_Products{
|
|
37 |
|
38 |
}
|
39 |
|
40 |
-
|
41 |
|
42 |
-
|
43 |
|
44 |
-
|
|
|
|
|
|
|
45 |
|
46 |
-
|
47 |
|
48 |
-
|
49 |
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
54 |
|
55 |
-
|
56 |
-
|
57 |
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
|
|
|
|
|
67 |
|
68 |
// Check if original product
|
69 |
public function is_original_product( $product_id ){
|
37 |
|
38 |
}
|
39 |
|
40 |
+
public function add_hooks() {
|
41 |
|
42 |
+
if ( is_admin() ) {
|
43 |
|
44 |
+
add_filter( 'woocommerce_json_search_found_products', array(
|
45 |
+
$this,
|
46 |
+
'woocommerce_json_search_found_products'
|
47 |
+
) );
|
48 |
|
49 |
+
add_filter( 'post_row_actions', array( $this, 'filter_product_actions' ), 10, 2 );
|
50 |
|
51 |
+
add_action( 'wp_ajax_wpml_switch_post_language', array( $this, 'switch_product_variations_language' ), 9 );
|
52 |
|
53 |
+
} else {
|
54 |
+
add_filter( 'woocommerce_json_search_found_products', array( $this, 'filter_found_products_by_language' ) );
|
55 |
+
add_filter( 'woocommerce_related_products_args', array( $this, 'filter_related_products_args' ) );
|
56 |
+
add_filter( 'woocommerce_shortcode_products_query', array(
|
57 |
+
$this,
|
58 |
+
'add_lang_to_shortcode_products_query'
|
59 |
+
) );
|
60 |
|
61 |
+
add_filter( 'woocommerce_product_file_download_path', array( $this, 'filter_file_download_path' ) );
|
62 |
+
}
|
63 |
|
64 |
+
add_filter( 'woocommerce_upsell_crosssell_search_products', array(
|
65 |
+
$this,
|
66 |
+
'filter_woocommerce_upsell_crosssell_posts_by_language'
|
67 |
+
) );
|
68 |
+
//update menu_order fro translations after ordering original products
|
69 |
+
add_action( 'woocommerce_after_product_ordering', array( $this, 'update_all_products_translations_ordering' ) );
|
70 |
+
//filter to copy excerpt value
|
71 |
+
add_filter( 'wpml_copy_from_original_custom_fields', array( $this, 'filter_excerpt_field_content_copy' ) );
|
72 |
|
73 |
+
add_filter( 'wpml_override_is_translator', array( $this, 'wcml_override_is_translator' ), 10, 3 );
|
74 |
+
add_filter( 'wc_product_has_unique_sku', array( $this, 'check_product_sku' ), 10, 3 );
|
75 |
+
|
76 |
+
add_filter( 'get_product_search_form', array( $this->sitepress, 'get_search_form_filter' ) );
|
77 |
+
}
|
78 |
|
79 |
// Check if original product
|
80 |
public function is_original_product( $product_id ){
|
inc/class-wcml-troubleshooting.php
CHANGED
@@ -18,6 +18,7 @@ class WCML_Troubleshooting{
|
|
18 |
|
19 |
function init(){
|
20 |
add_action('wp_ajax_trbl_sync_variations', array($this,'trbl_sync_variations'));
|
|
|
21 |
add_action('wp_ajax_trbl_update_count', array($this,'trbl_update_count'));
|
22 |
add_action('wp_ajax_trbl_sync_categories', array($this,'trbl_sync_categories'));
|
23 |
add_action('wp_ajax_trbl_duplicate_terms', array($this,'trbl_duplicate_terms'));
|
@@ -121,7 +122,24 @@ class WCML_Troubleshooting{
|
|
121 |
wp_send_json_success();
|
122 |
}
|
123 |
|
124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
|
126 |
$sql = "SELECT p.ID FROM {$this->wpdb->posts} AS p
|
127 |
LEFT JOIN {$this->wpdb->prefix}icl_translations AS tr
|
18 |
|
19 |
function init(){
|
20 |
add_action('wp_ajax_trbl_sync_variations', array($this,'trbl_sync_variations'));
|
21 |
+
add_action('wp_ajax_trbl_gallery_images', array($this,'trbl_gallery_images'));
|
22 |
add_action('wp_ajax_trbl_update_count', array($this,'trbl_update_count'));
|
23 |
add_action('wp_ajax_trbl_sync_categories', array($this,'trbl_sync_categories'));
|
24 |
add_action('wp_ajax_trbl_duplicate_terms', array($this,'trbl_duplicate_terms'));
|
122 |
wp_send_json_success();
|
123 |
}
|
124 |
|
125 |
+
function trbl_gallery_images(){
|
126 |
+
$nonce = filter_input( INPUT_POST, 'wcml_nonce', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
|
127 |
+
if(!$nonce || !wp_verify_nonce($nonce, 'trbl_gallery_images')){
|
128 |
+
wp_send_json_error('Invalid nonce');
|
129 |
+
}
|
130 |
+
|
131 |
+
$all_products = $this->get_products_needs_gallery_sync( true );
|
132 |
+
|
133 |
+
foreach( $all_products as $product ){
|
134 |
+
$this->woocommerce_wpml->media->sync_product_gallery($product->ID);
|
135 |
+
add_post_meta($product->ID,'gallery_sync',true);
|
136 |
+
}
|
137 |
+
|
138 |
+
wp_send_json_success();
|
139 |
+
|
140 |
+
}
|
141 |
+
|
142 |
+
function get_products_needs_gallery_sync( $limit = false ){
|
143 |
|
144 |
$sql = "SELECT p.ID FROM {$this->wpdb->posts} AS p
|
145 |
LEFT JOIN {$this->wpdb->prefix}icl_translations AS tr
|
inc/class-wcml-wc-strings.php
CHANGED
@@ -50,9 +50,7 @@ class WCML_WC_Strings{
|
|
50 |
}
|
51 |
add_action( 'woocommerce_product_options_attributes', array ( $this, 'notice_after_woocommerce_product_options_attributes' ) );
|
52 |
|
53 |
-
|
54 |
-
add_filter( 'woocommerce_attribute_taxonomies', array( $this, 'translate_attribute_taxonomies_labels') );
|
55 |
-
}
|
56 |
|
57 |
add_filter('woocommerce_get_breadcrumb', array($this, 'filter_woocommerce_breadcrumbs' ), 10, 2 );
|
58 |
}
|
@@ -353,38 +351,48 @@ class WCML_WC_Strings{
|
|
353 |
$current_language = $this->sitepress->get_current_language();
|
354 |
$default_language = $this->sitepress->get_default_language();
|
355 |
|
356 |
-
|
357 |
|
358 |
-
|
359 |
|
360 |
-
|
361 |
-
// Similar to WC_Breadcrumb::prepend_shop_page
|
362 |
-
$trnsl_base = $this->woocommerce_wpml->url_translation->get_base_translation( 'product', $current_language );
|
363 |
-
if( $trnsl_base['translated_base'] === '' ){
|
364 |
-
$trnsl_base['translated_base'] = $trnsl_base['original_value'];
|
365 |
-
}
|
366 |
|
367 |
-
|
368 |
-
$breadcrumbs_buff = array();
|
369 |
-
$i = 0;
|
370 |
-
foreach( $breadcrumbs as $key => $breadcrumb ){
|
371 |
|
372 |
-
|
373 |
-
$breadcrumbs_buff[ $i ] = $breadcrumb;
|
374 |
-
}
|
375 |
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
$breadcrumbs = $breadcrumbs_buff;
|
383 |
|
384 |
-
|
385 |
-
|
|
|
|
|
386 |
|
387 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
388 |
|
389 |
return $breadcrumbs;
|
390 |
}
|
@@ -401,28 +409,29 @@ class WCML_WC_Strings{
|
|
401 |
}
|
402 |
}
|
403 |
|
404 |
-
|
405 |
|
406 |
-
|
407 |
|
408 |
-
|
409 |
-
|
410 |
|
411 |
-
|
|
|
|
|
412 |
|
413 |
-
|
414 |
-
|
415 |
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
}
|
422 |
|
|
|
423 |
|
424 |
-
|
425 |
-
|
426 |
|
427 |
function get_translation_from_woocommerce_mo_file( $string, $language, $return_original = true ){
|
428 |
|
50 |
}
|
51 |
add_action( 'woocommerce_product_options_attributes', array ( $this, 'notice_after_woocommerce_product_options_attributes' ) );
|
52 |
|
53 |
+
add_filter( 'woocommerce_attribute_taxonomies', array( $this, 'translate_attribute_taxonomies_labels' ) );
|
|
|
|
|
54 |
|
55 |
add_filter('woocommerce_get_breadcrumb', array($this, 'filter_woocommerce_breadcrumbs' ), 10, 2 );
|
56 |
}
|
351 |
$current_language = $this->sitepress->get_current_language();
|
352 |
$default_language = $this->sitepress->get_default_language();
|
353 |
|
354 |
+
$woocommerce_shop_page = wc_get_page_id( 'shop' );
|
355 |
|
356 |
+
if( isset( $woocommerce_shop_page ) ) {
|
357 |
|
358 |
+
$is_shop_page_active = get_post_status( $woocommerce_shop_page );
|
|
|
|
|
|
|
|
|
|
|
359 |
|
360 |
+
if ( ( $current_language != $default_language || $default_language != 'en' ) && $is_shop_page_active === 'publish' ) {
|
|
|
|
|
|
|
361 |
|
362 |
+
$shop_page = get_post( $woocommerce_shop_page );
|
|
|
|
|
363 |
|
364 |
+
// If permalinks contain the shop page in the URI prepend the breadcrumb with shop
|
365 |
+
// Similar to WC_Breadcrumb::prepend_shop_page
|
366 |
+
$trnsl_base = $this->woocommerce_wpml->url_translation->get_base_translation( 'product', $current_language );
|
367 |
+
if ( $trnsl_base['translated_base'] === '' ) {
|
368 |
+
$trnsl_base['translated_base'] = $trnsl_base['original_value'];
|
369 |
+
}
|
|
|
370 |
|
371 |
+
if ( is_woocommerce() && $shop_page->ID && strstr( $trnsl_base['translated_base'], urldecode( $shop_page->post_name ) ) && get_option( 'page_on_front' ) != $shop_page->ID ) {
|
372 |
+
$breadcrumbs_buff = array();
|
373 |
+
$i = 0;
|
374 |
+
foreach ( $breadcrumbs as $key => $breadcrumb ) {
|
375 |
|
376 |
+
if ( ! in_array( $breadcrumb, $breadcrumbs_buff ) ) {
|
377 |
+
$breadcrumbs_buff[ $i ] = $breadcrumb;
|
378 |
+
}
|
379 |
+
|
380 |
+
if ( $key === 0 && $breadcrumbs[1][1] != get_post_type_archive_link( 'product' ) ) {
|
381 |
+
$i ++;
|
382 |
+
$breadcrumbs_buff[ $i ] = array(
|
383 |
+
$shop_page->post_title,
|
384 |
+
get_post_type_archive_link( 'product' )
|
385 |
+
);
|
386 |
+
}
|
387 |
+
$i ++;
|
388 |
+
}
|
389 |
+
$breadcrumbs = $breadcrumbs_buff;
|
390 |
+
|
391 |
+
$breadcrumbs = array_values( $breadcrumbs );
|
392 |
+
}
|
393 |
+
|
394 |
+
}
|
395 |
+
}
|
396 |
|
397 |
return $breadcrumbs;
|
398 |
}
|
409 |
}
|
410 |
}
|
411 |
|
412 |
+
function translate_attribute_taxonomies_labels( $attribute_taxonomies ) {
|
413 |
|
414 |
+
if ( is_admin() && ! wpml_is_ajax() ) {
|
415 |
|
416 |
+
foreach ( $attribute_taxonomies as $key => $attribute_taxonomy ) {
|
417 |
+
$string_language = $this->get_string_language( $attribute_taxonomy->attribute_label, 'WordPress', 'taxonomy singular name: ' . $attribute_taxonomy->attribute_label );
|
418 |
|
419 |
+
if ( $this->sitepress->get_current_language() == $string_language ) {
|
420 |
+
continue;
|
421 |
+
}
|
422 |
|
423 |
+
$string_id = icl_get_string_id( $attribute_taxonomy->attribute_label, 'WordPress', 'taxonomy singular name: ' . $attribute_taxonomy->attribute_label );
|
424 |
+
$strings = icl_get_string_translations_by_id( $string_id );
|
425 |
|
426 |
+
if ( $strings && isset( $strings[ $this->sitepress->get_current_language() ] ) ) {
|
427 |
+
$attribute_taxonomies[ $key ]->attribute_label = $strings[ $this->sitepress->get_current_language() ]['value'];
|
428 |
+
}
|
429 |
+
}
|
|
|
|
|
430 |
|
431 |
+
}
|
432 |
|
433 |
+
return $attribute_taxonomies;
|
434 |
+
}
|
435 |
|
436 |
function get_translation_from_woocommerce_mo_file( $string, $language, $return_original = true ){
|
437 |
|
inc/template-classes/class-wcml-troubleshooting-ui.php
CHANGED
@@ -38,6 +38,7 @@ class WCML_Troubleshooting_UI extends WPML_Templates_Factory {
|
|
38 |
'prod_var' => __( 'products with variations', 'woocommerce-multilingual' ),
|
39 |
'sync_var' => __( 'Sync products variations:', 'woocommerce-multilingual' ),
|
40 |
'left' => __( 'left', 'woocommerce-multilingual' ),
|
|
|
41 |
'sync_cat' => __( 'Sync products categories (display type, thumbnail):', 'woocommerce-multilingual' ),
|
42 |
'dup_terms' => __( 'Duplicate terms ( please select attribute ):', 'woocommerce-multilingual' ),
|
43 |
'none' => __( 'none', 'woocommerce-multilingual' ),
|
@@ -49,6 +50,7 @@ class WCML_Troubleshooting_UI extends WPML_Templates_Factory {
|
|
49 |
'nonces' => array(
|
50 |
'trbl_update_count' => wp_nonce_field('trbl_update_count', 'trbl_update_count_nonce'),
|
51 |
'trbl_sync_variations' => wp_nonce_field('trbl_sync_variations', 'trbl_sync_variations_nonce'),
|
|
|
52 |
'trbl_sync_categories' => wp_nonce_field('trbl_sync_categories', 'trbl_sync_categories_nonce'),
|
53 |
'trbl_duplicate_terms' => wp_nonce_field('trbl_duplicate_terms', 'trbl_duplicate_terms_nonce'),
|
54 |
'trbl_product_type_terms' => wp_nonce_field('trbl_product_type_terms', 'trbl_product_type_terms_nonce'),
|
38 |
'prod_var' => __( 'products with variations', 'woocommerce-multilingual' ),
|
39 |
'sync_var' => __( 'Sync products variations:', 'woocommerce-multilingual' ),
|
40 |
'left' => __( 'left', 'woocommerce-multilingual' ),
|
41 |
+
'sync_gallery' => __( 'Sync products "gallery images":', 'woocommerce-multilingual' ),
|
42 |
'sync_cat' => __( 'Sync products categories (display type, thumbnail):', 'woocommerce-multilingual' ),
|
43 |
'dup_terms' => __( 'Duplicate terms ( please select attribute ):', 'woocommerce-multilingual' ),
|
44 |
'none' => __( 'none', 'woocommerce-multilingual' ),
|
50 |
'nonces' => array(
|
51 |
'trbl_update_count' => wp_nonce_field('trbl_update_count', 'trbl_update_count_nonce'),
|
52 |
'trbl_sync_variations' => wp_nonce_field('trbl_sync_variations', 'trbl_sync_variations_nonce'),
|
53 |
+
'trbl_gallery_images' => wp_nonce_field('trbl_gallery_images', 'trbl_gallery_images_nonce'),
|
54 |
'trbl_sync_categories' => wp_nonce_field('trbl_sync_categories', 'trbl_sync_categories_nonce'),
|
55 |
'trbl_duplicate_terms' => wp_nonce_field('trbl_duplicate_terms', 'trbl_duplicate_terms_nonce'),
|
56 |
'trbl_product_type_terms' => wp_nonce_field('trbl_product_type_terms', 'trbl_product_type_terms_nonce'),
|
inc/translation-editor/class-wcml-editor-ui-product-job.php
CHANGED
@@ -714,16 +714,22 @@ class WCML_Editor_UI_Product_Job extends WPML_Editor_UI_Job {
|
|
714 |
// synchronize post variations
|
715 |
$this->woocommerce_wpml->sync_variations_data->sync_product_variations( $this->product_id, $tr_product_id, $this->get_target_language(), $translations, true );
|
716 |
|
717 |
-
|
718 |
-
|
719 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
720 |
|
721 |
if ( $product_images ) {
|
722 |
foreach ( $product_images as $image_id ) {
|
723 |
$trnsl_prod_image = apply_filters( 'translate_object_id', $image_id, 'attachment', false, $this->get_target_language() );
|
724 |
|
725 |
if ( ! $trnsl_prod_image ) {
|
726 |
-
$trnsl_prod_image = $this->create_base_media_translation( $image_id, $this->get_target_language() );
|
727 |
}
|
728 |
|
729 |
//update image texts
|
@@ -899,17 +905,6 @@ class WCML_Editor_UI_Product_Job extends WPML_Editor_UI_Job {
|
|
899 |
}
|
900 |
}
|
901 |
|
902 |
-
private function create_base_media_translation( $attachment_id, $target_lang ) {
|
903 |
-
$duplicate_id = $this->sitepress->make_duplicate( $attachment_id, $target_lang );
|
904 |
-
delete_post_meta( $duplicate_id, '_icl_lang_duplicate_of' );
|
905 |
-
|
906 |
-
foreach ( array( '_wp_attachment_metadata', '_wp_attached_file' ) as $attachment_meta_key ) {
|
907 |
-
update_post_meta( $duplicate_id, $attachment_meta_key, get_post_meta( $attachment_id, $attachment_meta_key, true ) );
|
908 |
-
}
|
909 |
-
|
910 |
-
return $duplicate_id;
|
911 |
-
}
|
912 |
-
|
913 |
public function requires_translation_complete_for_each_field() {
|
914 |
return false;
|
915 |
}
|
714 |
// synchronize post variations
|
715 |
$this->woocommerce_wpml->sync_variations_data->sync_product_variations( $this->product_id, $tr_product_id, $this->get_target_language(), $translations, true );
|
716 |
|
717 |
+
$this->woocommerce_wpml->sync_product_data->sync_linked_products( $this->product_id, $tr_product_id, $this->get_target_language() );
|
718 |
+
|
719 |
+
//sync feature image
|
720 |
+
$this->woocommerce_wpml->media->sync_thumbnail_id( $this->product_id, $tr_product_id, $this->get_target_language() );
|
721 |
+
//sync product gallery
|
722 |
+
$this->woocommerce_wpml->media->sync_product_gallery( $this->product_id );
|
723 |
+
|
724 |
+
//save images texts
|
725 |
+
$product_images = $this->woocommerce_wpml->media->product_images_ids( $this->product_id );
|
726 |
|
727 |
if ( $product_images ) {
|
728 |
foreach ( $product_images as $image_id ) {
|
729 |
$trnsl_prod_image = apply_filters( 'translate_object_id', $image_id, 'attachment', false, $this->get_target_language() );
|
730 |
|
731 |
if ( ! $trnsl_prod_image ) {
|
732 |
+
$trnsl_prod_image = $this->woocommerce_wpml->media->create_base_media_translation( $image_id, $this->get_target_language() );
|
733 |
}
|
734 |
|
735 |
//update image texts
|
905 |
}
|
906 |
}
|
907 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
908 |
public function requires_translation_complete_for_each_field() {
|
909 |
return false;
|
910 |
}
|
inc/translation-editor/class-wcml-synchronize-product-data.php
CHANGED
@@ -144,6 +144,10 @@ class WCML_Synchronize_Product_Data{
|
|
144 |
|
145 |
$this->woocommerce_wpml->attributes->sync_product_attr( $original_product_id, $tr_product_id );
|
146 |
|
|
|
|
|
|
|
|
|
147 |
$this->woocommerce_wpml->attributes->sync_default_product_attr( $original_product_id, $tr_product_id, $lang );
|
148 |
|
149 |
//sync taxonomies
|
144 |
|
145 |
$this->woocommerce_wpml->attributes->sync_product_attr( $original_product_id, $tr_product_id );
|
146 |
|
147 |
+
$this->woocommerce_wpml->media->sync_thumbnail_id( $original_product_id, $tr_product_id, $lang );
|
148 |
+
|
149 |
+
$this->woocommerce_wpml->media->sync_product_gallery( $original_product_id );
|
150 |
+
|
151 |
$this->woocommerce_wpml->attributes->sync_default_product_attr( $original_product_id, $tr_product_id, $lang );
|
152 |
|
153 |
//sync taxonomies
|
inc/translation-editor/class-wcml-synchronize-variations-data.php
CHANGED
@@ -157,7 +157,10 @@ class WCML_Synchronize_Variations_Data{
|
|
157 |
update_post_meta( $variation_id, '_variation_description', $data[ md5( '_variation_description'.$original_variation_id ) ] );
|
158 |
}
|
159 |
|
160 |
-
|
|
|
|
|
|
|
161 |
$this->woocommerce_wpml->downloadable->sync_files_to_translations( $original_variation_id, $variation_id, $data );
|
162 |
|
163 |
//sync taxonomies
|
157 |
update_post_meta( $variation_id, '_variation_description', $data[ md5( '_variation_description'.$original_variation_id ) ] );
|
158 |
}
|
159 |
|
160 |
+
//sync media
|
161 |
+
$this->woocommerce_wpml->media->sync_thumbnail_id( $original_variation_id, $variation_id, $lang );
|
162 |
+
|
163 |
+
//sync file_paths
|
164 |
$this->woocommerce_wpml->downloadable->sync_files_to_translations( $original_variation_id, $variation_id, $data );
|
165 |
|
166 |
//sync taxonomies
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: CMS, woocommerce, commerce, ecommerce, e-commerce, products, WPML, multili
|
|
5 |
License: GPLv2
|
6 |
Requires at least: 3.9
|
7 |
Tested up to: 4.9.6
|
8 |
-
Stable tag: 4.3.
|
9 |
|
10 |
Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
|
11 |
|
@@ -140,6 +140,16 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
|
|
140 |
|
141 |
== Changelog ==
|
142 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
= 4.3.2.1 =
|
144 |
* wcmlc argument always being added when switching currency
|
145 |
* Missing images on the translated product page
|
5 |
License: GPLv2
|
6 |
Requires at least: 3.9
|
7 |
Tested up to: 4.9.6
|
8 |
+
Stable tag: 4.3.3
|
9 |
|
10 |
Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
|
11 |
|
140 |
|
141 |
== Changelog ==
|
142 |
|
143 |
+
= 4.3.3 =
|
144 |
+
* Fixed small issue in WC Bookings where block cost in other currencies is not saved correctly
|
145 |
+
* Fix compatibility issue with WC Product Addons and not displayed label in secondary language
|
146 |
+
* Return back duplication logic for product image and gallery
|
147 |
+
* Fix warning in secondary language if you don't have any wc pages
|
148 |
+
* Fix wrong language for attribute in Product creation page
|
149 |
+
* Fixed bug in Product Search Widget when wpml language set as a parameter
|
150 |
+
* Fixed fatal error occurring in some cases when updating from older versions
|
151 |
+
* Fixed cosmetic issue when hovering over currencies
|
152 |
+
|
153 |
= 4.3.2.1 =
|
154 |
* wcmlc argument always being added when switching currency
|
155 |
* Missing images on the translated product page
|
res/js/multi-currency.js
CHANGED
@@ -189,12 +189,15 @@ jQuery( function($){
|
|
189 |
|
190 |
$('#currency-table').find('tr.default_currency').before( tr );
|
191 |
|
192 |
-
var tr = $('
|
193 |
tr.attr('id', 'currency_row_langs_' + currency);
|
194 |
$('#currency-lang-table').find('tr.default_currency').before( tr );
|
195 |
|
|
|
196 |
tr.find('.on a').each( function(){
|
197 |
$(this).attr('data-currency', currency);
|
|
|
|
|
198 |
});
|
199 |
|
200 |
//add to default currency list
|
189 |
|
190 |
$('#currency-table').find('tr.default_currency').before( tr );
|
191 |
|
192 |
+
var tr = $('.empty-currency-language-row').clone();
|
193 |
tr.attr('id', 'currency_row_langs_' + currency);
|
194 |
$('#currency-lang-table').find('tr.default_currency').before( tr );
|
195 |
|
196 |
+
tr.removeClass('hidden empty-currency-language-row');
|
197 |
tr.find('.on a').each( function(){
|
198 |
$(this).attr('data-currency', currency);
|
199 |
+
$(this).attr('title', $(this).attr('title').replace('%code%', response.currency_name));
|
200 |
+
$(this).attr('data-title-alt', $(this).attr('data-title-alt').replace('%code%', response.currency_name));
|
201 |
});
|
202 |
|
203 |
//add to default currency list
|
res/js/multi-currency.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function(a){WCML_Multi_Currency={_currency_languages_saving:0,init:function(){a(document).ready(function(){WCML_Multi_Currency.setup_multi_currency_toggle(),a(document).on("change",".currency_code select",WCML_Multi_Currency.select_currency),a(document).on("click",".delete_currency",WCML_Multi_Currency.delete_currency),a(document).on("click",".wcml_currency_options .currency_options_save",WCML_Multi_Currency.save_currency),a(document).on("click",".js-display-tooltip",WCML_Multi_Currency.tooltip),a(document).on("click",".currency_languages a.otgs-ico-no",WCML_Multi_Currency.enable_currency_for_language),a(document).on("click",".currency_languages a.otgs-ico-yes",WCML_Multi_Currency.disable_currency_for_language),a(document).on("change",".default_currency select",WCML_Multi_Currency.change_default_currency),WCML_Multi_Currency.setup_currencies_sorting(),a(document).on("change",".currency_option_position",WCML_Multi_Currency.price_preview),a(document).on("change",".currency_option_thousand_sep",WCML_Multi_Currency.price_preview),a(document).on("change",".currency_option_decimal_sep",WCML_Multi_Currency.price_preview),a(document).on("change",".currency_option_decimals",WCML_Multi_Currency.price_preview),a(document).on("change",".currency_code select",WCML_Multi_Currency.price_preview),a(document).on("keyup",".wcml-exchange-rate",WCML_Multi_Currency.exchange_rate_check),a("#wcml_mc_options").length&&(WCML_Multi_Currency.wcml_mc_form_submitted=!1,WCML_Multi_Currency.read_form_fields_status(),window.onbeforeunload=function(b){if(!WCML_Multi_Currency.wcml_mc_form_submitted&&WCML_Multi_Currency.form_fields_changed()||WCML_Multi_Currency.is_update_currency_lang_in_progress())return a("#wcml_warn_message").val()},a("#wcml_mc_options").on("submit",function(){WCML_Multi_Currency.wcml_mc_form_submitted=!0}))})},setup_multi_currency_toggle:function(){a("#multi_currency_independent").change(function(){"checked"==a(this).attr("checked")?a("#currency-switcher, #currency-switcher-widget, #currency-switcher-product, #multi-currency-per-language-details, #online-exchange-rates").fadeIn():a("#currency-switcher, #currency-switcher-widget, #currency-switcher-product, #multi-currency-per-language-details, #online-exchange-rates").fadeOut()})},select_currency:function(){var b=a(this).closest(".wcml_currency_options"),c=b.find(".wcml-dialog-close-button");c.attr("data-currency",a(this).val()),c.attr("data-symbol",a(this).find("option:selected").attr("data-symbol")),b.find(".this-currency").html(a(this).val())},delete_currency:function(b){b.preventDefault();var c=!1,d=a(this).data("currency"),e=a(this).data("currency_name"),f=a(this).data("currency_symbol");if(a(".currency_lang_table .wcml-row-currency-lang:first .currency_languages").each(function(){if(!WCML_Multi_Currency.check_currency_language(a(this).find("li").data("lang"),d))return c=!0,!1}),!c){a("#currency_row_"+d+" .currency_action_update").hide();var g=a('<span class="spinner" style="visibility: visible;margin:0;">');return a(this).hide(),a(this).parent().append(g).show(),a.ajax({type:"post",url:ajaxurl,data:{action:"wcml_delete_currency",wcml_nonce:a("#del_currency_nonce").val(),code:d},success:function(b){a("#currency_row_"+d).remove(),a("#currency_row_langs_"+d).remove(),a("#currency_row_del_"+d).remove(),a("#wcml_currencies_order .wcml_currencies_order_"+d).remove(),a("#wcml_currency_options_code_").prepend('<option data-symbol="'+f+'" value="'+d+'">'+e+"</option>"),a("#wcml_currency_options_code_").val(d).trigger("change"),a("#currency-lang-table").find("tr.default_currency select").each(function(){a(this).find("option[value='"+d+"']").remove()}),a(".wcml-ui-dialog").each(function(){WCML_Currency_Switcher_Settings.currency_switcher_preview(a(this))}),1==a(".wcml-row-currency").length&&(a("#online-exchange-rates-no-currencies").next().hide(),a("#online-exchange-rates-no-currencies").show())},done:function(){g.remove()}}),!1}},save_currency:function(){var b=a(this).closest(".wcml-dialog-container"),c=WCML_Multi_Currency.check_on_numeric(b,".currency_option_decimals"),d=WCML_Multi_Currency.check_on_numeric(b,".abstract_amount");if(c||d)return!1;a(".wcml-currency-options-dialog :submit, .wcml-currency-options-dialog :button").prop("disabled",!0);var e=b.find('[name="currency_options[code]"]').val(),f=a('<span class="spinner" style="visibility:visible;position:absolute;margin-left:10px;"></span>');return f.show(),a(this).parent().prepend(f),a.ajax({url:ajaxurl,type:"POST",dataType:"json",data:b.find('[name^="currency_options"]').serialize()+"&action=wcml_save_currency&wcml_nonce="+jQuery("#wcml_save_currency_nonce").val(),success:function(c){if(b.find(".wcml-dialog-close-button").trigger("click"),a(".wcml-ui-dialog").each(function(){WCML_Currency_Switcher_Settings.currency_switcher_preview(a(this))}),0==a("#currency_row_"+e).length){var d=a("#currency-table tr.wcml-row-currency:last").clone();d.attr("id","currency_row_"+e);var f=d.find(".wcml-col-edit a");f.attr("data-content","wcml_currency_options_"+e),f.attr("data-currency",e),f.data("dialog","wcml_currency_options_"+e),f.removeClass("hidden"),a("#currency-table").find("tr.default_currency").before(d);var d=a("#currency-lang-table tr.wcml-row-currency-lang:last").clone();d.attr("id","currency_row_langs_"+e),a("#currency-lang-table").find("tr.default_currency").before(d),d.find(".on a").each(function(){a(this).attr("data-currency",e)}),a("#currency-lang-table").find("tr.default_currency select").each(function(){a(this).append('<option value="'+e+'">'+e+"</option>")}),a("#wcml_currencies_order").append('<li class="wcml_currencies_order_'+e+' ui-sortable-handle" cur="'+e+'">'+c.currency_name_formatted+"</li>");var d=a("#currency-delete-table tr.wcml-row-currency-del:last").clone();d.attr("id","currency_row_del_"+e);var g=d.find(".delete_currency");g.removeClass("hidden"),g.attr("data-currency",e),g.attr("data-currency_name",c.currency_name),g.attr("data-currency_symbol",c.currency_symbol),a("#currency-delete-table").find("tr.default_currency").before(d)}a("#currency_row_"+e+" .wcml-col-currency").html(c.currency_name_formatted),a("#currency_row_"+e+" .wcml-col-rate").html(c.currency_meta_info),a("#wcml_currency_options_"+e).remove(),a("#wcml_mc_options").before(c.currency_options),a('#wcml_currency_options_code_ option[value="'+e+'"]').remove(),a("#online-exchange-rates-no-currencies").is(":visible")&&(a("#online-exchange-rates-no-currencies").hide(),a("#online-exchange-rates-no-currencies").next().show())}}),!1},check_on_numeric:function(b,c){var d=a('<span class="wcml-error">');return WCML_Multi_Currency.is_number(b.find(c).val())?(b.find(c).parent().find(".wcml-error").size()>0&&b.find(c).parent().find(".wcml-error").remove(),!1):(0==b.find(c).parent().find(".wcml-error").size()&&(b.find(c).parent().append(d),d.text(b.find(c).data("message"))),!0)},tooltip:function(){var b=a(this);a(".wp-pointer").fadeOut(100),a(this).pointer({content:"<h3>"+b.data("header")+"</h3><p>"+b.data("content")+"</p>",position:{edge:"left",align:"center",offset:"15 0"}}).pointer("open")},enable_currency_for_language:function(b){if(WCML_Multi_Currency.is_update_currency_lang_in_progress())return!1;b.preventDefault(),a(this).addClass("spinner").removeClass("otgs-ico-no").css("visibility","visible");a(this).closest("tr")[0].rowIndex;a('.default_currency select[rel="'+a(this).data("language")+'"]').append('<option value="'+a(this).data("currency")+'">'+a(this).data("currency")+"</option>"),WCML_Multi_Currency.update_currency_lang(a(this),1,0);var c=a(this).data("title-alt");a(this).data("title-alt",a(this).attr("title")),a(this).attr("title",c)},disable_currency_for_language:function(b){if(WCML_Multi_Currency.is_update_currency_lang_in_progress())return!1;b.preventDefault(),a(this).addClass("spinner").removeClass("otgs-ico-yes").css("visibility","visible");var c=a(this).data("language");if(!WCML_Multi_Currency.check_currency_language(c))return void a(this).removeClass("spinner").addClass("otgs-ico-yes");a(this).closest("tr")[0].rowIndex;a('.currency_languages select[rel="'+a(this).data("language")+'"]').val()==a(this).data("currency")?WCML_Multi_Currency.update_currency_lang(a(this),0,1):WCML_Multi_Currency.update_currency_lang(a(this),0,0),a('.default_currency select[rel="'+a(this).data("language")+'"] option[value="'+a(this).data("currency")+'"]').remove();var d=a(this).data("title-alt");a(this).data("title-alt",a(this).attr("title")),a(this).attr("title",d)},check_currency_language:function(b,c){var d=a('#currency-lang-table a.otgs-ico-yes[data-language="'+b+'"]');return c&&(d=a('#currency-lang-table a.otgs-ico-yes[data-language="'+b+'"]').not(a('[data-currency="'+c+'"]'))),0!=d.length||(alert(a("#wcml_warn_disable_language_massage").val()),!1)},is_update_currency_lang_in_progress:function(){return void 0!==WCML_Multi_Currency._update_currency_lang_sync_flag&&1==WCML_Multi_Currency._update_currency_lang_sync_flag},set_update_currency_lang_in_progress:function(a){WCML_Multi_Currency._update_currency_lang_sync_flag=a},update_currency_lang:function(b,c,d){WCML_Multi_Currency._currency_languages_saving++,a("#wcml_mc_options :submit").attr("disabled","disabled"),a('input[name="wcml_mc_options"]').attr("disabled","disabled");var e=b.data("language"),f=b.data("currency");discard=!0,WCML_Multi_Currency.set_update_currency_lang_in_progress(1),a.ajax({type:"post",url:ajaxurl,data:{action:"wcml_update_currency_lang",value:c,lang:e,code:f,wcml_nonce:a("#update_currency_lang_nonce").val()},success:function(){d&&WCML_Multi_Currency.update_default_currency(e,0)},complete:function(){a('input[name="wcml_mc_options"]').removeAttr("disabled"),discard=!1,b.removeClass("spinner").css("visibility","visible"),c?b.addClass("otgs-ico-yes"):b.addClass("otgs-ico-no"),WCML_Multi_Currency._currency_languages_saving--,0==WCML_Multi_Currency._currency_languages_saving&&a("#wcml_mc_options :submit").removeAttr("disabled"),WCML_Multi_Currency.set_update_currency_lang_in_progress(0)}})},change_default_currency:function(){WCML_Multi_Currency.update_default_currency(a(this).attr("rel"),a(this).val(),a(this))},update_default_currency:function(b,c,d){if(a("#wcml_mc_options_submit").attr("disabled","disabled"),d){var e=a('<span class="spinner" style="visibility: visible;float:none;position: absolute">');d.parent().append(e)}discard=!0,a.ajax({type:"post",url:ajaxurl,data:{action:"wcml_update_default_currency",lang:b,code:c,wcml_nonce:a("#wcml_update_default_currency_nonce").val()},complete:function(){discard=!1,a("#wcml_mc_options_submit").removeAttr("disabled"),d&&d.parent().find(".spinner").remove()}})},is_number:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},setup_currencies_sorting:function(){a("#wcml_currencies_order").sortable({update:function(){var b=[];a("#wcml_currencies_order").find("li").each(function(){b.push(a(this).attr("cur"))}),a.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"wcml_currencies_order",wcml_nonce:a("#wcml_currencies_order_order_nonce").val(),order:b.join(";")},success:function(b){b.success&&(fadeInAjxResp(".wcml_currencies_order_ajx_resp",b.data.message),a(".wcml-ui-dialog").each(function(){WCML_Currency_Switcher_Settings.currency_switcher_preview(a(this))}))}})}})},price_preview:function(){var b=a(this).closest(".wcml_currency_options"),c=b.find(".currency_option_position").val(),d=b.find(".currency_option_thousand_sep").val(),d=b.find(".currency_option_thousand_sep").val(),e=b.find(".currency_option_decimal_sep").val(),f=a(this).closest(".wcml_currency_options").find(".wcml-dialog-close-button").attr("data-symbol"),g="56789".substr(0,b.find(".currency_option_decimals").val());""==g&&(e="");var h="";switch(c){case"left":h="{symbol}1{thousand_sep}234{decimal_sep}{decimals}";break;case"right":h="1{thousand_sep}234{decimal_sep}{decimals}{symbol}";break;case"left_space":h="{symbol} 1{thousand_sep}234{decimal_sep}{decimals}";break;case"right_space":h="1{thousand_sep}234{decimal_sep}{decimals} {symbol}"}var i=h.replace(/\{symbol\}/,f).replace(/\{thousand_sep\}/,d).replace(/\{decimal_sep\}/,e).replace(/\{decimals\}/,g);return b.find(".wcml-co-preview-value").html(i),!1},read_form_fields_status:function(){this.mc_form_status=a("#wcml_mc_options").serialize()},form_fields_changed:function(){return this.mc_form_status!=a("#wcml_mc_options").serialize()},exchange_rate_check:function(b){if(void 0===c)var c={DOM_SUBTRACT:109,DOM_DASH:189,DOM_E:69};a(this).val()<=0||!WCML_Multi_Currency.is_number(a(this).val())||b.keyCode==c.DOM_SUBTRACT||b.keyCode==c.DOM_DASH||b.keyCode==c.DOM_E?(a(".wcml-co-set-rate .wcml-error").fadeIn(),a(".currency_options_save").attr("disabled","disabled")):(a(".wcml-co-set-rate .wcml-error").fadeOut(),a(".currency_options_save").removeAttr("disabled"))}},WCML_Multi_Currency.init()});
|
1 |
+
jQuery(function($){WCML_Multi_Currency={_currency_languages_saving:0,init:function(){$(document).ready(function(){WCML_Multi_Currency.setup_multi_currency_toggle();$(document).on("change",".currency_code select",WCML_Multi_Currency.select_currency);$(document).on("click",".delete_currency",WCML_Multi_Currency.delete_currency);$(document).on("click",".wcml_currency_options .currency_options_save",WCML_Multi_Currency.save_currency);$(document).on("click",".js-display-tooltip",WCML_Multi_Currency.tooltip);$(document).on("click",".currency_languages a.otgs-ico-no",WCML_Multi_Currency.enable_currency_for_language);$(document).on("click",".currency_languages a.otgs-ico-yes",WCML_Multi_Currency.disable_currency_for_language);$(document).on("change",".default_currency select",WCML_Multi_Currency.change_default_currency);WCML_Multi_Currency.setup_currencies_sorting();$(document).on("change",".currency_option_position",WCML_Multi_Currency.price_preview);$(document).on("change",".currency_option_thousand_sep",WCML_Multi_Currency.price_preview);$(document).on("change",".currency_option_decimal_sep",WCML_Multi_Currency.price_preview);$(document).on("change",".currency_option_decimals",WCML_Multi_Currency.price_preview);$(document).on("change",".currency_code select",WCML_Multi_Currency.price_preview);$(document).on("keyup",".wcml-exchange-rate",WCML_Multi_Currency.exchange_rate_check);if($("#wcml_mc_options").length){WCML_Multi_Currency.wcml_mc_form_submitted=false;WCML_Multi_Currency.read_form_fields_status();window.onbeforeunload=function(e){if(!WCML_Multi_Currency.wcml_mc_form_submitted&&WCML_Multi_Currency.form_fields_changed()||WCML_Multi_Currency.is_update_currency_lang_in_progress()){return $("#wcml_warn_message").val()}};$("#wcml_mc_options").on("submit",function(){WCML_Multi_Currency.wcml_mc_form_submitted=true})}})},setup_multi_currency_toggle:function(){$("#multi_currency_independent").change(function(){if($(this).attr("checked")=="checked"){$("#currency-switcher, #currency-switcher-widget, #currency-switcher-product, #multi-currency-per-language-details, #online-exchange-rates").fadeIn()}else{$("#currency-switcher, #currency-switcher-widget, #currency-switcher-product, #multi-currency-per-language-details, #online-exchange-rates").fadeOut()}})},select_currency:function(){var parent=$(this).closest(".wcml_currency_options");var close_button=parent.find(".wcml-dialog-close-button");close_button.attr("data-currency",$(this).val());close_button.attr("data-symbol",$(this).find("option:selected").attr("data-symbol"));parent.find(".this-currency").html($(this).val())},delete_currency:function(e){e.preventDefault();var is_return=false;var currency=$(this).data("currency");var currency_name=$(this).data("currency_name");var currency_symbol=$(this).data("currency_symbol");$(".currency_lang_table .wcml-row-currency-lang:first .currency_languages").each(function(){if(!WCML_Multi_Currency.check_currency_language($(this).find("li").data("lang"),currency)){is_return=true;return false}});if(is_return){return}$("#currency_row_"+currency+" .currency_action_update").hide();var ajaxLoader=$('<span class="spinner" style="visibility: visible;margin:0;">');$(this).hide();$(this).parent().append(ajaxLoader).show();$.ajax({type:"post",url:ajaxurl,data:{action:"wcml_delete_currency",wcml_nonce:$("#del_currency_nonce").val(),code:currency},success:function(response){$("#currency_row_"+currency).remove();$("#currency_row_langs_"+currency).remove();$("#currency_row_del_"+currency).remove();$("#wcml_currencies_order .wcml_currencies_order_"+currency).remove();$("#wcml_currency_options_code_").prepend('<option data-symbol="'+currency_symbol+'" value="'+currency+'">'+currency_name+"</option>");$("#wcml_currency_options_code_").val(currency).trigger("change");$("#currency-lang-table").find("tr.default_currency select").each(function(){$(this).find("option[value='"+currency+"']").remove()});$(".wcml-ui-dialog").each(function(){WCML_Currency_Switcher_Settings.currency_switcher_preview($(this))});if($(".wcml-row-currency").length==1){$("#online-exchange-rates-no-currencies").next().hide();$("#online-exchange-rates-no-currencies").show()}},done:function(){ajaxLoader.remove()}});return false},save_currency:function(){var parent=$(this).closest(".wcml-dialog-container");var chk_deci=WCML_Multi_Currency.check_on_numeric(parent,".currency_option_decimals");var chk_autosub=WCML_Multi_Currency.check_on_numeric(parent,".abstract_amount");if(chk_deci||chk_autosub){return false}$(".wcml-currency-options-dialog :submit, .wcml-currency-options-dialog :button").prop("disabled",true);var currency=parent.find('[name="currency_options[code]"]').val();var ajaxLoader=$('<span class="spinner" style="visibility:visible;position:absolute;margin-left:10px;"></span>');ajaxLoader.show();$(this).parent().prepend(ajaxLoader);$.ajax({url:ajaxurl,type:"POST",dataType:"json",data:parent.find('[name^="currency_options"]').serialize()+"&action=wcml_save_currency&wcml_nonce="+jQuery("#wcml_save_currency_nonce").val(),success:function(response){parent.find(".wcml-dialog-close-button").trigger("click");$(".wcml-ui-dialog").each(function(){WCML_Currency_Switcher_Settings.currency_switcher_preview($(this))});if($("#currency_row_"+currency).length==0){var tr=$("#currency-table tr.wcml-row-currency:last").clone();tr.attr("id","currency_row_"+currency);var edit_link=tr.find(".wcml-col-edit a");edit_link.attr("data-content","wcml_currency_options_"+currency);edit_link.attr("data-currency",currency);edit_link.data("dialog","wcml_currency_options_"+currency);edit_link.removeClass("hidden");$("#currency-table").find("tr.default_currency").before(tr);var tr=$(".empty-currency-language-row").clone();tr.attr("id","currency_row_langs_"+currency);$("#currency-lang-table").find("tr.default_currency").before(tr);tr.removeClass("hidden empty-currency-language-row");tr.find(".on a").each(function(){$(this).attr("data-currency",currency);$(this).attr("title",$(this).attr("title").replace("%code%",response.currency_name));$(this).attr("data-title-alt",$(this).attr("data-title-alt").replace("%code%",response.currency_name))});$("#currency-lang-table").find("tr.default_currency select").each(function(){$(this).append('<option value="'+currency+'">'+currency+"</option>")});$("#wcml_currencies_order").append('<li class="wcml_currencies_order_'+currency+' ui-sortable-handle" cur="'+currency+'">'+response.currency_name_formatted+"</li>");var tr=$("#currency-delete-table tr.wcml-row-currency-del:last").clone();tr.attr("id","currency_row_del_"+currency);var del_link=tr.find(".delete_currency");del_link.removeClass("hidden");del_link.attr("data-currency",currency);del_link.attr("data-currency_name",response.currency_name);del_link.attr("data-currency_symbol",response.currency_symbol);$("#currency-delete-table").find("tr.default_currency").before(tr)}$("#currency_row_"+currency+" .wcml-col-currency").html(response.currency_name_formatted);$("#currency_row_"+currency+" .wcml-col-rate").html(response.currency_meta_info);$("#wcml_currency_options_"+currency).remove();$("#wcml_mc_options").before(response.currency_options);$('#wcml_currency_options_code_ option[value="'+currency+'"]').remove();if($("#online-exchange-rates-no-currencies").is(":visible")){$("#online-exchange-rates-no-currencies").hide();$("#online-exchange-rates-no-currencies").next().show()}}});return false},check_on_numeric:function(parent,elem){var messageContainer=$('<span class="wcml-error">');if(!WCML_Multi_Currency.is_number(parent.find(elem).val())){if(parent.find(elem).parent().find(".wcml-error").size()==0){parent.find(elem).parent().append(messageContainer);messageContainer.text(parent.find(elem).data("message"))}return true}else{if(parent.find(elem).parent().find(".wcml-error").size()>0){parent.find(elem).parent().find(".wcml-error").remove()}return false}},tooltip:function(){var $thiz=$(this);$(".wp-pointer").fadeOut(100);$(this).pointer({content:"<h3>"+$thiz.data("header")+"</h3><p>"+$thiz.data("content")+"</p>",position:{edge:"left",align:"center",offset:"15 0"}}).pointer("open")},enable_currency_for_language:function(e){if(WCML_Multi_Currency.is_update_currency_lang_in_progress())return false;e.preventDefault();$(this).addClass("spinner").removeClass("otgs-ico-no").css("visibility","visible");var index=$(this).closest("tr")[0].rowIndex;$('.default_currency select[rel="'+$(this).data("language")+'"]').append('<option value="'+$(this).data("currency")+'">'+$(this).data("currency")+"</option>");WCML_Multi_Currency.update_currency_lang($(this),1,0);var title_alt=$(this).data("title-alt");$(this).data("title-alt",$(this).attr("title"));$(this).attr("title",title_alt)},disable_currency_for_language:function(e){if(WCML_Multi_Currency.is_update_currency_lang_in_progress())return false;e.preventDefault();$(this).addClass("spinner").removeClass("otgs-ico-yes").css("visibility","visible");var lang=$(this).data("language");if(!WCML_Multi_Currency.check_currency_language(lang)){$(this).removeClass("spinner").addClass("otgs-ico-yes");return}var index=$(this).closest("tr")[0].rowIndex;if($('.currency_languages select[rel="'+$(this).data("language")+'"]').val()==$(this).data("currency")){WCML_Multi_Currency.update_currency_lang($(this),0,1)}else{WCML_Multi_Currency.update_currency_lang($(this),0,0)}$('.default_currency select[rel="'+$(this).data("language")+'"] option[value="'+$(this).data("currency")+'"]').remove();var title_alt=$(this).data("title-alt");$(this).data("title-alt",$(this).attr("title"));$(this).attr("title",title_alt)},check_currency_language:function(lang,currency){var elem=$('#currency-lang-table a.otgs-ico-yes[data-language="'+lang+'"]');if(currency){elem=$('#currency-lang-table a.otgs-ico-yes[data-language="'+lang+'"]').not($('[data-currency="'+currency+'"]'))}if(elem.length==0){alert($("#wcml_warn_disable_language_massage").val());return false}return true},is_update_currency_lang_in_progress:function(){var is=typeof WCML_Multi_Currency._update_currency_lang_sync_flag!="undefined"&&WCML_Multi_Currency._update_currency_lang_sync_flag==1;return is},set_update_currency_lang_in_progress:function(val){WCML_Multi_Currency._update_currency_lang_sync_flag=val},update_currency_lang:function(elem,value,upd_def){WCML_Multi_Currency._currency_languages_saving++;$("#wcml_mc_options :submit").attr("disabled","disabled");$('input[name="wcml_mc_options"]').attr("disabled","disabled");var lang=elem.data("language");var code=elem.data("currency");discard=true;WCML_Multi_Currency.set_update_currency_lang_in_progress(1);$.ajax({type:"post",url:ajaxurl,data:{action:"wcml_update_currency_lang",value:value,lang:lang,code:code,wcml_nonce:$("#update_currency_lang_nonce").val()},success:function(){if(upd_def){WCML_Multi_Currency.update_default_currency(lang,0)}},complete:function(){$('input[name="wcml_mc_options"]').removeAttr("disabled");discard=false;elem.removeClass("spinner").css("visibility","visible");if(value){elem.addClass("otgs-ico-yes")}else{elem.addClass("otgs-ico-no")}WCML_Multi_Currency._currency_languages_saving--;if(WCML_Multi_Currency._currency_languages_saving==0){$("#wcml_mc_options :submit").removeAttr("disabled")}WCML_Multi_Currency.set_update_currency_lang_in_progress(0)}})},change_default_currency:function(){WCML_Multi_Currency.update_default_currency($(this).attr("rel"),$(this).val(),$(this))},update_default_currency:function(lang,code,select){$("#wcml_mc_options_submit").attr("disabled","disabled");if(select){var ajaxLoader=$('<span class="spinner" style="visibility: visible;float:none;position: absolute">');select.parent().append(ajaxLoader)}discard=true;$.ajax({type:"post",url:ajaxurl,data:{action:"wcml_update_default_currency",lang:lang,code:code,wcml_nonce:$("#wcml_update_default_currency_nonce").val()},complete:function(){discard=false;$("#wcml_mc_options_submit").removeAttr("disabled");if(select){select.parent().find(".spinner").remove()}}})},is_number:function(n){return!isNaN(parseFloat(n))&&isFinite(n)},setup_currencies_sorting:function(){$("#wcml_currencies_order").sortable({update:function(){var currencies_order=[];$("#wcml_currencies_order").find("li").each(function(){currencies_order.push($(this).attr("cur"))});$.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"wcml_currencies_order",wcml_nonce:$("#wcml_currencies_order_order_nonce").val(),order:currencies_order.join(";")},success:function(resp){if(resp.success){fadeInAjxResp(".wcml_currencies_order_ajx_resp",resp.data.message);$(".wcml-ui-dialog").each(function(){WCML_Currency_Switcher_Settings.currency_switcher_preview($(this))})}}})}})},price_preview:function(){var parent=$(this).closest(".wcml_currency_options");var position=parent.find(".currency_option_position").val();var thousand_sep=parent.find(".currency_option_thousand_sep").val();var thousand_sep=parent.find(".currency_option_thousand_sep").val();var decimal_sep=parent.find(".currency_option_decimal_sep").val();var symbol=$(this).closest(".wcml_currency_options").find(".wcml-dialog-close-button").attr("data-symbol");var decimals="56789".substr(0,parent.find(".currency_option_decimals").val());if(decimals==""){decimal_sep=""}var format="";switch(position){case"left":format="{symbol}1{thousand_sep}234{decimal_sep}{decimals}";break;case"right":format="1{thousand_sep}234{decimal_sep}{decimals}{symbol}";break;case"left_space":format="{symbol} 1{thousand_sep}234{decimal_sep}{decimals}";break;case"right_space":format="1{thousand_sep}234{decimal_sep}{decimals} {symbol}";break}var preview=format.replace(/\{symbol\}/,symbol).replace(/\{thousand_sep\}/,thousand_sep).replace(/\{decimal_sep\}/,decimal_sep).replace(/\{decimals\}/,decimals);parent.find(".wcml-co-preview-value").html(preview);return false},read_form_fields_status:function(){this.mc_form_status=$("#wcml_mc_options").serialize()},form_fields_changed:function(){return this.mc_form_status!=$("#wcml_mc_options").serialize()},exchange_rate_check:function(e){if(typeof KeyEvent=="undefined"){var KeyEvent={DOM_SUBTRACT:109,DOM_DASH:189,DOM_E:69}}if($(this).val()<=0||!WCML_Multi_Currency.is_number($(this).val())||e.keyCode==KeyEvent.DOM_SUBTRACT||e.keyCode==KeyEvent.DOM_DASH||e.keyCode==KeyEvent.DOM_E){$(".wcml-co-set-rate .wcml-error").fadeIn();$(".currency_options_save").attr("disabled","disabled")}else{$(".wcml-co-set-rate .wcml-error").fadeOut();$(".currency_options_save").removeAttr("disabled")}}};WCML_Multi_Currency.init()});
|
res/js/troubleshooting.js
CHANGED
@@ -82,6 +82,35 @@ jQuery( function($) {
|
|
82 |
});
|
83 |
},
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
sync_product_categories: function(){
|
86 |
jQuery.ajax({
|
87 |
type : "post",
|
@@ -179,7 +208,9 @@ jQuery( function($) {
|
|
179 |
run_next_troubleshooting_action: function(){
|
180 |
if(jQuery('#wcml_sync_product_variations').is(':checked') && parseInt( jQuery('#count_prod_variat').val() ) !== 0 ){
|
181 |
WCML_Troubleshooting.sync_variations();
|
182 |
-
|
|
|
|
|
183 |
WCML_Troubleshooting.sync_product_categories();
|
184 |
}else if(jQuery('#wcml_duplicate_terms').is(':checked') && parseInt( jQuery('#count_terms').val() ) !== 0 ){
|
185 |
WCML_Troubleshooting.duplicate_terms();
|
82 |
});
|
83 |
},
|
84 |
|
85 |
+
sync_product_gallery: function(){
|
86 |
+
jQuery.ajax({
|
87 |
+
type : "post",
|
88 |
+
url : ajaxurl,
|
89 |
+
data : {
|
90 |
+
action: "trbl_gallery_images",
|
91 |
+
wcml_nonce: jQuery('#trbl_gallery_images_nonce').val(),
|
92 |
+
page: jQuery('#sync_galerry_page').val()
|
93 |
+
},
|
94 |
+
dataType: 'json',
|
95 |
+
success: function(response) {
|
96 |
+
if(jQuery('#count_galleries').val() == 0){
|
97 |
+
WCML_Troubleshooting.run_next_troubleshooting_action();
|
98 |
+
jQuery('.gallery_status').html(0);
|
99 |
+
}else{
|
100 |
+
var left = jQuery('#count_galleries').val()-5;
|
101 |
+
if(left < 0 ){
|
102 |
+
left = 0;
|
103 |
+
}else{
|
104 |
+
jQuery('#sync_galerry_page').val(parseInt(jQuery('#sync_galerry_page').val())+1)
|
105 |
+
}
|
106 |
+
jQuery('.gallery_status').html(left);
|
107 |
+
jQuery('#count_galleries').val(left);
|
108 |
+
WCML_Troubleshooting.sync_product_gallery();
|
109 |
+
}
|
110 |
+
}
|
111 |
+
});
|
112 |
+
},
|
113 |
+
|
114 |
sync_product_categories: function(){
|
115 |
jQuery.ajax({
|
116 |
type : "post",
|
208 |
run_next_troubleshooting_action: function(){
|
209 |
if(jQuery('#wcml_sync_product_variations').is(':checked') && parseInt( jQuery('#count_prod_variat').val() ) !== 0 ){
|
210 |
WCML_Troubleshooting.sync_variations();
|
211 |
+
}else if(jQuery('#wcml_sync_gallery_images').is(':checked') && parseInt( jQuery('#count_galleries').val() ) !== 0 ){
|
212 |
+
WCML_Troubleshooting.sync_product_gallery();
|
213 |
+
}else if(jQuery('#wcml_sync_categories').is(':checked') && parseInt( jQuery('#count_categories').val() ) !== 0 ){
|
214 |
WCML_Troubleshooting.sync_product_categories();
|
215 |
}else if(jQuery('#wcml_duplicate_terms').is(':checked') && parseInt( jQuery('#count_terms').val() ) !== 0 ){
|
216 |
WCML_Troubleshooting.duplicate_terms();
|
res/js/troubleshooting.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function(
|
1 |
+
jQuery(function($){WCML_Troubleshooting={init:function(){$(document).ready(function(){jQuery("#wcml_trbl").on("click",function(){var field=jQuery(this);field.attr("disabled","disabled");jQuery(".spinner").css("display","inline-block").css("visibility","visible");if(jQuery("#wcml_sync_update_product_count").is(":checked")){WCML_Troubleshooting.update_product_count()}else{WCML_Troubleshooting.run_next_troubleshooting_action()}});jQuery("#attr_to_duplicate").on("change",function(){jQuery(".attr_status").html(jQuery(this).find("option:selected").attr("rel"));jQuery("#count_terms").val(jQuery(this).find("option:selected").attr("rel"))});jQuery("#wcml_product_type_trbl").on("click",function(){var field=jQuery(this);field.attr("disabled","disabled");jQuery(".product_type_spinner").css("display","inline-block").css("visibility","visible");WCML_Troubleshooting.fix_product_type_terms()})})},update_product_count:function(){jQuery.ajax({type:"post",url:ajaxurl,data:{action:"trbl_update_count",wcml_nonce:jQuery("#trbl_update_count_nonce").val()},dataType:"json",success:function(response){jQuery(".var_status").each(function(){jQuery(this).html(response.data.count)});jQuery("#count_prod_variat").val(response.data.count);WCML_Troubleshooting.run_next_troubleshooting_action()}})},sync_variations:function(){jQuery.ajax({type:"post",url:ajaxurl,data:{action:"trbl_sync_variations",wcml_nonce:jQuery("#trbl_sync_variations_nonce").val()},dataType:"json",success:function(response){if(jQuery("#count_prod_variat").val()==0){jQuery(".var_status").each(function(){jQuery(this).html(0)});WCML_Troubleshooting.run_next_troubleshooting_action()}else{var left=jQuery("#count_prod_variat").val()-3;if(left<0){left=0}jQuery(".var_status").each(function(){jQuery(this).html(left)});jQuery("#count_prod_variat").val(left);WCML_Troubleshooting.sync_variations()}}})},sync_product_gallery:function(){jQuery.ajax({type:"post",url:ajaxurl,data:{action:"trbl_gallery_images",wcml_nonce:jQuery("#trbl_gallery_images_nonce").val(),page:jQuery("#sync_galerry_page").val()},dataType:"json",success:function(response){if(jQuery("#count_galleries").val()==0){WCML_Troubleshooting.run_next_troubleshooting_action();jQuery(".gallery_status").html(0)}else{var left=jQuery("#count_galleries").val()-5;if(left<0){left=0}else{jQuery("#sync_galerry_page").val(parseInt(jQuery("#sync_galerry_page").val())+1)}jQuery(".gallery_status").html(left);jQuery("#count_galleries").val(left);WCML_Troubleshooting.sync_product_gallery()}}})},sync_product_categories:function(){jQuery.ajax({type:"post",url:ajaxurl,data:{action:"trbl_sync_categories",wcml_nonce:jQuery("#trbl_sync_categories_nonce").val(),page:jQuery("#sync_category_page").val()},success:function(response){if(jQuery("#count_categories").val()==0){WCML_Troubleshooting.run_next_troubleshooting_action();jQuery(".cat_status").html(0)}else{var left=jQuery("#count_categories").val()-5;if(left<0){left=0}else{jQuery("#sync_category_page").val(parseInt(jQuery("#sync_category_page").val())+1)}jQuery(".cat_status").html(left);jQuery("#count_categories").val(left);WCML_Troubleshooting.sync_product_categories()}}})},duplicate_terms:function(){jQuery.ajax({type:"post",url:ajaxurl,data:{action:"trbl_duplicate_terms",wcml_nonce:jQuery("#trbl_duplicate_terms_nonce").val(),attr:jQuery("#attr_to_duplicate option:selected").val()},dataType:"json",success:function(response){if(jQuery("#count_terms").val()==0){WCML_Troubleshooting.run_next_troubleshooting_action();jQuery(".attr_status").html(0)}else{var left=jQuery("#count_terms").val()-5;if(left<0){left=0}jQuery(".attr_status").html(left);jQuery("#count_terms").val(left);WCML_Troubleshooting.duplicate_terms()}}})},sync_stock:function(){jQuery.ajax({type:"post",url:ajaxurl,data:{action:"trbl_sync_stock",wcml_nonce:jQuery("#trbl_sync_stock_nonce").val()},dataType:"json",success:function(response){jQuery("#count_stock").val(0);WCML_Troubleshooting.run_next_troubleshooting_action();jQuery(".stock_status").html(0)}})},fix_product_type_terms:function(){jQuery.ajax({type:"post",url:ajaxurl,data:{action:"trbl_fix_product_type_terms",wcml_nonce:jQuery("#trbl_product_type_terms_nonce").val()},dataType:"json",success:function(response){jQuery("#wcml_product_type_trbl").removeAttr("disabled");jQuery(".product_type_spinner").hide();jQuery(".product_type_fix_done").show();setTimeout(function(){jQuery(".product_type_fix_done").fadeOut(300)},2e3)}})},run_next_troubleshooting_action:function(){if(jQuery("#wcml_sync_product_variations").is(":checked")&&parseInt(jQuery("#count_prod_variat").val())!==0){WCML_Troubleshooting.sync_variations()}else if(jQuery("#wcml_sync_gallery_images").is(":checked")&&parseInt(jQuery("#count_galleries").val())!==0){WCML_Troubleshooting.sync_product_gallery()}else if(jQuery("#wcml_sync_categories").is(":checked")&&parseInt(jQuery("#count_categories").val())!==0){WCML_Troubleshooting.sync_product_categories()}else if(jQuery("#wcml_duplicate_terms").is(":checked")&&parseInt(jQuery("#count_terms").val())!==0){WCML_Troubleshooting.duplicate_terms()}else if(jQuery("#wcml_sync_stock").is(":checked")&&parseInt(jQuery("#count_stock").val())!==0){WCML_Troubleshooting.sync_stock()}else{jQuery("#wcml_trbl").removeAttr("disabled");jQuery(".spinner").hide();jQuery("#wcml_trbl").next().fadeOut()}}};WCML_Troubleshooting.init()});
|
templates/multi-currency/multi-currency.twig
CHANGED
@@ -167,6 +167,21 @@
|
|
167 |
</tr>
|
168 |
{% endfor %}
|
169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
<tr class="default_currency">
|
171 |
{% for language in active_languages %}
|
172 |
<td align="center">
|
167 |
</tr>
|
168 |
{% endfor %}
|
169 |
|
170 |
+
<tr class="wcml-row-currency-lang empty-currency-language-row hidden">
|
171 |
+
{% for language in active_languages %}
|
172 |
+
<td class="currency_languages">
|
173 |
+
<ul>
|
174 |
+
<li class="on" data-lang="{{ language.code }}">
|
175 |
+
<a class="otgs-ico-yes"
|
176 |
+
data-language="{{ language.code }}" data-currency="" href="#"
|
177 |
+
title="{{ strings.currencies_table.disable_for|format( '%code%', language.display_name ) }}"
|
178 |
+
data-title-alt="{{ strings.currencies_table.enable_for|format( '%code%', language.display_name ) }}"></a>
|
179 |
+
</li>
|
180 |
+
</ul>
|
181 |
+
</td>
|
182 |
+
{% endfor %}
|
183 |
+
</tr>
|
184 |
+
|
185 |
<tr class="default_currency">
|
186 |
{% for language in active_languages %}
|
187 |
<td align="center">
|
templates/troubleshooting.twig
CHANGED
@@ -23,6 +23,14 @@
|
|
23 |
</label>
|
24 |
|
25 |
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
<li>
|
27 |
<label>
|
28 |
<input type="checkbox" id="wcml_sync_categories" />
|
@@ -78,6 +86,7 @@
|
|
78 |
<span class="spinner"></span>
|
79 |
{{ nonces.trbl_update_count|raw }}
|
80 |
{{ nonces.trbl_sync_variations|raw }}
|
|
|
81 |
{{ nonces.trbl_sync_categories|raw }}
|
82 |
{{ nonces.trbl_duplicate_terms|raw }}
|
83 |
{{ nonces.trbl_sync_stock|raw }}
|
23 |
</label>
|
24 |
|
25 |
</li>
|
26 |
+
<li>
|
27 |
+
<label>
|
28 |
+
<input type="checkbox" id="wcml_sync_gallery_images" />
|
29 |
+
{{ strings.sync_gallery }}
|
30 |
+
<span class="gallery_status">{{ prod_count }}</span>
|
31 |
+
<span>{{ strings.left }}</span>
|
32 |
+
</label>
|
33 |
+
</li>
|
34 |
<li>
|
35 |
<label>
|
36 |
<input type="checkbox" id="wcml_sync_categories" />
|
86 |
<span class="spinner"></span>
|
87 |
{{ nonces.trbl_update_count|raw }}
|
88 |
{{ nonces.trbl_sync_variations|raw }}
|
89 |
+
{{ nonces.trbl_gallery_images|raw }}
|
90 |
{{ nonces.trbl_sync_categories|raw }}
|
91 |
{{ nonces.trbl_duplicate_terms|raw }}
|
92 |
{{ nonces.trbl_sync_stock|raw }}
|
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 ComposerAutoloaderInitb9a53d5d5db12fb6de70bc70d2bfd455::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 ComposerAutoloaderInit953a92a3b6852d9006796ec863f6f9d3::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 ComposerAutoloaderInit8f42e1912b73b45aa1e030d7895bd05b
|
|
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) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInitb9a53d5d5db12fb6de70bc70d2bfd455
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInitb9a53d5d5db12fb6de70bc70d2bfd455', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInitb9a53d5d5db12fb6de70bc70d2bfd455', '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\ComposerStaticInitb9a53d5d5db12fb6de70bc70d2bfd455::getInitializer($loader));
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
vendor/composer/autoload_real_52.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real_52.php generated by xrstf/composer-php52
|
4 |
|
5 |
-
class
|
6 |
private static $loader;
|
7 |
|
8 |
public static function loadClassLoader($class) {
|
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit1952fc2ab7f7cf82da6f0ced1b320c56 {
|
|
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 ComposerAutoloaderInit953a92a3b6852d9006796ec863f6f9d3 {
|
6 |
private static $loader;
|
7 |
|
8 |
public static function loadClassLoader($class) {
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInit953a92a3b6852d9006796ec863f6f9d3', 'loadClassLoader'), true /*, true */);
|
23 |
self::$loader = $loader = new xrstf_Composer52_ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit953a92a3b6852d9006796ec863f6f9d3', '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 $prefixLengthsPsr4 = array (
|
10 |
'C' =>
|
@@ -515,10 +515,10 @@ class ComposerStaticInit8f42e1912b73b45aa1e030d7895bd05b
|
|
515 |
public static function getInitializer(ClassLoader $loader)
|
516 |
{
|
517 |
return \Closure::bind(function () use ($loader) {
|
518 |
-
$loader->prefixLengthsPsr4 =
|
519 |
-
$loader->prefixDirsPsr4 =
|
520 |
-
$loader->prefixesPsr0 =
|
521 |
-
$loader->classMap =
|
522 |
|
523 |
}, null, ClassLoader::class);
|
524 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInitb9a53d5d5db12fb6de70bc70d2bfd455
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'C' =>
|
515 |
public static function getInitializer(ClassLoader $loader)
|
516 |
{
|
517 |
return \Closure::bind(function () use ($loader) {
|
518 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInitb9a53d5d5db12fb6de70bc70d2bfd455::$prefixLengthsPsr4;
|
519 |
+
$loader->prefixDirsPsr4 = ComposerStaticInitb9a53d5d5db12fb6de70bc70d2bfd455::$prefixDirsPsr4;
|
520 |
+
$loader->prefixesPsr0 = ComposerStaticInitb9a53d5d5db12fb6de70bc70d2bfd455::$prefixesPsr0;
|
521 |
+
$loader->classMap = ComposerStaticInitb9a53d5d5db12fb6de70bc70d2bfd455::$classMap;
|
522 |
|
523 |
}, null, ClassLoader::class);
|
524 |
}
|
wpml-woocommerce.php
CHANGED
@@ -8,16 +8,16 @@
|
|
8 |
Text Domain: woocommerce-multilingual
|
9 |
Requires at least: 3.9
|
10 |
Tested up to: 4.9.6
|
11 |
-
Version: 4.3.
|
12 |
WC requires at least: 2.1.0
|
13 |
-
WC tested up to: 3.4.
|
14 |
*/
|
15 |
|
16 |
if ( defined( 'WCML_VERSION' ) ) {
|
17 |
return;
|
18 |
}
|
19 |
|
20 |
-
define( 'WCML_VERSION', '4.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' );
|
@@ -61,13 +61,23 @@ function wcml_loader(){
|
|
61 |
$xdomain_data->add_hooks();
|
62 |
|
63 |
$loaders = array(
|
64 |
-
'
|
65 |
-
'WCML_Product_Gallery_Filter_Factory',
|
66 |
-
'WCML_Update_Product_Gallery_Translation_Factory',
|
67 |
-
'WCML_Append_Gallery_To_Post_Media_Ids_Factory',
|
68 |
-
'WCML_Privacy_Content_Factory',
|
69 |
);
|
70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
$action_filter_loader = new WPML_Action_Filter_Loader();
|
72 |
$action_filter_loader->load( $loaders );
|
73 |
}
|
8 |
Text Domain: woocommerce-multilingual
|
9 |
Requires at least: 3.9
|
10 |
Tested up to: 4.9.6
|
11 |
+
Version: 4.3.3
|
12 |
WC requires at least: 2.1.0
|
13 |
+
WC tested up to: 3.4.3
|
14 |
*/
|
15 |
|
16 |
if ( defined( 'WCML_VERSION' ) ) {
|
17 |
return;
|
18 |
}
|
19 |
|
20 |
+
define( 'WCML_VERSION', '4.3.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' );
|
61 |
$xdomain_data->add_hooks();
|
62 |
|
63 |
$loaders = array(
|
64 |
+
'WCML_Privacy_Content_Factory'
|
|
|
|
|
|
|
|
|
65 |
);
|
66 |
|
67 |
+
if (
|
68 |
+
( defined( 'ICL_SITEPRESS_VERSION' ) && defined( 'WPML_MEDIA_VERSION' ) )
|
69 |
+
|| ( defined( 'ICL_SITEPRESS_VERSION' )
|
70 |
+
&& version_compare( ICL_SITEPRESS_VERSION, '4.0.0', '>=' )
|
71 |
+
&& version_compare( ICL_SITEPRESS_VERSION, '4.0.4', '<' )
|
72 |
+
&& ! defined( 'WPML_MEDIA_VERSION' )
|
73 |
+
)
|
74 |
+
) {
|
75 |
+
$loaders[] = 'WCML_Product_Image_Filter_Factory';
|
76 |
+
$loaders[] = 'WCML_Product_Gallery_Filter_Factory';
|
77 |
+
$loaders[] = 'WCML_Update_Product_Gallery_Translation_Factory';
|
78 |
+
$loaders[] = 'WCML_Append_Gallery_To_Post_Media_Ids_Factory';
|
79 |
+
}
|
80 |
+
|
81 |
$action_filter_loader = new WPML_Action_Filter_Loader();
|
82 |
$action_filter_loader->load( $loaders );
|
83 |
}
|