Version Description
- Fixed more problems related to converting shipping costs in secondary currencies
- Fixed one compatibility problem with WooCommerce Show Single Variations
- Bug fix: product translations were not synchronized correctly when marking an existing product as a translation of another one
- Bug fix: variation names not displayed in tooltips on the orders screen in the backend
- Updated the wpml-config.xml configuration file: copy prices to product translations also when multi-currency is not on
- Other small fixes for the admin interface
Download this release
Release Info
Developer | mihaimihai |
Plugin | WooCommerce Multilingual – run WooCommerce with WPML |
Version | 3.8.5 |
Comparing to | |
See all releases |
Code changes from version 3.8.4 to 3.8.5
- compatibility/class-wcml-jck-wssv.php +24 -0
- compatibility/class-wcml-table-rate-shipping.php +0 -49
- embedded/composer/autoload_classmap.php +1 -0
- embedded/composer/autoload_static.php +1 -0
- inc/class-wcml-compatibility.php +6 -0
- inc/class-wcml-emails.php +8 -5
- inc/class-wcml-terms.php +1 -86
- inc/class-wcml-wc-strings.php +1 -1
- inc/currencies/class-wcml-currencies.php +0 -26
- inc/currencies/class-wcml-currency-switcher.php +11 -1
- inc/currencies/class-wcml-multi-currency-configuration.php +36 -53
- inc/currencies/class-wcml-multi-currency-install.php +5 -2
- inc/currencies/class-wcml-multi-currency-prices.php +11 -5
- inc/currencies/class-wcml-multi-currency-shipping.php +110 -6
- inc/currencies/class-wcml-multi-currency.php +28 -12
- inc/translation-editor/class-wcml-synchronize-product-data.php +48 -0
- readme.txt +10 -2
- res/css/dialogs.css +1 -1
- res/css/management.css +1 -1
- res/css/options-permalink.css +1 -4
- res/css/wcml-setup.css +1 -0
- res/js/multi-currency.js +46 -7
- res/js/multi-currency.min.js +1 -1
- res/scss/management.scss +4 -0
- templates/multi-currency/custom-currency-options.twig +1 -1
- templates/multi-currency/multi-currency.twig +1 -1
- wpml-config.xml +135 -125
- wpml-woocommerce.php +2 -2
compatibility/class-wcml-jck-wssv.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WCML_JCK_WSSV{
|
4 |
+
|
5 |
+
private $transient_name = 'jck_wssv_term_counts';
|
6 |
+
|
7 |
+
public function __construct(){
|
8 |
+
|
9 |
+
add_filter( 'pre_transient_' . $this->transient_name, array( $this, 'get_language_specific_transient' ) );
|
10 |
+
add_filter( 'set_transient_' . $this->transient_name, array( $this, 'set_language_specific_transient' ), 10, 2 );
|
11 |
+
}
|
12 |
+
|
13 |
+
public function get_language_specific_transient(){
|
14 |
+
return get_transient( $this->transient_name . '_' . ICL_LANGUAGE_CODE );
|
15 |
+
}
|
16 |
+
|
17 |
+
public function set_language_specific_transient( $value, $expiration ){
|
18 |
+
|
19 |
+
delete_transient( $this->transient_name );
|
20 |
+
set_transient( $this->transient_name . '_' . ICL_LANGUAGE_CODE, $value, $expiration );
|
21 |
+
|
22 |
+
}
|
23 |
+
|
24 |
+
}
|
compatibility/class-wcml-table-rate-shipping.php
CHANGED
@@ -27,11 +27,6 @@ class WCML_Table_Rate_Shipping {
|
|
27 |
add_action( 'init', array( $this, 'init' ), 9 );
|
28 |
add_filter( 'get_the_terms',array( $this, 'shipping_class_id_in_default_language' ), 10, 3 );
|
29 |
|
30 |
-
if( wcml_is_multi_currency_on() ) {
|
31 |
-
add_filter( 'woocommerce_table_rate_query_rates_args', array( $this, 'default_shipping_class_id' ) );
|
32 |
-
add_filter( 'woocommerce_table_rate_query_rates', array( $this, 'convert_costs' ) );
|
33 |
-
}
|
34 |
-
|
35 |
}
|
36 |
|
37 |
/**
|
@@ -48,25 +43,6 @@ class WCML_Table_Rate_Shipping {
|
|
48 |
}
|
49 |
}
|
50 |
|
51 |
-
/**
|
52 |
-
* @param $args
|
53 |
-
*
|
54 |
-
* @return mixed
|
55 |
-
*/
|
56 |
-
public function default_shipping_class_id( $args ) {
|
57 |
-
if ( ! empty( $args['shipping_class_id'] ) ) {
|
58 |
-
|
59 |
-
$args['shipping_class_id'] = apply_filters( 'translate_object_id', $args['shipping_class_id'], 'product_shipping_class', false, $this->sitepress->get_default_language() );
|
60 |
-
|
61 |
-
if ( WCML_MULTI_CURRENCIES_INDEPENDENT === $this->woocommerce_wpml->settings['enable_multi_currency'] ) {
|
62 |
-
// use unfiltered cart price to compare against limits of different shipping methods
|
63 |
-
$args['price'] = $this->woocommerce_wpml->multi_currency->prices->unconvert_price_amount( $args['price'] );
|
64 |
-
}
|
65 |
-
}
|
66 |
-
|
67 |
-
return $args;
|
68 |
-
}
|
69 |
-
|
70 |
/**
|
71 |
* @param $terms
|
72 |
* @param $post_id
|
@@ -93,29 +69,4 @@ class WCML_Table_Rate_Shipping {
|
|
93 |
return $terms;
|
94 |
}
|
95 |
|
96 |
-
/**
|
97 |
-
* @param $rates
|
98 |
-
* @return mixed
|
99 |
-
*
|
100 |
-
* Converts shipping costs in secondary currencies
|
101 |
-
*/
|
102 |
-
public function convert_costs( $rates ){
|
103 |
-
|
104 |
-
$client_currency = $this->woocommerce_wpml->multi_currency->get_client_currency();
|
105 |
-
|
106 |
-
if( $client_currency != get_option('woocommerce_currency') ){
|
107 |
-
|
108 |
-
$multi_currency_prices = $this->woocommerce_wpml->multi_currency->prices;
|
109 |
-
|
110 |
-
foreach( $rates as $key => $rate ){
|
111 |
-
|
112 |
-
$rates[$key]->rate_cost = $multi_currency_prices->raw_price_filter( $rates[$key]->rate_cost, $client_currency );
|
113 |
-
$rates[$key]->rate_cost_per_item = $multi_currency_prices->raw_price_filter( $rates[$key]->rate_cost_per_item, $client_currency );
|
114 |
-
|
115 |
-
}
|
116 |
-
|
117 |
-
}
|
118 |
-
|
119 |
-
return $rates;
|
120 |
-
}
|
121 |
}
|
27 |
add_action( 'init', array( $this, 'init' ), 9 );
|
28 |
add_filter( 'get_the_terms',array( $this, 'shipping_class_id_in_default_language' ), 10, 3 );
|
29 |
|
|
|
|
|
|
|
|
|
|
|
30 |
}
|
31 |
|
32 |
/**
|
43 |
}
|
44 |
}
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
/**
|
47 |
* @param $terms
|
48 |
* @param $post_id
|
69 |
return $terms;
|
70 |
}
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
}
|
embedded/composer/autoload_classmap.php
CHANGED
@@ -42,6 +42,7 @@ return array(
|
|
42 |
'WCML_Extra_Product_Options' => $baseDir . '/compatibility/class-wcml-extra-product-options.php',
|
43 |
'WCML_Flatsome' => $baseDir . '/compatibility/class-wcml-flatsome.php',
|
44 |
'WCML_Install' => $baseDir . '/inc/class-wcml-install.php',
|
|
|
45 |
'WCML_Languages_Upgrade_Notice' => $baseDir . '/inc/template-classes/class-wcml-languages-upgrade-notice.php',
|
46 |
'WCML_Languages_Upgrader' => $baseDir . '/inc/class-wcml-languages-upgrader.php',
|
47 |
'WCML_Links' => $baseDir . '/inc/admin-menus/class-wcml-links.php',
|
42 |
'WCML_Extra_Product_Options' => $baseDir . '/compatibility/class-wcml-extra-product-options.php',
|
43 |
'WCML_Flatsome' => $baseDir . '/compatibility/class-wcml-flatsome.php',
|
44 |
'WCML_Install' => $baseDir . '/inc/class-wcml-install.php',
|
45 |
+
'WCML_JCK_WSSV' => $baseDir . '/compatibility/class-wcml-jck-wssv.php',
|
46 |
'WCML_Languages_Upgrade_Notice' => $baseDir . '/inc/template-classes/class-wcml-languages-upgrade-notice.php',
|
47 |
'WCML_Languages_Upgrader' => $baseDir . '/inc/class-wcml-languages-upgrader.php',
|
48 |
'WCML_Links' => $baseDir . '/inc/admin-menus/class-wcml-links.php',
|
embedded/composer/autoload_static.php
CHANGED
@@ -67,6 +67,7 @@ class ComposerStaticInit00dcbeb0e1eb354a5d439568c0e22365
|
|
67 |
'WCML_Extra_Product_Options' => __DIR__ . '/../..' . '/compatibility/class-wcml-extra-product-options.php',
|
68 |
'WCML_Flatsome' => __DIR__ . '/../..' . '/compatibility/class-wcml-flatsome.php',
|
69 |
'WCML_Install' => __DIR__ . '/../..' . '/inc/class-wcml-install.php',
|
|
|
70 |
'WCML_Languages_Upgrade_Notice' => __DIR__ . '/../..' . '/inc/template-classes/class-wcml-languages-upgrade-notice.php',
|
71 |
'WCML_Languages_Upgrader' => __DIR__ . '/../..' . '/inc/class-wcml-languages-upgrader.php',
|
72 |
'WCML_Links' => __DIR__ . '/../..' . '/inc/admin-menus/class-wcml-links.php',
|
67 |
'WCML_Extra_Product_Options' => __DIR__ . '/../..' . '/compatibility/class-wcml-extra-product-options.php',
|
68 |
'WCML_Flatsome' => __DIR__ . '/../..' . '/compatibility/class-wcml-flatsome.php',
|
69 |
'WCML_Install' => __DIR__ . '/../..' . '/inc/class-wcml-install.php',
|
70 |
+
'WCML_JCK_WSSV' => __DIR__ . '/../..' . '/compatibility/class-wcml-jck-wssv.php',
|
71 |
'WCML_Languages_Upgrade_Notice' => __DIR__ . '/../..' . '/inc/template-classes/class-wcml-languages-upgrade-notice.php',
|
72 |
'WCML_Languages_Upgrader' => __DIR__ . '/../..' . '/inc/class-wcml-languages-upgrader.php',
|
73 |
'WCML_Links' => __DIR__ . '/../..' . '/inc/admin-menus/class-wcml-links.php',
|
inc/class-wcml-compatibility.php
CHANGED
@@ -160,6 +160,12 @@ class WCML_Compatibility {
|
|
160 |
$this->vpc = new WCML_Vpc();
|
161 |
}
|
162 |
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
}
|
164 |
|
165 |
}
|
160 |
$this->vpc = new WCML_Vpc();
|
161 |
}
|
162 |
|
163 |
+
// WooCommerce Show Single Variations
|
164 |
+
if( defined( 'JCK_WSSV_PATH' ) ){
|
165 |
+
new WCML_JCK_WSSV();
|
166 |
+
}
|
167 |
+
|
168 |
+
|
169 |
}
|
170 |
|
171 |
}
|
inc/class-wcml-emails.php
CHANGED
@@ -63,8 +63,11 @@ class WCML_Emails{
|
|
63 |
}
|
64 |
|
65 |
add_filter( 'get_post_metadata', array( $this, 'filter_payment_method_string' ), 10, 4 );
|
66 |
-
|
67 |
-
|
|
|
|
|
|
|
68 |
}
|
69 |
|
70 |
function email_refresh_in_ajax(){
|
@@ -278,7 +281,7 @@ class WCML_Emails{
|
|
278 |
|
279 |
function filter_formatted_items( $formatted_meta, $object ){
|
280 |
|
281 |
-
if(
|
282 |
|
283 |
$current_prod_variation_id = apply_filters( 'translate_object_id', $object->product->variation_id, 'product_variation', false );
|
284 |
|
@@ -420,7 +423,7 @@ class WCML_Emails{
|
|
420 |
$section_name = str_replace( '_settings', '', $section_name );
|
421 |
if( isset( $_GET['section'] ) && $_GET['section'] == $section_name ){
|
422 |
|
423 |
-
$option_settings = get_option($emails_option);
|
424 |
foreach ($option_settings as $setting_key => $setting_value) {
|
425 |
if ( in_array( $setting_key, $text_keys ) ) {
|
426 |
$input_name = str_replace( '_settings', '', $emails_option ).'_'.$setting_key;
|
@@ -448,7 +451,7 @@ class WCML_Emails{
|
|
448 |
if (input.length) {
|
449 |
input.parent().append('<div class="translation_controls"></div>');
|
450 |
input.parent().find('.translation_controls').append('<a href="<?php echo $st_page ?>" style="margin-left: 10px"><?php _e('translations', 'woocommerce-multilingual') ?></a>');
|
451 |
-
jQuery('#<?php echo $emails_option.'_'.$setting_key.'_language_selector' ?>').
|
452 |
}
|
453 |
</script>
|
454 |
<?php }
|
63 |
}
|
64 |
|
65 |
add_filter( 'get_post_metadata', array( $this, 'filter_payment_method_string' ), 10, 4 );
|
66 |
+
|
67 |
+
if( !isset( $_GET['post_type'] ) || $_GET['post_type'] != 'shop_order' ){
|
68 |
+
add_filter( 'woocommerce_order_get_items', array( $this, 'filter_order_items' ), 10, 2 );
|
69 |
+
add_filter( 'woocommerce_order_items_meta_get_formatted', array( $this, 'filter_formatted_items' ), 10, 2 );
|
70 |
+
}
|
71 |
}
|
72 |
|
73 |
function email_refresh_in_ajax(){
|
281 |
|
282 |
function filter_formatted_items( $formatted_meta, $object ){
|
283 |
|
284 |
+
if( $object->product->variation_id ){
|
285 |
|
286 |
$current_prod_variation_id = apply_filters( 'translate_object_id', $object->product->variation_id, 'product_variation', false );
|
287 |
|
423 |
$section_name = str_replace( '_settings', '', $section_name );
|
424 |
if( isset( $_GET['section'] ) && $_GET['section'] == $section_name ){
|
425 |
|
426 |
+
$option_settings = get_option( $emails_option );
|
427 |
foreach ($option_settings as $setting_key => $setting_value) {
|
428 |
if ( in_array( $setting_key, $text_keys ) ) {
|
429 |
$input_name = str_replace( '_settings', '', $emails_option ).'_'.$setting_key;
|
451 |
if (input.length) {
|
452 |
input.parent().append('<div class="translation_controls"></div>');
|
453 |
input.parent().find('.translation_controls').append('<a href="<?php echo $st_page ?>" style="margin-left: 10px"><?php _e('translations', 'woocommerce-multilingual') ?></a>');
|
454 |
+
jQuery('#<?php echo $emails_option.'_'.$setting_key.'_language_selector' ?>').prependTo(input.parent().find('.translation_controls'));
|
455 |
}
|
456 |
</script>
|
457 |
<?php }
|
inc/class-wcml-terms.php
CHANGED
@@ -29,13 +29,7 @@ class WCML_Terms{
|
|
29 |
|
30 |
add_action('created_term', array( $this, 'set_flag_for_variation_on_attribute_update'), 10, 3);
|
31 |
|
32 |
-
|
33 |
-
// Backward compatibillity for WPML <= 3.1.8.2
|
34 |
-
add_action('wpml_taxonomy_translation_bottom', array( $this, 'show_variations_sync_button'), 10, 1);
|
35 |
-
add_filter('wpml_taxonomy_show_tax_sync_button', array( $this, 'hide_tax_sync_button_for_attributes'));
|
36 |
-
}else{
|
37 |
-
add_filter('wpml_taxonomy_translation_bottom', array( $this, 'sync_taxonomy_translations'), 10, 3 );
|
38 |
-
}
|
39 |
|
40 |
add_action('wp_ajax_wcml_sync_product_variations', array( $this, 'wcml_sync_product_variations'));
|
41 |
add_action('wp_ajax_wcml_tt_sync_taxonomies_in_content', array( $this, 'wcml_sync_taxonomies_in_content'));
|
@@ -270,14 +264,6 @@ class WCML_Terms{
|
|
270 |
|
271 |
if( in_array( $taxonomy, $attribute_taxonomies_arr ) ) {
|
272 |
$ret['show_button'] = $wcml_settings['sync_variations'];
|
273 |
-
|
274 |
-
if( isset( $_POST[ 'show_sync' ] ) ){
|
275 |
-
ob_start();
|
276 |
-
$this->show_variations_sync_button( $taxonomy, true );
|
277 |
-
$ret['bottom_html'] = ob_get_contents();
|
278 |
-
ob_end_clean();
|
279 |
-
}
|
280 |
-
|
281 |
}
|
282 |
}
|
283 |
}
|
@@ -469,77 +455,6 @@ class WCML_Terms{
|
|
469 |
|
470 |
return $html;
|
471 |
}
|
472 |
-
|
473 |
-
// Backward compatibility for WPML <= 3.1.8.2
|
474 |
-
public function show_variations_sync_button($taxonomy){
|
475 |
-
|
476 |
-
if( is_ajax() || is_admin() && isset($_GET['page']) && $_GET['page'] == 'wpml-wcml' && isset($_GET['tab']) ){
|
477 |
-
$wcml_settings = $this->woocommerce_wpml->get_settings();
|
478 |
-
|
479 |
-
if( !$wcml_settings['sync_variations'] ){
|
480 |
-
return;
|
481 |
-
}
|
482 |
-
|
483 |
-
$attribute_taxonomies = wc_get_attribute_taxonomies();
|
484 |
-
foreach($attribute_taxonomies as $a){
|
485 |
-
$attribute_taxonomies_arr[] = 'pa_' . $a->attribute_name;
|
486 |
-
}
|
487 |
-
|
488 |
-
if(isset( $attribute_taxonomies_arr ) && in_array($taxonomy, $attribute_taxonomies_arr)){
|
489 |
-
|
490 |
-
?>
|
491 |
-
|
492 |
-
<form id="wcml_tt_sync_variations" method="post">
|
493 |
-
<input type="hidden" name="action" value="wcml_sync_product_variations" />
|
494 |
-
<input type="hidden" name="taxonomy" value="<?php echo $taxonomy ?>" />
|
495 |
-
<input type="hidden" name="wcml_nonce" value="<?php echo wp_create_nonce('wcml_sync_product_variations') ?>" />
|
496 |
-
<input type="hidden" name="last_post_id" value="" />
|
497 |
-
<input type="hidden" name="languages_processed" value="0" />
|
498 |
-
|
499 |
-
<p>
|
500 |
-
<input class="button-secondary" type="submit" value="<?php esc_attr_e("Synchronize attributes and update product variations", 'woocommerce-multilingual') ?>" />
|
501 |
-
<img src="<?php echo ICL_PLUGIN_URL . '/res/img/ajax-loader.gif' ?>" alt="loading" height="16" width="16" class="wcml_tt_spinner" />
|
502 |
-
</p>
|
503 |
-
<span class="errors icl_error_text"></span>
|
504 |
-
<div class="wcml_tt_sycn_preview"></div>
|
505 |
-
</form>
|
506 |
-
|
507 |
-
|
508 |
-
<p><?php _e('This will automatically generate variations for translated products corresponding to recently translated attributes.'); ?></p>
|
509 |
-
<?php if(!empty($wcml_settings['variations_needed'][$taxonomy])): ?>
|
510 |
-
<p><?php printf(__('Currently, there are %s variations that need to be created.', 'woocommerce-multilingual'), '<strong>' . $wcml_settings['variations_needed'][$taxonomy] . '</strong>') ?></p>
|
511 |
-
<?php endif; ?>
|
512 |
-
|
513 |
-
|
514 |
-
<?php
|
515 |
-
|
516 |
-
}
|
517 |
-
|
518 |
-
}
|
519 |
-
|
520 |
-
}
|
521 |
-
|
522 |
-
// Backward compatibility for WPML <= 3.1.8.2
|
523 |
-
public function hide_tax_sync_button_for_attributes($value){
|
524 |
-
|
525 |
-
if(is_admin() && isset($_GET['page']) && $_GET['page'] == 'wpml-wcml' && isset($_GET['tab'])){
|
526 |
-
|
527 |
-
$wcml_settings = $this->woocommerce_wpml->get_settings();
|
528 |
-
$attribute_taxonomies = wc_get_attribute_taxonomies();
|
529 |
-
foreach($attribute_taxonomies as $a){
|
530 |
-
$attribute_taxonomies_arr[] = 'pa_' . $a->attribute_name;
|
531 |
-
}
|
532 |
-
|
533 |
-
$taxonomy = isset($_GET['tab']) ? $_GET['tab'] : false;
|
534 |
-
|
535 |
-
if(isset($attribute_taxonomies_arr) && in_array($taxonomy, $attribute_taxonomies_arr)){
|
536 |
-
$value = false;
|
537 |
-
}
|
538 |
-
|
539 |
-
}
|
540 |
-
|
541 |
-
return $value;
|
542 |
-
}
|
543 |
|
544 |
public function wcml_sync_product_variations($taxonomy){
|
545 |
$nonce = filter_input( INPUT_POST, 'wcml_nonce', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
|
29 |
|
30 |
add_action('created_term', array( $this, 'set_flag_for_variation_on_attribute_update'), 10, 3);
|
31 |
|
32 |
+
add_filter('wpml_taxonomy_translation_bottom', array( $this, 'sync_taxonomy_translations'), 10, 3 );
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
add_action('wp_ajax_wcml_sync_product_variations', array( $this, 'wcml_sync_product_variations'));
|
35 |
add_action('wp_ajax_wcml_tt_sync_taxonomies_in_content', array( $this, 'wcml_sync_taxonomies_in_content'));
|
264 |
|
265 |
if( in_array( $taxonomy, $attribute_taxonomies_arr ) ) {
|
266 |
$ret['show_button'] = $wcml_settings['sync_variations'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
267 |
}
|
268 |
}
|
269 |
}
|
455 |
|
456 |
return $html;
|
457 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
458 |
|
459 |
public function wcml_sync_product_variations($taxonomy){
|
460 |
$nonce = filter_input( INPUT_POST, 'wcml_nonce', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
|
inc/class-wcml-wc-strings.php
CHANGED
@@ -295,7 +295,7 @@ class WCML_WC_Strings{
|
|
295 |
?>"><?php _e('translations', 'woocommerce-multilingual') ?></a>');
|
296 |
}
|
297 |
|
298 |
-
jQuery('#<?php echo $key ?>_language_selector').
|
299 |
}
|
300 |
</script>
|
301 |
<?php }
|
295 |
?>"><?php _e('translations', 'woocommerce-multilingual') ?></a>');
|
296 |
}
|
297 |
|
298 |
+
jQuery('#<?php echo $key ?>_language_selector').prependTo( input.parent().find('.translation_controls') );
|
299 |
}
|
300 |
</script>
|
301 |
<?php }
|
inc/currencies/class-wcml-currencies.php
CHANGED
@@ -9,29 +9,6 @@ class WCML_Currencies{
|
|
9 |
|
10 |
add_action('widgets_init', array($this, 'register_currency_switcher_widget'));
|
11 |
|
12 |
-
add_action( 'init', array( $this, 'init' ), 15 );
|
13 |
-
}
|
14 |
-
|
15 |
-
public function init(){
|
16 |
-
if( is_admin() ){
|
17 |
-
add_action( 'woocommerce_settings_save_general', array( $this, 'currency_options_update_default_currency'));
|
18 |
-
}
|
19 |
-
|
20 |
-
}
|
21 |
-
|
22 |
-
/**
|
23 |
-
* When the default WooCommerce currency is updated, if it existed as a secondary currency, remove it
|
24 |
-
*
|
25 |
-
*/
|
26 |
-
public function currency_options_update_default_currency(){
|
27 |
-
|
28 |
-
$current_currency = get_option('woocommerce_currency');
|
29 |
-
|
30 |
-
if( isset( $this->woocommerce_wpml->settings['currency_options'][ $current_currency ] )){
|
31 |
-
unset( $this->woocommerce_wpml->settings['currency_options'][ $current_currency ] );
|
32 |
-
$this->woocommerce_wpml->update_settings();
|
33 |
-
}
|
34 |
-
|
35 |
}
|
36 |
|
37 |
public function register_currency_switcher_widget(){
|
@@ -42,7 +19,4 @@ class WCML_Currencies{
|
|
42 |
|
43 |
}
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
}
|
9 |
|
10 |
add_action('widgets_init', array($this, 'register_currency_switcher_widget'));
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
}
|
13 |
|
14 |
public function register_currency_switcher_widget(){
|
19 |
|
20 |
}
|
21 |
|
|
|
|
|
|
|
22 |
}
|
inc/currencies/class-wcml-currency-switcher.php
CHANGED
@@ -49,7 +49,9 @@ class WCML_Currency_Switcher {
|
|
49 |
array(
|
50 |
'format' => $_POST['template'] ? $_POST['template'] : '%name% (%symbol%) - %code%',
|
51 |
'switcher_style' => $_POST['switcher_type'],
|
52 |
-
'orientation' => $_POST['orientation']
|
|
|
|
|
53 |
|
54 |
die();
|
55 |
}
|
@@ -150,6 +152,14 @@ class WCML_Currency_Switcher {
|
|
150 |
$preview .= '</ul>';
|
151 |
}
|
152 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
}
|
154 |
|
155 |
if ( !isset($args['echo']) || $args['echo'] ) {
|
49 |
array(
|
50 |
'format' => $_POST['template'] ? $_POST['template'] : '%name% (%symbol%) - %code%',
|
51 |
'switcher_style' => $_POST['switcher_type'],
|
52 |
+
'orientation' => $_POST['orientation']
|
53 |
+
)
|
54 |
+
);
|
55 |
|
56 |
die();
|
57 |
}
|
152 |
$preview .= '</ul>';
|
153 |
}
|
154 |
|
155 |
+
} else{
|
156 |
+
|
157 |
+
if( is_admin() ){
|
158 |
+
|
159 |
+
$preview .= '<i>' . __("You haven't added any secondary currencies.", 'woocommerce-multilingual') . '</i>';
|
160 |
+
|
161 |
+
}
|
162 |
+
|
163 |
}
|
164 |
|
165 |
if ( !isset($args['echo']) || $args['echo'] ) {
|
inc/currencies/class-wcml-multi-currency-configuration.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
class WCML_Multi_Currency_Configuration{
|
4 |
-
|
5 |
private static $multi_currency;
|
6 |
private static $woocommerce_wpml;
|
7 |
-
|
8 |
public static function set_up( &$multi_currency, &$woocommerce_wpml ){
|
9 |
|
10 |
self::$multi_currency =& $multi_currency;
|
@@ -27,17 +27,11 @@ class WCML_Multi_Currency_Configuration{
|
|
27 |
|
28 |
add_action('wp_ajax_wcml_update_currency_lang', array(__CLASS__,'update_currency_lang'));
|
29 |
add_action('wp_ajax_wcml_update_default_currency', array(__CLASS__,'update_default_currency'));
|
30 |
-
|
31 |
-
}
|
32 |
-
|
33 |
-
if(is_admin()){
|
34 |
-
add_action( 'woocommerce_settings_save_general', array( __CLASS__, 'currency_options_update_default_currency' ), 5); // below 10
|
35 |
}
|
36 |
|
37 |
add_action( 'update_option_woocommerce_currency', array( 'WCML_Multi_Currency_Install', 'set_default_currencies_languages' ), 10, 2 );
|
38 |
|
39 |
-
|
40 |
-
|
41 |
}
|
42 |
|
43 |
public static function save_configuration(){
|
@@ -107,7 +101,7 @@ class WCML_Multi_Currency_Configuration{
|
|
107 |
$args['currency_symbol'] = get_woocommerce_currency_symbol( $args['currency_code'] );
|
108 |
|
109 |
$args['title'] = sprintf( __( 'Update settings for %s', 'woocommerce-multilingual' ),
|
110 |
-
|
111 |
|
112 |
}
|
113 |
|
@@ -163,7 +157,7 @@ class WCML_Multi_Currency_Configuration{
|
|
163 |
$changed = false;
|
164 |
$rate_changed = false;
|
165 |
foreach( self::$multi_currency->currencies[$currency_code] as $key => $value ){
|
166 |
-
|
167 |
if(isset($options[$key]) && $options[$key] != $value){
|
168 |
self::$multi_currency->currencies[$currency_code][$key] = $options[$key];
|
169 |
$changed = true;
|
@@ -171,7 +165,7 @@ class WCML_Multi_Currency_Configuration{
|
|
171 |
$rate_changed = true;
|
172 |
}
|
173 |
}
|
174 |
-
|
175 |
}
|
176 |
|
177 |
if($changed){
|
@@ -184,7 +178,7 @@ class WCML_Multi_Currency_Configuration{
|
|
184 |
|
185 |
$wc_currency = get_option('woocommerce_currency');
|
186 |
$wc_currencies = get_woocommerce_currencies();
|
187 |
-
|
188 |
switch( self::$multi_currency->currencies[$currency_code]['position'] ){
|
189 |
case 'left': $price = sprintf('%s99.99', get_woocommerce_currency_symbol($currency_code)); break;
|
190 |
case 'right': $price = sprintf('99.99%s', get_woocommerce_currency_symbol($currency_code)); break;
|
@@ -193,7 +187,7 @@ class WCML_Multi_Currency_Configuration{
|
|
193 |
}
|
194 |
|
195 |
$return['currency_name_formatted'] = sprintf('<span class="truncate">%s</span> <small>(%s)</small>', $wc_currencies[$currency_code], $price);
|
196 |
-
|
197 |
$return['currency_meta_info'] = sprintf('1 %s = %s %s', $wc_currency, self::$multi_currency->currencies[$currency_code]['rate'], $currency_code);
|
198 |
|
199 |
$args = array();
|
@@ -221,19 +215,8 @@ class WCML_Multi_Currency_Configuration{
|
|
221 |
die('Invalid nonce');
|
222 |
}
|
223 |
|
224 |
-
|
225 |
-
unset($settings['currency_options'][$_POST['code']]);
|
226 |
-
|
227 |
-
if(isset($settings['currencies_order'])){
|
228 |
-
foreach($settings['currencies_order'] as $key=>$cur_code){
|
229 |
-
if($cur_code == $_POST['code']) {
|
230 |
-
unset($settings['currencies_order'][$key]);
|
231 |
-
}
|
232 |
-
}
|
233 |
-
}
|
234 |
|
235 |
-
self::$woocommerce_wpml->update_settings($settings);
|
236 |
-
|
237 |
exit;
|
238 |
}
|
239 |
|
@@ -258,32 +241,34 @@ class WCML_Multi_Currency_Configuration{
|
|
258 |
|
259 |
self::$woocommerce_wpml->settings['default_currencies'][$_POST['lang']] = $_POST['code'];
|
260 |
self::$woocommerce_wpml->update_settings();
|
261 |
-
|
262 |
exit;
|
263 |
}
|
264 |
|
265 |
-
public static function currency_options_update_default_currency(){
|
266 |
-
|
267 |
-
$current_currency = get_option('woocommerce_currency');
|
268 |
-
$new_currency = $_POST['woocommerce_currency'];
|
269 |
-
|
270 |
-
if($new_currency != $current_currency) {
|
271 |
-
$message_id = 'wcml-woocommerce-default-currency-changed';
|
272 |
-
$message_args = array(
|
273 |
-
'id' => $message_id,
|
274 |
-
'text' => sprintf(__('The default currency was changed. In order to show accurate prices in all currencies, you need to update the exchange rates under the %sMulti-currency%s configuration.',
|
275 |
-
'woocommerce-multilingual'), '<a href="' . admin_url('admin.php?page=wpml-wcml&tab=multi-currency') . '">', '</a>'),
|
276 |
-
'type' => 'warning',
|
277 |
-
'group' => 'wcml-multi-currency',
|
278 |
-
'admin_notice' => true,
|
279 |
-
'hide' => true
|
280 |
-
);
|
281 |
-
|
282 |
-
ICL_AdminNotifier::remove_message($message_id); // clear any previous instances
|
283 |
-
ICL_AdminNotifier::add_message($message_args);
|
284 |
|
|
|
|
|
|
|
|
|
|
|
285 |
}
|
286 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
287 |
}
|
288 |
|
289 |
public static function legacy_update_custom_rates(){
|
@@ -295,11 +280,11 @@ class WCML_Multi_Currency_Configuration{
|
|
295 |
foreach($_POST['posts'] as $post_id => $rates){
|
296 |
update_post_meta($post_id, '_custom_conversion_rate', $rates);
|
297 |
}
|
298 |
-
|
299 |
echo json_encode(array());
|
300 |
exit;
|
301 |
}
|
302 |
-
|
303 |
public static function legacy_remove_custom_rates(){
|
304 |
|
305 |
$nonce = filter_input( INPUT_POST, 'wcml_nonce', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
|
@@ -310,7 +295,7 @@ class WCML_Multi_Currency_Configuration{
|
|
310 |
|
311 |
delete_post_meta($_POST['post_id'], '_custom_conversion_rate');
|
312 |
echo json_encode(array());
|
313 |
-
|
314 |
exit;
|
315 |
}
|
316 |
|
@@ -368,6 +353,4 @@ class WCML_Multi_Currency_Configuration{
|
|
368 |
}
|
369 |
}
|
370 |
|
371 |
-
|
372 |
-
}
|
373 |
-
|
1 |
<?php
|
2 |
+
|
3 |
class WCML_Multi_Currency_Configuration{
|
4 |
+
|
5 |
private static $multi_currency;
|
6 |
private static $woocommerce_wpml;
|
7 |
+
|
8 |
public static function set_up( &$multi_currency, &$woocommerce_wpml ){
|
9 |
|
10 |
self::$multi_currency =& $multi_currency;
|
27 |
|
28 |
add_action('wp_ajax_wcml_update_currency_lang', array(__CLASS__,'update_currency_lang'));
|
29 |
add_action('wp_ajax_wcml_update_default_currency', array(__CLASS__,'update_default_currency'));
|
30 |
+
|
|
|
|
|
|
|
|
|
31 |
}
|
32 |
|
33 |
add_action( 'update_option_woocommerce_currency', array( 'WCML_Multi_Currency_Install', 'set_default_currencies_languages' ), 10, 2 );
|
34 |
|
|
|
|
|
35 |
}
|
36 |
|
37 |
public static function save_configuration(){
|
101 |
$args['currency_symbol'] = get_woocommerce_currency_symbol( $args['currency_code'] );
|
102 |
|
103 |
$args['title'] = sprintf( __( 'Update settings for %s', 'woocommerce-multilingual' ),
|
104 |
+
'<strong>' . $args['currency_name'] . ' (' . $args['currency_symbol'] . ')</strong>' );
|
105 |
|
106 |
}
|
107 |
|
157 |
$changed = false;
|
158 |
$rate_changed = false;
|
159 |
foreach( self::$multi_currency->currencies[$currency_code] as $key => $value ){
|
160 |
+
|
161 |
if(isset($options[$key]) && $options[$key] != $value){
|
162 |
self::$multi_currency->currencies[$currency_code][$key] = $options[$key];
|
163 |
$changed = true;
|
165 |
$rate_changed = true;
|
166 |
}
|
167 |
}
|
168 |
+
|
169 |
}
|
170 |
|
171 |
if($changed){
|
178 |
|
179 |
$wc_currency = get_option('woocommerce_currency');
|
180 |
$wc_currencies = get_woocommerce_currencies();
|
181 |
+
|
182 |
switch( self::$multi_currency->currencies[$currency_code]['position'] ){
|
183 |
case 'left': $price = sprintf('%s99.99', get_woocommerce_currency_symbol($currency_code)); break;
|
184 |
case 'right': $price = sprintf('99.99%s', get_woocommerce_currency_symbol($currency_code)); break;
|
187 |
}
|
188 |
|
189 |
$return['currency_name_formatted'] = sprintf('<span class="truncate">%s</span> <small>(%s)</small>', $wc_currencies[$currency_code], $price);
|
190 |
+
|
191 |
$return['currency_meta_info'] = sprintf('1 %s = %s %s', $wc_currency, self::$multi_currency->currencies[$currency_code]['rate'], $currency_code);
|
192 |
|
193 |
$args = array();
|
215 |
die('Invalid nonce');
|
216 |
}
|
217 |
|
218 |
+
self::$multi_currency->delete_currency_by_code( $_POST[ 'code' ] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
219 |
|
|
|
|
|
220 |
exit;
|
221 |
}
|
222 |
|
241 |
|
242 |
self::$woocommerce_wpml->settings['default_currencies'][$_POST['lang']] = $_POST['code'];
|
243 |
self::$woocommerce_wpml->update_settings();
|
244 |
+
|
245 |
exit;
|
246 |
}
|
247 |
|
248 |
+
public static function currency_options_update_default_currency( $settings, $current_currency, $new_currency ){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
249 |
|
250 |
+
//When the default WooCommerce currency is updated, if it existed as a secondary currency, remove it
|
251 |
+
if( isset( $settings[ 'currency_options' ][ $current_currency ] ) ){
|
252 |
+
$currency_settings = $settings[ 'currency_options' ][ $current_currency ];
|
253 |
+
$settings[ 'currency_options' ][ $new_currency ] = $currency_settings;
|
254 |
+
$settings = self::$woocommerce_wpml->multi_currency->delete_currency_by_code( $current_currency, $settings, false );
|
255 |
}
|
256 |
|
257 |
+
$message_id = 'wcml-woocommerce-default-currency-changed';
|
258 |
+
$message_args = array(
|
259 |
+
'id' => $message_id,
|
260 |
+
'text' => sprintf(__('The default currency was changed. In order to show accurate prices in all currencies, you need to update the exchange rates under the %sMulti-currency%s configuration.',
|
261 |
+
'woocommerce-multilingual'), '<a href="' . admin_url('admin.php?page=wpml-wcml&tab=multi-currency') . '">', '</a>'),
|
262 |
+
'type' => 'warning',
|
263 |
+
'group' => 'wcml-multi-currency',
|
264 |
+
'admin_notice' => true,
|
265 |
+
'hide' => true
|
266 |
+
);
|
267 |
+
|
268 |
+
ICL_AdminNotifier::remove_message($message_id); // clear any previous instances
|
269 |
+
ICL_AdminNotifier::add_message($message_args);
|
270 |
+
|
271 |
+
return $settings;
|
272 |
}
|
273 |
|
274 |
public static function legacy_update_custom_rates(){
|
280 |
foreach($_POST['posts'] as $post_id => $rates){
|
281 |
update_post_meta($post_id, '_custom_conversion_rate', $rates);
|
282 |
}
|
283 |
+
|
284 |
echo json_encode(array());
|
285 |
exit;
|
286 |
}
|
287 |
+
|
288 |
public static function legacy_remove_custom_rates(){
|
289 |
|
290 |
$nonce = filter_input( INPUT_POST, 'wcml_nonce', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
|
295 |
|
296 |
delete_post_meta($_POST['post_id'], '_custom_conversion_rate');
|
297 |
echo json_encode(array());
|
298 |
+
|
299 |
exit;
|
300 |
}
|
301 |
|
353 |
}
|
354 |
}
|
355 |
|
356 |
+
}
|
|
|
|
inc/currencies/class-wcml-multi-currency-install.php
CHANGED
@@ -26,8 +26,12 @@ class WCML_Multi_Currency_Install{
|
|
26 |
$active_languages = $sitepress->get_active_languages();
|
27 |
$wc_currency = $new_value ? $new_value : get_option('woocommerce_currency');
|
28 |
|
|
|
|
|
|
|
29 |
|
30 |
-
foreach
|
|
|
31 |
foreach($active_languages as $language){
|
32 |
if(!isset($settings['currency_options'][$code]['languages'][$language['code']])){
|
33 |
$settings['currency_options'][$code]['languages'][$language['code']] = 1;
|
@@ -49,5 +53,4 @@ class WCML_Multi_Currency_Install{
|
|
49 |
|
50 |
}
|
51 |
|
52 |
-
|
53 |
}
|
26 |
$active_languages = $sitepress->get_active_languages();
|
27 |
$wc_currency = $new_value ? $new_value : get_option('woocommerce_currency');
|
28 |
|
29 |
+
if( $old_value != $new_value ) {
|
30 |
+
$settings = WCML_Multi_Currency_Configuration::currency_options_update_default_currency( $settings, $old_value, $new_value );
|
31 |
+
}
|
32 |
|
33 |
+
foreach( self::$multi_currency->get_currency_codes() as $code) {
|
34 |
+
if( $code == $old_value ) continue;
|
35 |
foreach($active_languages as $language){
|
36 |
if(!isset($settings['currency_options'][$code]['languages'][$language['code']])){
|
37 |
$settings['currency_options'][$code]['languages'][$language['code']] = 1;
|
53 |
|
54 |
}
|
55 |
|
|
|
56 |
}
|
inc/currencies/class-wcml-multi-currency-prices.php
CHANGED
@@ -269,14 +269,15 @@ class WCML_Multi_Currency_Prices{
|
|
269 |
|
270 |
public function apply_rounding_rules($price, $currency = false ){
|
271 |
|
272 |
-
if( !$currency ){
|
273 |
-
$currency = $this->multi_currency->get_client_currency();
|
274 |
-
}
|
275 |
-
|
276 |
if( is_null($this->woocommerce_wpml) ){
|
277 |
global $woocommerce_wpml;
|
278 |
$this->woocommerce_wpml = $woocommerce_wpml;
|
279 |
}
|
|
|
|
|
|
|
|
|
|
|
280 |
$currency_options = $this->woocommerce_wpml->settings['currency_options'][$currency];
|
281 |
|
282 |
if( $currency_options['rounding'] != 'disabled' ){
|
@@ -522,7 +523,12 @@ class WCML_Multi_Currency_Prices{
|
|
522 |
|
523 |
public function filter_currency_num_decimals_option($value){
|
524 |
|
525 |
-
$
|
|
|
|
|
|
|
|
|
|
|
526 |
|
527 |
if(isset($this->multi_currency->currencies[$currency_code]['num_decimals']) ){
|
528 |
$value = $this->multi_currency->currencies[$currency_code]['num_decimals'];
|
269 |
|
270 |
public function apply_rounding_rules($price, $currency = false ){
|
271 |
|
|
|
|
|
|
|
|
|
272 |
if( is_null($this->woocommerce_wpml) ){
|
273 |
global $woocommerce_wpml;
|
274 |
$this->woocommerce_wpml = $woocommerce_wpml;
|
275 |
}
|
276 |
+
|
277 |
+
if( !$currency ){
|
278 |
+
$currency = $this->multi_currency->get_client_currency();
|
279 |
+
}
|
280 |
+
|
281 |
$currency_options = $this->woocommerce_wpml->settings['currency_options'][$currency];
|
282 |
|
283 |
if( $currency_options['rounding'] != 'disabled' ){
|
523 |
|
524 |
public function filter_currency_num_decimals_option($value){
|
525 |
|
526 |
+
$db = debug_backtrace();
|
527 |
+
if( $db['7']['function'] == 'calculate_shipping_for_package' && $db['4']['function'] == 'add_rate' ){
|
528 |
+
$currency_code = get_option( 'woocommerce_currency' );
|
529 |
+
}else{
|
530 |
+
$currency_code = $this->check_admin_order_currency_code();
|
531 |
+
}
|
532 |
|
533 |
if(isset($this->multi_currency->currencies[$currency_code]['num_decimals']) ){
|
534 |
$value = $this->multi_currency->currencies[$currency_code]['num_decimals'];
|
inc/currencies/class-wcml-multi-currency-shipping.php
CHANGED
@@ -2,6 +2,9 @@
|
|
2 |
|
3 |
class WCML_Multi_Currency_Shipping{
|
4 |
|
|
|
|
|
|
|
5 |
private $multi_currency;
|
6 |
|
7 |
public function __construct( &$multi_currency ) {
|
@@ -9,33 +12,134 @@ class WCML_Multi_Currency_Shipping{
|
|
9 |
|
10 |
$this->multi_currency =& $multi_currency;
|
11 |
|
|
|
|
|
|
|
12 |
$rates = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}woocommerce_shipping_zone_methods WHERE method_id IN('flat_rate', 'local_pickup', 'free_shipping')" );
|
13 |
foreach( $rates as $method ){
|
14 |
$option_name = sprintf('woocommerce_%s_%d_settings', $method->method_id, $method->instance_id );
|
15 |
-
add_filter('option_' . $option_name, array($this, '
|
16 |
}
|
17 |
|
|
|
18 |
add_filter( 'wcml_shipping_price_amount', array( $this, 'shipping_price_filter' ) ); // WCML filters
|
19 |
add_filter( 'wcml_shipping_free_min_amount', array( $this, 'shipping_free_min_amount') ); // WCML filters
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
// Before WooCommerce 2.6
|
22 |
add_filter('option_woocommerce_free_shipping_settings', array( $this, 'adjust_min_amount_required' ) );
|
23 |
|
|
|
24 |
}
|
25 |
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
-
if( isset($settings['cost']) ){
|
29 |
-
$settings['cost'] = $this->multi_currency->prices->raw_price_filter($settings['cost'], $this->multi_currency->get_client_currency());
|
30 |
}
|
31 |
|
32 |
-
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
}
|
35 |
|
36 |
return $settings;
|
37 |
}
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
public function shipping_price_filter($price) {
|
40 |
|
41 |
$price = $this->multi_currency->prices->raw_price_filter($price, $this->multi_currency->get_client_currency());
|
2 |
|
3 |
class WCML_Multi_Currency_Shipping{
|
4 |
|
5 |
+
/**
|
6 |
+
* @var WCML_Multi_Currency
|
7 |
+
*/
|
8 |
private $multi_currency;
|
9 |
|
10 |
public function __construct( &$multi_currency ) {
|
12 |
|
13 |
$this->multi_currency =& $multi_currency;
|
14 |
|
15 |
+
add_filter('woocommerce_cart_shipping_method_full_label', array( $this, 'convert_shipping_cost'), 10, 2 );
|
16 |
+
|
17 |
+
// shipping method cost settings
|
18 |
$rates = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}woocommerce_shipping_zone_methods WHERE method_id IN('flat_rate', 'local_pickup', 'free_shipping')" );
|
19 |
foreach( $rates as $method ){
|
20 |
$option_name = sprintf('woocommerce_%s_%d_settings', $method->method_id, $method->instance_id );
|
21 |
+
add_filter('option_' . $option_name, array($this, 'convert_shipping_method_cost_settings'));
|
22 |
}
|
23 |
|
24 |
+
// Used for table rate shipping compatibility class
|
25 |
add_filter( 'wcml_shipping_price_amount', array( $this, 'shipping_price_filter' ) ); // WCML filters
|
26 |
add_filter( 'wcml_shipping_free_min_amount', array( $this, 'shipping_free_min_amount') ); // WCML filters
|
27 |
|
28 |
+
add_filter( 'woocommerce_evaluate_shipping_cost_args', array( $this, 'woocommerce_evaluate_shipping_cost_args') );
|
29 |
+
|
30 |
+
add_action( 'woocommerce_calculate_totals', array( $this, 'convert_shipping_totals' ) );
|
31 |
+
|
32 |
+
add_filter( 'woocommerce_shipping_packages', array( $this, 'convert_shipping_taxes'), 10 );
|
33 |
+
|
34 |
+
|
35 |
// Before WooCommerce 2.6
|
36 |
add_filter('option_woocommerce_free_shipping_settings', array( $this, 'adjust_min_amount_required' ) );
|
37 |
|
38 |
+
|
39 |
}
|
40 |
|
41 |
+
/**
|
42 |
+
* @param $label string
|
43 |
+
* @param $method object
|
44 |
+
* @return string
|
45 |
+
*
|
46 |
+
*/
|
47 |
+
public function convert_shipping_cost( $label, $method ){
|
48 |
+
|
49 |
+
if( empty( $method->_costs_converted ) ){
|
50 |
+
|
51 |
+
$client_currency = $this->multi_currency->get_client_currency();
|
52 |
+
$label = $method->get_label();
|
53 |
+
|
54 |
+
if ( $method->cost > 0 ) {
|
55 |
+
$method->cost = $this->multi_currency->prices->raw_price_filter( $method->cost, $client_currency);
|
56 |
+
if ( WC()->cart->tax_display_cart == 'excl' ) {
|
57 |
+
$label .= ': ' . wc_price( $method->cost );
|
58 |
+
if ( $method->get_shipping_tax() > 0 && WC()->cart->prices_include_tax ) {
|
59 |
+
$label .= ' <small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>';
|
60 |
+
}
|
61 |
+
} else {
|
62 |
+
$label .= ': ' . wc_price( $method->cost + $method->get_shipping_tax() );
|
63 |
+
if ( $method->get_shipping_tax() > 0 && ! WC()->cart->prices_include_tax ) {
|
64 |
+
$label .= ' <small class="tax_label">' . WC()->countries->inc_tax_or_vat() . '</small>';
|
65 |
+
}
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
$method->_costs_converted = true;
|
70 |
|
|
|
|
|
71 |
}
|
72 |
|
73 |
+
return $label;
|
74 |
+
}
|
75 |
+
|
76 |
+
public function convert_shipping_method_cost_settings( $settings ){
|
77 |
+
|
78 |
+
$has_free_shipping_coupon = false;
|
79 |
+
if ( $coupons = WC()->cart->get_coupons() ) {
|
80 |
+
foreach ( $coupons as $code => $coupon ) {
|
81 |
+
if ( $coupon->is_valid() && $coupon->enable_free_shipping() ) {
|
82 |
+
$has_free_shipping_coupon = true;
|
83 |
+
}
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
if( !empty( $settings['requires'] ) ){
|
88 |
+
|
89 |
+
if(
|
90 |
+
$settings['requires'] == 'min_amount' ||
|
91 |
+
$settings['requires'] == 'either' ||
|
92 |
+
$settings['requires'] == 'both' && $has_free_shipping_coupon
|
93 |
+
){
|
94 |
+
$settings['min_amount'] = apply_filters( 'wcml_shipping_free_min_amount', $settings['min_amount'] );
|
95 |
+
}
|
96 |
}
|
97 |
|
98 |
return $settings;
|
99 |
}
|
100 |
|
101 |
+
/**
|
102 |
+
* @param $args
|
103 |
+
* @param $sum
|
104 |
+
* @param $method
|
105 |
+
* @return array
|
106 |
+
*
|
107 |
+
* When using [cost] in the shipping class costs, we need to use the not-converted cart total
|
108 |
+
* It will be converted as part of the total cost
|
109 |
+
*
|
110 |
+
*/
|
111 |
+
public function woocommerce_evaluate_shipping_cost_args( $args ){
|
112 |
+
|
113 |
+
$args['cost'] = $this->multi_currency->prices->unconvert_price_amount( $args['cost'] );
|
114 |
+
|
115 |
+
return $args;
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* @param $cart WC_Cart (reference)
|
120 |
+
*
|
121 |
+
* converts the cart total and the cart tax total in the WC_Cart object on the checkout page
|
122 |
+
*/
|
123 |
+
public function convert_shipping_totals( $cart ){
|
124 |
+
$cart->shipping_total = $this->multi_currency->prices->raw_price_filter( $cart->shipping_total );
|
125 |
+
}
|
126 |
+
|
127 |
+
public function convert_shipping_taxes( $packages ){
|
128 |
+
|
129 |
+
foreach( $packages as $package_id => $package ){
|
130 |
+
foreach( $package['rates'] as $rate_id => $rate ){
|
131 |
+
foreach( $rate->taxes as $tax_id => $tax){
|
132 |
+
|
133 |
+
$packages[$package_id]['rates'][$rate_id]->taxes[$tax_id] =
|
134 |
+
$this->multi_currency->prices->raw_price_filter( $tax );
|
135 |
+
|
136 |
+
}
|
137 |
+
}
|
138 |
+
}
|
139 |
+
|
140 |
+
return $packages;
|
141 |
+
}
|
142 |
+
|
143 |
public function shipping_price_filter($price) {
|
144 |
|
145 |
$price = $this->multi_currency->prices->raw_price_filter($price, $this->multi_currency->get_client_currency());
|
inc/currencies/class-wcml-multi-currency.php
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
// Our case:
|
4 |
// Muli-currency can be enabled by an option in wp_options - wcml_multi_currency_enabled
|
5 |
// User currency will be set in the woocommerce session as 'client_currency'
|
6 |
//
|
7 |
-
|
8 |
class WCML_Multi_Currency{
|
9 |
|
10 |
public $currencies = array();
|
11 |
public $currency_codes = array();
|
12 |
|
13 |
private $client_currency;
|
14 |
-
|
15 |
private $exchange_rates = array();
|
16 |
-
|
17 |
public $currencies_without_cents = array('JPY', 'TWD', 'KRW', 'BIF', 'BYR', 'CLP', 'GNF', 'ISK', 'KMF', 'PYG', 'RWF', 'VUV', 'XAF', 'XOF', 'XPF');
|
18 |
|
19 |
/**
|
@@ -56,7 +56,7 @@ class WCML_Multi_Currency{
|
|
56 |
* @var woocommerce_wpml
|
57 |
*/
|
58 |
public $woocommerce_wpml;
|
59 |
-
|
60 |
public function __construct(){
|
61 |
global $woocommerce_wpml;
|
62 |
|
@@ -65,7 +65,7 @@ class WCML_Multi_Currency{
|
|
65 |
WCML_Multi_Currency_Install::set_up( $this, $woocommerce_wpml );
|
66 |
|
67 |
$this->init_currencies();
|
68 |
-
|
69 |
if( $this->_load_filters()) {
|
70 |
$this->prices = new WCML_Multi_Currency_Prices( $this );
|
71 |
$this->coupons = new WCML_Multi_Currency_Coupons();
|
@@ -251,13 +251,32 @@ class WCML_Multi_Currency{
|
|
251 |
return false;
|
252 |
}
|
253 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
public function get_exchange_rates(){
|
255 |
|
256 |
if(empty($this->exchange_rates)){
|
257 |
|
258 |
$this->exchange_rates = array(get_option('woocommerce_currency') => 1);
|
259 |
-
$woo_currencies = get_woocommerce_currencies();
|
260 |
-
|
261 |
$currencies = $this->get_currencies();
|
262 |
foreach($currencies as $code => $currency){
|
263 |
if(!empty($woo_currencies[$code])){
|
@@ -410,7 +429,4 @@ class WCML_Multi_Currency{
|
|
410 |
|
411 |
}
|
412 |
|
413 |
-
|
414 |
-
|
415 |
-
}
|
416 |
-
|
1 |
<?php
|
2 |
+
|
3 |
// Our case:
|
4 |
// Muli-currency can be enabled by an option in wp_options - wcml_multi_currency_enabled
|
5 |
// User currency will be set in the woocommerce session as 'client_currency'
|
6 |
//
|
7 |
+
|
8 |
class WCML_Multi_Currency{
|
9 |
|
10 |
public $currencies = array();
|
11 |
public $currency_codes = array();
|
12 |
|
13 |
private $client_currency;
|
14 |
+
|
15 |
private $exchange_rates = array();
|
16 |
+
|
17 |
public $currencies_without_cents = array('JPY', 'TWD', 'KRW', 'BIF', 'BYR', 'CLP', 'GNF', 'ISK', 'KMF', 'PYG', 'RWF', 'VUV', 'XAF', 'XOF', 'XPF');
|
18 |
|
19 |
/**
|
56 |
* @var woocommerce_wpml
|
57 |
*/
|
58 |
public $woocommerce_wpml;
|
59 |
+
|
60 |
public function __construct(){
|
61 |
global $woocommerce_wpml;
|
62 |
|
65 |
WCML_Multi_Currency_Install::set_up( $this, $woocommerce_wpml );
|
66 |
|
67 |
$this->init_currencies();
|
68 |
+
|
69 |
if( $this->_load_filters()) {
|
70 |
$this->prices = new WCML_Multi_Currency_Prices( $this );
|
71 |
$this->coupons = new WCML_Multi_Currency_Coupons();
|
251 |
return false;
|
252 |
}
|
253 |
|
254 |
+
public function delete_currency_by_code( $code, $settings = false, $update = true ){
|
255 |
+
$settings = $settings ? $settings : $this->woocommerce_wpml->get_settings();
|
256 |
+
unset( $settings[ 'currency_options' ][ $code ] );
|
257 |
+
|
258 |
+
if( isset( $settings[ 'currencies_order' ] ) ){
|
259 |
+
foreach( $settings[ 'currencies_order' ] as $key => $cur_code ){
|
260 |
+
if( $cur_code == $code ) {
|
261 |
+
unset( $settings[ 'currencies_order' ][ $key ] );
|
262 |
+
}
|
263 |
+
}
|
264 |
+
}
|
265 |
+
|
266 |
+
if( $update ){
|
267 |
+
$this->woocommerce_wpml->update_settings( $settings );
|
268 |
+
}
|
269 |
+
|
270 |
+
return $settings;
|
271 |
+
}
|
272 |
+
|
273 |
public function get_exchange_rates(){
|
274 |
|
275 |
if(empty($this->exchange_rates)){
|
276 |
|
277 |
$this->exchange_rates = array(get_option('woocommerce_currency') => 1);
|
278 |
+
$woo_currencies = get_woocommerce_currencies();
|
279 |
+
|
280 |
$currencies = $this->get_currencies();
|
281 |
foreach($currencies as $code => $currency){
|
282 |
if(!empty($woo_currencies[$code])){
|
429 |
|
430 |
}
|
431 |
|
432 |
+
}
|
|
|
|
|
|
inc/translation-editor/class-wcml-synchronize-product-data.php
CHANGED
@@ -32,6 +32,12 @@ class WCML_Synchronize_Product_Data{
|
|
32 |
//quick & bulk edit
|
33 |
add_action( 'woocommerce_product_quick_edit_save', array( $this, 'woocommerce_product_quick_edit_save' ) );
|
34 |
add_action( 'woocommerce_product_bulk_edit_save', array( $this, 'woocommerce_product_quick_edit_save' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
|
37 |
/**
|
@@ -542,4 +548,46 @@ class WCML_Synchronize_Product_Data{
|
|
542 |
return $duplicated_products;
|
543 |
}
|
544 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
545 |
}
|
32 |
//quick & bulk edit
|
33 |
add_action( 'woocommerce_product_quick_edit_save', array( $this, 'woocommerce_product_quick_edit_save' ) );
|
34 |
add_action( 'woocommerce_product_bulk_edit_save', array( $this, 'woocommerce_product_quick_edit_save' ) );
|
35 |
+
|
36 |
+
add_action( 'init', array( $this, 'init' ) );
|
37 |
+
}
|
38 |
+
|
39 |
+
public function init(){
|
40 |
+
$this->check_ajax_actions();
|
41 |
}
|
42 |
|
43 |
/**
|
548 |
return $duplicated_products;
|
549 |
}
|
550 |
|
551 |
+
public function check_ajax_actions(){
|
552 |
+
if( isset( $_POST[ 'icl_ajx_action' ] ) && $_POST[ 'icl_ajx_action' ] == 'connect_translations' ){
|
553 |
+
$this->icl_connect_translations_action();
|
554 |
+
}
|
555 |
+
}
|
556 |
+
|
557 |
+
public function icl_connect_translations_action(){
|
558 |
+
$new_trid = $_POST['new_trid'];
|
559 |
+
$post_type = $_POST['post_type'];
|
560 |
+
$post_id = $_POST['post_id'];
|
561 |
+
$set_as_source = $_POST['set_as_source'];
|
562 |
+
if( $post_type == 'product' ){
|
563 |
+
|
564 |
+
$translations = $this->sitepress->get_element_translations( $new_trid, 'post_' . $post_type );
|
565 |
+
if( $translations ) {
|
566 |
+
foreach ( $translations as $translation ) {
|
567 |
+
//current as original need sync translation
|
568 |
+
if ( $translation->original ) {
|
569 |
+
if( $set_as_source ) {
|
570 |
+
$orig_id = $post_id;
|
571 |
+
$trnsl_id = $translation->element_id;
|
572 |
+
$lang = $translation->language_code;
|
573 |
+
}else{
|
574 |
+
$orig_id = $translation->element_id;
|
575 |
+
$trnsl_id = $post_id;
|
576 |
+
$lang = $this->sitepress->get_current_language();
|
577 |
+
}
|
578 |
+
$this->sync_product_data( $orig_id, $trnsl_id, $lang );
|
579 |
+
$this->sync_date_and_parent( $orig_id, $trnsl_id, $lang );
|
580 |
+
$this->sitepress->copy_custom_fields( $orig_id, $trnsl_id );
|
581 |
+
}else {
|
582 |
+
if( $set_as_source ) {
|
583 |
+
$this->sync_product_data( $post_id, $translation->element_id, $translation->language_code );
|
584 |
+
$this->sync_date_and_parent( $post_id, $translation->element_id, $translation->language_code );
|
585 |
+
$this->sitepress->copy_custom_fields( $post_id, $translation->element_id );
|
586 |
+
}
|
587 |
+
}
|
588 |
+
}
|
589 |
+
}
|
590 |
+
}
|
591 |
+
}
|
592 |
+
|
593 |
}
|
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: 3.9
|
7 |
-
Tested up to: 4.
|
8 |
-
Stable tag: 3.8.
|
9 |
|
10 |
Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
|
11 |
|
@@ -131,6 +131,14 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
|
|
131 |
|
132 |
== Changelog ==
|
133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
= 3.8.4 =
|
135 |
* Bug fix: minimum required amount was not calculated correctly for secondary currencies (not included in the previous version)
|
136 |
|
4 |
Tags: CMS, woocommerce, commerce, ecommerce, e-commerce, products, WPML, multilingual, e-shop, shop
|
5 |
License: GPLv2
|
6 |
Requires at least: 3.9
|
7 |
+
Tested up to: 4.6
|
8 |
+
Stable tag: 3.8.5
|
9 |
|
10 |
Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
|
11 |
|
131 |
|
132 |
== Changelog ==
|
133 |
|
134 |
+
= 3.8.5 =
|
135 |
+
* Fixed more problems related to converting shipping costs in secondary currencies
|
136 |
+
* Fixed one compatibility problem with WooCommerce Show Single Variations
|
137 |
+
* Bug fix: product translations were not synchronized correctly when marking an existing product as a translation of another one
|
138 |
+
* Bug fix: variation names not displayed in tooltips on the orders screen in the backend
|
139 |
+
* Updated the wpml-config.xml configuration file: copy prices to product translations also when multi-currency is not on
|
140 |
+
* Other small fixes for the admin interface
|
141 |
+
|
142 |
= 3.8.4 =
|
143 |
* Bug fix: minimum required amount was not calculated correctly for secondary currencies (not included in the previous version)
|
144 |
|
res/css/dialogs.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wcml-slug-dialog .translated_value,.wcml-slug-dialog .original_value,.wcml-slug-dialog .wpml-header-original,.wcml-slug-dialog .wpml-header-translation{width:calc(50% - 30px - 5px)}
|
1 |
+
.wcml-slug-dialog .translated_value,.wcml-slug-dialog .original_value,.wcml-slug-dialog .wpml-header-original,.wcml-slug-dialog .wpml-header-translation{width:-webkit-calc(50% - 30px - 5px);width:calc(50% - 30px - 5px)}
|
res/css/management.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wcml-wrap{border:1px solid #CCCCCC;padding:15px;background-color:#ffffff}.wcml-wrap:before,.wcml-wrap:after{content:" ";display:table}.wcml-wrap:after{clear:both}.dis_base{opacity:0.5}.wcml-wrap{margin-bottom:20px;min-width:900px}.wcml-wrap .wpml-tabs{margin-top:0}.wcml-wrap .otgs-ico-yes,.wcml-wrap .otgs-ico-ok{color:#51a351}.wcml-wrap .otgs-ico-no,.wcml-wrap .otgs-ico-warning,.wcml-wrap .otgs-ico-delete{color:#9d261d}.wcml-wrap .otgs-ico-edit{color:#3a87ad}.wcml-wrap .otgs-ico-in-progress{color:#ffb800}@media (max-width: 1199px){.wcml-wrap .tablenav.top{height:auto}.wcml-wrap .tablenav.top.wcml-product-translation-filtering .alignright,.wcml-wrap .tablenav.top.wcml-product-translation-filtering .alignleft{float:none;margin-bottom:5px}}[class*="otgs-ico"]:before{font-size:16px}.wcml-tabs{min-width:930px}.wcml-tabs:before,.wcml-tabs:after{content:" ";display:table}.wcml-tabs:after{clear:both}.wcml-tabs .nav-tab{margin-top:5px}@media (max-width: 1350px){.wcml-tabs .nav-tab{margin-left:.2em}}.wcml-tabs .nav-tab [class*="otgs-ico"]:before{font-size:18px}.wcml-section{clear:both;padding:0 0 15px 0;margin:0 0 15px 0;border-bottom:1px solid #ededed;min-width:900px;overflow:hidden}.wcml-section:last-of-type{border:none;margin:0}.wcml-section-content .wcml-section-content-inner{margin:0 0 20px 0;padding:0 0 10px 0;border-bottom:1px solid #ededed;float:left;width:100%}.wcml-section-header{width:300px;float:left}.wcml-section-header h3{font-weight:normal;font-size:1.4em;margin-top:0.7em}.wcml-section-header h3 .wcml-tip:before{vertical-align:top}.wcml-section-content{float:left;width:570px;margin-left:30px}.wcml-section-content-wide{width:calc(100% - 360px)}.wcml_products{margin:20px 0;position:relative}.button-wrap,.widefat td .button-wrap{text-align:right;margin:10px 0}.currency_action_update{display:inline-block}.wcml-co-dialog.hidden{display:none}.wcml-co-dialog .wpml-form-row label{width:195px;text-align:left}.wcml-co-dialog input,.wcml-co-dialog select{width:145px}.wcml-co-dialog .currency_code label{width:100px}.wcml-co-dialog .currency_code select{width:auto}.wcml-co-dialog .wcml-co-exchange-rate label{width:100px}.wcml-co-dialog .wcml-co-exchange-rate input{margin:0 !important;width:70px}.wcml-co-dialog .wcml-co-exchange-rate .wcml-co-set-rate{display:inline-block;padding:4px 15px 7px 15px}.wcml-co-dialog .wcml-co-exchange-rate small{display:block}.wcml-co-dialog .wcml-co-preview label{width:120px;vertical-align:middle}.wcml-co-dialog .wcml-co-preview .wcml-co-preview-value{display:inline-block;padding:7px 15px;border:1px solid #555;font-size:1.4em;font-weight:bold;vertical-align:middle;margin:15px 0}table.widefat.currency_table{float:left;width:300px;border-right:none}table.widefat.currency_table td.wcml-col-currency,table.widefat.currency_table td.wcml-col-rate{padding-top:7px;padding-bottom:0;vertical-align:top}table.widefat.currency_table td.wcml-col-currency .truncate{max-width:145px;display:block}table.widefat.currency_table td.wcml-col-currency small{display:block}table.widefat.currency_table td.wcml-col-edit a{position:relative;top:-3px}table.widefat.currency_table td.wcml-col-rate{font-size:.85em}table.widefat.currency_delete_table{float:left;width:50px;border-left:none;clear:none}table.widefat.currency_delete_table td.wcml-col-delete{vertical-align:middle;text-align:center}table.widefat.currency_delete_table td.wcml-col-delete:first-child{border-left:1px solid #e5e5e5}.currency_value .wcml-error,.wcml-error{font-size:10px;color:#f00;display:inline-block}.trbl_variables_products{padding:10px;border:1px solid #8cceea;background-color:#eff8fc;border-radius:5px}.trbl_variables_products label span{font-weight:bold}.wcml_trbl_warning{padding:10px;margin-bottom:10px;border:1px solid #f00;background-color:#ffb7b7;border-radius:5px 5px}#wcml_sync_variations{background-color:#21759b;background-image:linear-gradient(to bottom, #2a95c5, #21759b);border-color:#21759b;border-bottom-color:#1e6a8d;box-shadow:inset 0 1px 0 rgba(120,200,230,0.5);color:#fff;text-decoration:none;text-shadow:0 1px 0 rgba(0,0,0,0.1)}.wcml_duplicate_product_notice td{border-bottom:none !important}.wcml_product_status_text,.prod_parent_text{font-style:italic;color:#9A9A9A}.wcml_no_found_text{text-align:center}.currency_languages{position:relative;text-align:center}.currency_languages:first-child{border-left:1px solid #e5e5e5}.currency_languages ul{margin:0;text-align:center}.currency_languages ul li{margin:0;display:none}.currency_languages ul li.on{display:inline-block}table.widefat.currency_lang_table{border-left:none;border-right:none}.currency_wrap{width:calc(100% - 300px - 50px);float:left;margin-bottom:10px}.currency_inner{overflow-x:auto;overflow-y:visible}.currency_table,.currency_lang_table,.currency_delete_table{clear:none}.currency_table tr,.currency_lang_table tr,.currency_delete_table tr{height:50px}.currency_lang_table th{text-align:center}.currency_lang_table td{vertical-align:middle}.currency_lang_table.widefat td{padding-right:0;padding-left:0}.default_currency select{font-size:9px;height:24px;margin:0;margin-right:2px;padding:2px 0}.default_currency td{border-top:1px solid #e5e5e5}.default_currency .inf_message{font-size:10px;font-style:italic;color:#9A9A9A}#wcml_currencies_order{display:block;overflow:hidden;width:100%}#wcml_currencies_order li{float:left;margin:0 8px 0 0;padding:2px 8px;border:1px solid #DFDFDF;border-radius:2px;background:linear-gradient(to top, #ECECEC, #F9F9F9) repeat scroll 0 0 #F1F1F1;cursor:move}.wcml_currencies_order_ajx_resp{padding-top:5px;color:#E68A00}.explanation-text{color:#999}input[name="wcml_curr_template"]{width:100%}.wcml_curr_style label{line-height:30px}.wcml-currency-preview{margin:15px 0 30px;display:inline-block}.wcml_product_name{line-height:20px}.wcml_prod_filters{float:left}.wcml_miss_lang p:first-child{float:left}#display_custom_prices_select{display:inline-block;width:100%}.edit_slug_input,.edit_slug_hide_link{display:none}.wcml-tip{cursor:help;color:#555}.wcml-products a{cursor:pointer}@media (max-width: 782px){.column-product_cat,.column-product_tag,.column-product_type{display:none}}.wcml-link-troubleshooting{margin-top:7px}.wcml-status-list li{padding-left:25px;margin-bottom:30px}.wcml-status-list li ul li{margin-bottom:3.5px}.wcml-status-list.wcml-plugins-status-list li,.wcml-status-list.wcml-tax-translation-list li{margin-bottom:15px}.wcml-status-list [class*="otgs-ico"]:not(.otgs-ico-help){margin-left:-25px;margin-right:5px;vertical-align:baseline}.wcml-status-list .button-secondary{vertical-align:middle}.wcml-status-list small{display:block}.wcml-lang-list{margin:7px 0}.wcml-lang-list .wpml-title-flag{margin-left:-25px;margin-right:5px}.wcml-dismiss-warning{position:relative;float:right;padding:0;text-decoration:none;outline:none}.wcml-dismiss-warning:active{outline:none}.wcml-notice{background:#fff;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);margin:5px 0 15px;padding:1px 12px;position:relative}.wcml-notice p{margin:.5em 0;padding:2px}.otgs-is-dismissible{position:relative;padding-right:38px}.otgs-is-dismissible .notice-dismiss{text-decoration:none}.otgs-is-dismissible p [class*="button-"]{margin:-5px 5px}.wcml_tt_spinner{margin-right:15px;display:none}
|
1 |
+
.wcml-wrap{border:1px solid #CCCCCC;padding:15px;background-color:#ffffff}.wcml-wrap:before,.wcml-wrap:after{content:" ";display:table}.wcml-wrap:after{clear:both}.dis_base{opacity:0.5}.wcml-wrap{margin-bottom:20px;min-width:900px}.wcml-wrap .wpml-tabs{margin-top:0}.wcml-wrap .otgs-ico-yes,.wcml-wrap .otgs-ico-ok{color:#51a351}.wcml-wrap .otgs-ico-no,.wcml-wrap .otgs-ico-warning,.wcml-wrap .otgs-ico-delete{color:#9d261d}.wcml-wrap .otgs-ico-edit{color:#3a87ad}.wcml-wrap .otgs-ico-in-progress{color:#ffb800}@media (max-width: 1199px){.wcml-wrap .tablenav.top{height:auto}.wcml-wrap .tablenav.top.wcml-product-translation-filtering .alignright,.wcml-wrap .tablenav.top.wcml-product-translation-filtering .alignleft{float:none;margin-bottom:5px}}[class*="otgs-ico"]:before{font-size:16px}.wcml-tabs{min-width:930px}.wcml-tabs:before,.wcml-tabs:after{content:" ";display:table}.wcml-tabs:after{clear:both}.wcml-tabs .nav-tab{margin-top:5px}@media (max-width: 1350px){.wcml-tabs .nav-tab{margin-left:.2em}}.wcml-tabs .nav-tab [class*="otgs-ico"]:before{font-size:18px}.wcml-section{clear:both;padding:0 0 15px 0;margin:0 0 15px 0;border-bottom:1px solid #ededed;min-width:900px;overflow:hidden}.wcml-section:last-of-type{border:none;margin:0}.wcml-section-content .wcml-section-content-inner{margin:0 0 20px 0;padding:0 0 10px 0;border-bottom:1px solid #ededed;float:left;width:100%}.wcml-section-header{width:300px;float:left}.wcml-section-header h3{font-weight:normal;font-size:1.4em;margin-top:0.7em}.wcml-section-header h3 .wcml-tip:before{vertical-align:top}.wcml-section-content{float:left;width:570px;margin-left:30px}.wcml-section-content-wide{width:-webkit-calc(100% - 360px);width:calc(100% - 360px)}.wcml_products{margin:20px 0;position:relative}.button-wrap,.widefat td .button-wrap{text-align:right;margin:10px 0}.currency_action_update{display:inline-block}.wcml-co-dialog.hidden{display:none}.wcml-co-dialog .wpml-form-row label{width:195px;text-align:left}.wcml-co-dialog input,.wcml-co-dialog select{width:145px}.wcml-co-dialog .currency_code label{width:100px}.wcml-co-dialog .currency_code select{width:auto}.wcml-co-dialog .wcml-co-exchange-rate label{width:100px}.wcml-co-dialog .wcml-co-exchange-rate input{margin:0 !important;width:70px}.wcml-co-dialog .wcml-co-exchange-rate .wcml-co-set-rate{display:inline-block;padding:4px 15px 7px 15px}.wcml-co-dialog .wcml-co-exchange-rate small{display:block}.wcml-co-dialog .wcml-co-preview label{width:120px;vertical-align:middle}.wcml-co-dialog .wcml-co-preview .wcml-co-preview-value{display:inline-block;padding:7px 15px;border:1px solid #555;font-size:1.4em;font-weight:bold;vertical-align:middle;margin:15px 0}table.widefat.currency_table{float:left;width:300px;border-right:none}table.widefat.currency_table td.wcml-col-currency,table.widefat.currency_table td.wcml-col-rate{padding-top:7px;padding-bottom:0;vertical-align:top}table.widefat.currency_table td.wcml-col-currency .truncate{max-width:145px;display:block}table.widefat.currency_table td.wcml-col-currency small{display:block}table.widefat.currency_table td.wcml-col-edit a{position:relative;top:-3px}table.widefat.currency_table td.wcml-col-rate{font-size:.85em}table.widefat.currency_table td.wcml-col-rate .truncate{max-width:75px;display:block}table.widefat.currency_delete_table{float:left;width:50px;border-left:none;clear:none}table.widefat.currency_delete_table td.wcml-col-delete{vertical-align:middle;text-align:center}table.widefat.currency_delete_table td.wcml-col-delete:first-child{border-left:1px solid #e5e5e5}.currency_value .wcml-error,.wcml-error{font-size:10px;color:#f00;display:inline-block}.trbl_variables_products{padding:10px;border:1px solid #8cceea;background-color:#eff8fc;border-radius:5px}.trbl_variables_products label span{font-weight:bold}.wcml_trbl_warning{padding:10px;margin-bottom:10px;border:1px solid #f00;background-color:#ffb7b7;border-radius:5px 5px}#wcml_sync_variations{background-color:#21759b;background-image:-webkit-linear-gradient(top, #2a95c5, #21759b);background-image:linear-gradient(to bottom, #2a95c5, #21759b);border-color:#21759b;border-bottom-color:#1e6a8d;box-shadow:inset 0 1px 0 rgba(120,200,230,0.5);color:#fff;text-decoration:none;text-shadow:0 1px 0 rgba(0,0,0,0.1)}.wcml_duplicate_product_notice td{border-bottom:none !important}.wcml_product_status_text,.prod_parent_text{font-style:italic;color:#9A9A9A}.wcml_no_found_text{text-align:center}.currency_languages{position:relative;text-align:center}.currency_languages:first-child{border-left:1px solid #e5e5e5}.currency_languages ul{margin:0;text-align:center}.currency_languages ul li{margin:0;display:none}.currency_languages ul li.on{display:inline-block}table.widefat.currency_lang_table{border-left:none;border-right:none}.currency_wrap{width:-webkit-calc(100% - 300px - 50px);width:calc(100% - 300px - 50px);float:left;margin-bottom:10px}.currency_inner{overflow-x:auto;overflow-y:visible}.currency_table,.currency_lang_table,.currency_delete_table{clear:none}.currency_table tr,.currency_lang_table tr,.currency_delete_table tr{height:50px}.currency_lang_table th{text-align:center}.currency_lang_table td{vertical-align:middle}.currency_lang_table.widefat td{padding-right:0;padding-left:0}.default_currency select{font-size:9px;height:24px;margin:0;margin-right:2px;padding:2px 0}.default_currency td{border-top:1px solid #e5e5e5}.default_currency .inf_message{font-size:10px;font-style:italic;color:#9A9A9A}#wcml_currencies_order{display:block;overflow:hidden;width:100%}#wcml_currencies_order li{float:left;margin:0 8px 0 0;padding:2px 8px;border:1px solid #DFDFDF;border-radius:2px;background:-webkit-linear-gradient(bottom, #ECECEC, #F9F9F9) repeat scroll 0 0 #F1F1F1;background:linear-gradient(to top, #ECECEC, #F9F9F9) repeat scroll 0 0 #F1F1F1;cursor:move}.wcml_currencies_order_ajx_resp{padding-top:5px;color:#E68A00}.explanation-text{color:#999}input[name="wcml_curr_template"]{width:100%}.wcml_curr_style label{line-height:30px}.wcml-currency-preview{margin:15px 0 30px;display:inline-block}.wcml_product_name{line-height:20px}.wcml_prod_filters{float:left}.wcml_miss_lang p:first-child{float:left}#display_custom_prices_select{display:inline-block;width:100%}.edit_slug_input,.edit_slug_hide_link{display:none}.wcml-tip{cursor:help;color:#555}.wcml-products a{cursor:pointer}@media (max-width: 782px){.column-product_cat,.column-product_tag,.column-product_type{display:none}}.wcml-link-troubleshooting{margin-top:7px}.wcml-status-list li{padding-left:25px;margin-bottom:30px}.wcml-status-list li ul li{margin-bottom:3.5px}.wcml-status-list.wcml-plugins-status-list li,.wcml-status-list.wcml-tax-translation-list li{margin-bottom:15px}.wcml-status-list [class*="otgs-ico"]:not(.otgs-ico-help){margin-left:-25px;margin-right:5px;vertical-align:baseline}.wcml-status-list .button-secondary{vertical-align:middle}.wcml-status-list small{display:block}.wcml-lang-list{margin:7px 0}.wcml-lang-list .wpml-title-flag{margin-left:-25px;margin-right:5px}.wcml-dismiss-warning{position:relative;float:right;padding:0;text-decoration:none;outline:none}.wcml-dismiss-warning:active{outline:none}.wcml-notice{background:#fff;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);margin:5px 0 15px;padding:1px 12px;position:relative}.wcml-notice p{margin:.5em 0;padding:2px}.otgs-is-dismissible{position:relative;padding-right:38px}.otgs-is-dismissible .notice-dismiss{text-decoration:none}.otgs-is-dismissible p [class*="button-"]{margin:-5px 5px}.wcml_tt_spinner{margin-right:15px;display:none}
|
res/css/options-permalink.css
CHANGED
@@ -1,13 +1,10 @@
|
|
1 |
.options-permalink-php .translation_controls{
|
2 |
margin-top:4px;
|
3 |
width:25em;
|
4 |
-
text-align:right;
|
5 |
}
|
6 |
.translation_controls .select2-container{
|
7 |
-
text-align: left;
|
8 |
max-width: 50%;
|
9 |
-
|
10 |
-
float: left;
|
11 |
}
|
12 |
|
13 |
.options-permalink-php .select2-container .select2-choice .select2-arrow b:after{
|
1 |
.options-permalink-php .translation_controls{
|
2 |
margin-top:4px;
|
3 |
width:25em;
|
|
|
4 |
}
|
5 |
.translation_controls .select2-container{
|
|
|
6 |
max-width: 50%;
|
7 |
+
margin-right: 10px;
|
|
|
8 |
}
|
9 |
|
10 |
.options-permalink-php .select2-container .select2-choice .select2-arrow b:after{
|
res/css/wcml-setup.css
CHANGED
@@ -177,6 +177,7 @@ body {
|
|
177 |
color: #ccc;
|
178 |
width: 100%;
|
179 |
display: -ms-inline-flexbox;
|
|
|
180 |
display: inline-flex
|
181 |
}
|
182 |
.wcml-setup-steps li {
|
177 |
color: #ccc;
|
178 |
width: 100%;
|
179 |
display: -ms-inline-flexbox;
|
180 |
+
display: -webkit-inline-box;
|
181 |
display: inline-flex
|
182 |
}
|
183 |
.wcml-setup-steps li {
|
res/js/multi-currency.js
CHANGED
@@ -3,7 +3,7 @@ jQuery( function($){
|
|
3 |
|
4 |
WCML_Multi_Currency = {
|
5 |
|
6 |
-
|
7 |
|
8 |
init: function(){
|
9 |
|
@@ -91,11 +91,22 @@ jQuery( function($){
|
|
91 |
delete_currency: function(e){
|
92 |
|
93 |
e.preventDefault();
|
94 |
-
|
95 |
var currency = $(this).data('currency');
|
96 |
var currency_name = $(this).data('currency_name');
|
97 |
var currency_symbol = $(this).data('currency_symbol');
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
$('#currency_row_' + currency + ' .currency_action_update').hide();
|
100 |
var ajaxLoader = $('<span class="spinner" style="visibility: visible;margin:0;">');
|
101 |
$(this).hide();
|
@@ -119,6 +130,11 @@ jQuery( function($){
|
|
119 |
$('#wcml_currency_options_code_').prepend('<option data-symbol="' + currency_symbol + '" value="' + currency + '">' + currency_name + '</option>');
|
120 |
$('#wcml_currency_options_code_').val(currency).trigger('change');
|
121 |
|
|
|
|
|
|
|
|
|
|
|
122 |
WCML_Multi_Currency.currency_switcher_preview();
|
123 |
},
|
124 |
done: function() {
|
@@ -158,6 +174,8 @@ jQuery( function($){
|
|
158 |
success: function(response){
|
159 |
parent.dialog('close');
|
160 |
|
|
|
|
|
161 |
if( $('#currency_row_' + currency).length == 0 ) {
|
162 |
|
163 |
var tr = $('#currency-table tr.wcml-row-currency:last').clone();
|
@@ -179,6 +197,11 @@ jQuery( function($){
|
|
179 |
$(this).attr('data-currency', currency);
|
180 |
});
|
181 |
|
|
|
|
|
|
|
|
|
|
|
182 |
var tr = $('#currency-delete-table tr.wcml-row-currency-del:last').clone();
|
183 |
tr.attr('id', 'currency_row_del_' + currency);
|
184 |
|
@@ -240,7 +263,7 @@ jQuery( function($){
|
|
240 |
}).pointer('open');
|
241 |
},
|
242 |
|
243 |
-
|
244 |
|
245 |
if( WCML_Multi_Currency.is_update_currency_lang_in_progress() ) return false;
|
246 |
|
@@ -263,8 +286,7 @@ jQuery( function($){
|
|
263 |
|
264 |
var lang = $(this).data('language');
|
265 |
|
266 |
-
if(
|
267 |
-
alert($('#wcml_warn_disable_language_massage').val());
|
268 |
$(this).removeClass('spinner').addClass('otgs-ico-yes');
|
269 |
return;
|
270 |
}
|
@@ -280,9 +302,26 @@ jQuery( function($){
|
|
280 |
|
281 |
},
|
282 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
is_update_currency_lang_in_progress: function(){
|
284 |
var is =
|
285 |
-
|
286 |
&& WCML_Multi_Currency._update_currency_lang_sync_flag == 1;
|
287 |
|
288 |
return is;
|
@@ -484,7 +523,7 @@ jQuery( function($){
|
|
484 |
}
|
485 |
|
486 |
var preview = format.replace(/\{symbol\}/, symbol).replace(/\{thousand_sep\}/, thousand_sep).replace(
|
487 |
-
|
488 |
|
489 |
parent.find('.wcml-co-preview-value').html( preview );
|
490 |
|
3 |
|
4 |
WCML_Multi_Currency = {
|
5 |
|
6 |
+
_currency_languages_saving : 0,
|
7 |
|
8 |
init: function(){
|
9 |
|
91 |
delete_currency: function(e){
|
92 |
|
93 |
e.preventDefault();
|
94 |
+
var is_return = false;
|
95 |
var currency = $(this).data('currency');
|
96 |
var currency_name = $(this).data('currency_name');
|
97 |
var currency_symbol = $(this).data('currency_symbol');
|
98 |
|
99 |
+
$( '.currency_lang_table .wcml-row-currency-lang:first .currency_languages').each( function(){
|
100 |
+
if( !WCML_Multi_Currency.check_currency_language( $(this).find('li').data('lang'), currency ) ){
|
101 |
+
is_return = true;
|
102 |
+
return false;
|
103 |
+
}
|
104 |
+
});
|
105 |
+
|
106 |
+
if( is_return ){
|
107 |
+
return;
|
108 |
+
}
|
109 |
+
|
110 |
$('#currency_row_' + currency + ' .currency_action_update').hide();
|
111 |
var ajaxLoader = $('<span class="spinner" style="visibility: visible;margin:0;">');
|
112 |
$(this).hide();
|
130 |
$('#wcml_currency_options_code_').prepend('<option data-symbol="' + currency_symbol + '" value="' + currency + '">' + currency_name + '</option>');
|
131 |
$('#wcml_currency_options_code_').val(currency).trigger('change');
|
132 |
|
133 |
+
//remove from default currency list
|
134 |
+
$('#currency-lang-table').find('tr.default_currency select').each( function(){
|
135 |
+
$(this).find("option[value='"+currency+"']").remove();
|
136 |
+
});
|
137 |
+
|
138 |
WCML_Multi_Currency.currency_switcher_preview();
|
139 |
},
|
140 |
done: function() {
|
174 |
success: function(response){
|
175 |
parent.dialog('close');
|
176 |
|
177 |
+
WCML_Multi_Currency.currency_switcher_preview();
|
178 |
+
|
179 |
if( $('#currency_row_' + currency).length == 0 ) {
|
180 |
|
181 |
var tr = $('#currency-table tr.wcml-row-currency:last').clone();
|
197 |
$(this).attr('data-currency', currency);
|
198 |
});
|
199 |
|
200 |
+
//add to default currency list
|
201 |
+
$('#currency-lang-table').find('tr.default_currency select').each( function(){
|
202 |
+
$(this).append('<option value="'+currency+'">'+currency+'</option>');
|
203 |
+
});
|
204 |
+
|
205 |
var tr = $('#currency-delete-table tr.wcml-row-currency-del:last').clone();
|
206 |
tr.attr('id', 'currency_row_del_' + currency);
|
207 |
|
263 |
}).pointer('open');
|
264 |
},
|
265 |
|
266 |
+
enable_currency_for_language: function(e){
|
267 |
|
268 |
if( WCML_Multi_Currency.is_update_currency_lang_in_progress() ) return false;
|
269 |
|
286 |
|
287 |
var lang = $(this).data('language');
|
288 |
|
289 |
+
if( !WCML_Multi_Currency.check_currency_language( lang ) ){
|
|
|
290 |
$(this).removeClass('spinner').addClass('otgs-ico-yes');
|
291 |
return;
|
292 |
}
|
302 |
|
303 |
},
|
304 |
|
305 |
+
check_currency_language: function( lang, currency ){
|
306 |
+
|
307 |
+
var elem = $( '#currency-lang-table a.otgs-ico-yes[data-language="'+lang+'"]' );
|
308 |
+
|
309 |
+
if( currency ){
|
310 |
+
elem = $( '#currency-lang-table a.otgs-ico-yes[data-language="'+lang+'"]:not([data-currency="'+currency+'"]' );
|
311 |
+
}
|
312 |
+
|
313 |
+
if( elem.length == 0 ){
|
314 |
+
alert( $( '#wcml_warn_disable_language_massage' ).val() );
|
315 |
+
return false;
|
316 |
+
}
|
317 |
+
|
318 |
+
return true;
|
319 |
+
|
320 |
+
},
|
321 |
+
|
322 |
is_update_currency_lang_in_progress: function(){
|
323 |
var is =
|
324 |
+
( typeof WCML_Multi_Currency._update_currency_lang_sync_flag != 'undefined' )
|
325 |
&& WCML_Multi_Currency._update_currency_lang_sync_flag == 1;
|
326 |
|
327 |
return is;
|
523 |
}
|
524 |
|
525 |
var preview = format.replace(/\{symbol\}/, symbol).replace(/\{thousand_sep\}/, thousand_sep).replace(
|
526 |
+
/\{decimal_sep\}/, decimal_sep).replace(/\{decimals\}/, decimals);
|
527 |
|
528 |
parent.find('.wcml-co-preview-value').html( preview );
|
529 |
|
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("click",'input[name="currency_switcher_style"]',WCML_Multi_Currency.update_currency_switcher_style),a(document).on("change","#wcml_curr_sel_orientation",WCML_Multi_Currency.set_currency_switcher_orientation),a(document).on("keyup",'input[name="wcml_curr_template"]',WCML_Multi_Currency.setup_currency_switcher_template_keyup),a(document).on("change",'input[name="wcml_curr_template"]',WCML_Multi_Currency.setup_currency_switcher_template_change),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("#wcml_mc_options").length&&(WCML_Multi_Currency.wcml_mc_form_submitted=!1,WCML_Multi_Currency.read_form_fields_status(),window.onbeforeunload=function(b){return!WCML_Multi_Currency.wcml_mc_form_submitted&&WCML_Multi_Currency.form_fields_changed()||WCML_Multi_Currency.is_update_currency_lang_in_progress()?a("#wcml_warn_message").val():void 0},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").fadeIn(),a("#multi-currency-per-language-details").fadeIn()):(a("#multi-currency-per-language-details").fadeOut(),a("#currency-switcher").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=a(this).data("currency"),d=a(this).data("currency_name"),e=a(this).data("currency_symbol");a("#currency_row_"+c+" .currency_action_update").hide();var f=a('<span class="spinner" style="visibility: visible;margin:0;">');return a(this).hide(),a(this).parent().append(f).show(),a.ajax({type:"post",url:ajaxurl,data:{action:"wcml_delete_currency",wcml_nonce:a("#del_currency_nonce").val(),code:c},success:function(b){a("#currency_row_"+c).remove(),a("#currency_row_langs_"+c).remove(),a("#currency_row_del_"+c).remove(),a("#wcml_currencies_order .wcml_currencies_order_"+c).remove(),a("#wcml_currency_options_code_").prepend('<option data-symbol="'+e+'" value="'+c+'">'+d+"</option>"),a("#wcml_currency_options_code_").val(c).trigger("change"),WCML_Multi_Currency.currency_switcher_preview()},done:function(){f.remove()}}),!1},save_currency:function(){var b=a(this).closest(".wcml-dialog-container"),c=WCML_Multi_Currency.check_on_numeric(b,".ext_rate"),d=WCML_Multi_Currency.check_on_numeric(b,".currency_option_decimals"),e=WCML_Multi_Currency.check_on_numeric(b,".abstract_amount");if(c||d||e)return!1;a(".wcml-currency-options-dialog :submit, .wcml-currency-options-dialog :button").prop("disabled",!0);var f=b.find('[name="currency_options[code]"]').val(),g=a('<span class="spinner" style="visibility:visible;position:absolute;margin-left:10px;"></span>');return g.show(),a(this).parent().prepend(g),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.dialog("close"),0==a("#currency_row_"+f).length){var d=a("#currency-table tr.wcml-row-currency:last").clone();d.attr("id","currency_row_"+f);var e=d.find(".wcml-col-edit a");e.attr("data-content","wcml_currency_options_"+f),e.attr("data-currency",f),e.data("dialog","wcml_currency_options_"+f),e.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_"+f),a("#currency-lang-table").find("tr.default_currency").before(d),d.find(".on a").each(function(){a(this).attr("data-currency",f)});var d=a("#currency-delete-table tr.wcml-row-currency-del:last").clone();d.attr("id","currency_row_del_"+f);var g=d.find(".delete_currency");g.removeClass("hidden"),g.attr("data-currency",f),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_"+f+" .wcml-col-currency").html(c.currency_name_formatted),a("#currency_row_"+f+" .wcml-col-rate").html(c.currency_meta_info),a("#wcml_currency_options_"+f).remove(),a("#wcml_mc_options").before(c.currency_options),a('#wcml_currency_options_code_ option[value="'+f+'"]').remove()}}),!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)},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(0==a('#currency-lang-table a.otgs-ico-yes[data-language="'+c+'"]').length)return alert(a("#wcml_warn_disable_language_massage").val()),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()},is_update_currency_lang_in_progress:function(){var a="undefined"!=typeof WCML_Multi_Currency._update_currency_lang_sync_flag&&1==WCML_Multi_Currency._update_currency_lang_sync_flag;return a},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(){a(".wcml_currencies_order_ajx_resp").fadeIn();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(a){fadeInAjxResp(".wcml_currencies_order_ajx_resp",a.message),WCML_Multi_Currency.currency_switcher_preview()}})}})},currency_switcher_preview:function(){var b=a('input[name="wcml_curr_template"]').val();b||(b=a("#currency_switcher_default").val());var c=a('<span class="spinner" style="visibility: visible;">');a("#wcml_curr_sel_preview").html(c),a.ajax({type:"POST",url:ajaxurl,data:{action:"wcml_currencies_switcher_preview",wcml_nonce:a("#wcml_currencies_switcher_preview_nonce").val(),switcher_type:a('input[name="currency_switcher_style"]:checked').val(),orientation:a("#wcml_curr_sel_orientation").val(),template:b},success:function(b){a("#wcml_curr_sel_preview").html(b)}})},update_currency_switcher_style:function(b){a(this).closest("ul").find("select").hide(),a(this).closest("li").find("select").show(),WCML_Multi_Currency.currency_switcher_preview()},set_currency_switcher_orientation:function(a){WCML_Multi_Currency.currency_switcher_preview()},setup_currency_switcher_template_keyup:function(b){discard=!0,a(this).closest(".wcml-section").find(".button-wrap input").css("border-color","#1e8cbe"),WCML_Multi_Currency.currency_switcher_preview()},setup_currency_switcher_template_change:function(b){a(this).val()||a('input[name="wcml_curr_template"]').val(a("#currency_switcher_default").val())},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()}},WCML_Multi_Currency.init()});
|
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("click",'input[name="currency_switcher_style"]',WCML_Multi_Currency.update_currency_switcher_style),a(document).on("change","#wcml_curr_sel_orientation",WCML_Multi_Currency.set_currency_switcher_orientation),a(document).on("keyup",'input[name="wcml_curr_template"]',WCML_Multi_Currency.setup_currency_switcher_template_keyup),a(document).on("change",'input[name="wcml_curr_template"]',WCML_Multi_Currency.setup_currency_switcher_template_change),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("#wcml_mc_options").length&&(WCML_Multi_Currency.wcml_mc_form_submitted=!1,WCML_Multi_Currency.read_form_fields_status(),window.onbeforeunload=function(b){return!WCML_Multi_Currency.wcml_mc_form_submitted&&WCML_Multi_Currency.form_fields_changed()||WCML_Multi_Currency.is_update_currency_lang_in_progress()?a("#wcml_warn_message").val():void 0},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").fadeIn(),a("#multi-currency-per-language-details").fadeIn()):(a("#multi-currency-per-language-details").fadeOut(),a("#currency-switcher").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(){return WCML_Multi_Currency.check_currency_language(a(this).find("li").data("lang"),d)?void 0:(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()}),WCML_Multi_Currency.currency_switcher_preview()},done:function(){g.remove()}}),!1}},save_currency:function(){var b=a(this).closest(".wcml-dialog-container"),c=WCML_Multi_Currency.check_on_numeric(b,".ext_rate"),d=WCML_Multi_Currency.check_on_numeric(b,".currency_option_decimals"),e=WCML_Multi_Currency.check_on_numeric(b,".abstract_amount");if(c||d||e)return!1;a(".wcml-currency-options-dialog :submit, .wcml-currency-options-dialog :button").prop("disabled",!0);var f=b.find('[name="currency_options[code]"]').val(),g=a('<span class="spinner" style="visibility:visible;position:absolute;margin-left:10px;"></span>');return g.show(),a(this).parent().prepend(g),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.dialog("close"),0==a("#currency_row_"+f).length){var d=a("#currency-table tr.wcml-row-currency:last").clone();d.attr("id","currency_row_"+f);var e=d.find(".wcml-col-edit a");e.attr("data-content","wcml_currency_options_"+f),e.attr("data-currency",f),e.data("dialog","wcml_currency_options_"+f),e.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_"+f),a("#currency-lang-table").find("tr.default_currency").before(d),d.find(".on a").each(function(){a(this).attr("data-currency",f)}),a("#currency-lang-table").find("tr.default_currency select").each(function(){a(this).append('<option value="'+f+'">'+f+"</option>")});var d=a("#currency-delete-table tr.wcml-row-currency-del:last").clone();d.attr("id","currency_row_del_"+f);var g=d.find(".delete_currency");g.removeClass("hidden"),g.attr("data-currency",f),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_"+f+" .wcml-col-currency").html(c.currency_name_formatted),a("#currency_row_"+f+" .wcml-col-rate").html(c.currency_meta_info),a("#wcml_currency_options_"+f).remove(),a("#wcml_mc_options").before(c.currency_options),a('#wcml_currency_options_code_ option[value="'+f+'"]').remove()}}),!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)},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()},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([data-currency="'+c+'"]')),0==d.length?(alert(a("#wcml_warn_disable_language_massage").val()),!1):!0},is_update_currency_lang_in_progress:function(){var a="undefined"!=typeof WCML_Multi_Currency._update_currency_lang_sync_flag&&1==WCML_Multi_Currency._update_currency_lang_sync_flag;return a},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(){a(".wcml_currencies_order_ajx_resp").fadeIn();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(a){fadeInAjxResp(".wcml_currencies_order_ajx_resp",a.message),WCML_Multi_Currency.currency_switcher_preview()}})}})},currency_switcher_preview:function(){var b=a('input[name="wcml_curr_template"]').val();b||(b=a("#currency_switcher_default").val());var c=a('<span class="spinner" style="visibility: visible;">');a("#wcml_curr_sel_preview").html(c),a.ajax({type:"POST",url:ajaxurl,data:{action:"wcml_currencies_switcher_preview",wcml_nonce:a("#wcml_currencies_switcher_preview_nonce").val(),switcher_type:a('input[name="currency_switcher_style"]:checked').val(),orientation:a("#wcml_curr_sel_orientation").val(),template:b},success:function(b){a("#wcml_curr_sel_preview").html(b)}})},update_currency_switcher_style:function(b){a(this).closest("ul").find("select").hide(),a(this).closest("li").find("select").show(),WCML_Multi_Currency.currency_switcher_preview()},set_currency_switcher_orientation:function(a){WCML_Multi_Currency.currency_switcher_preview()},setup_currency_switcher_template_keyup:function(b){discard=!0,a(this).closest(".wcml-section").find(".button-wrap input").css("border-color","#1e8cbe"),WCML_Multi_Currency.currency_switcher_preview()},setup_currency_switcher_template_change:function(b){a(this).val()||a('input[name="wcml_curr_template"]').val(a("#currency_switcher_default").val())},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()}},WCML_Multi_Currency.init()});
|
res/scss/management.scss
CHANGED
@@ -203,6 +203,10 @@ table.widefat.currency_table {
|
|
203 |
|
204 |
td.wcml-col-rate {
|
205 |
font-size: .85em;
|
|
|
|
|
|
|
|
|
206 |
}
|
207 |
}
|
208 |
|
203 |
|
204 |
td.wcml-col-rate {
|
205 |
font-size: .85em;
|
206 |
+
.truncate {
|
207 |
+
max-width: 75px;
|
208 |
+
display: block;
|
209 |
+
}
|
210 |
}
|
211 |
}
|
212 |
|
templates/multi-currency/custom-currency-options.twig
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
<select name="currency_options[code]" id="wcml_currency_options_code_{{ args.currency_code }}">
|
11 |
{% for code, name in args.wc_currencies %}
|
12 |
{% if attribute(args.currencies, code) is null and code != args.default_currency %}
|
13 |
-
<option value="{{ code }}" {% if code == args.currency_code %}selected="selected"{% endif %} data-symbol="{{ get_currency_symbol(code) }}" >{{ name|raw }}</option>
|
14 |
{% endif %}
|
15 |
{% endfor %}
|
16 |
</select>
|
10 |
<select name="currency_options[code]" id="wcml_currency_options_code_{{ args.currency_code }}">
|
11 |
{% for code, name in args.wc_currencies %}
|
12 |
{% if attribute(args.currencies, code) is null and code != args.default_currency %}
|
13 |
+
<option value="{{ code }}" {% if code == args.currency_code %}selected="selected"{% endif %} data-symbol="{{ get_currency_symbol(code) }}" >{{ name|raw }} ({{ get_currency_symbol(code)|raw }} )</option>
|
14 |
{% endif %}
|
15 |
{% endfor %}
|
16 |
</select>
|
templates/multi-currency/multi-currency.twig
CHANGED
@@ -68,7 +68,7 @@
|
|
68 |
<span class="truncate">{{ attribute(wc_currencies, wc_currency) }}</span>
|
69 |
<small>{{ positioned_price|raw }}</small>
|
70 |
</td>
|
71 |
-
<td class="wcml-col-rate">{{ strings.currencies_table.default }}</td>
|
72 |
<td class="wcml-col-edit">
|
73 |
<a href="#" title="{{ strings.currencies_table.edit }}" class="edit_currency js-wcml-dialog-trigger hidden" data-height="530" data-width="480">
|
74 |
<i class="otgs-ico-edit" title="{{ strings.currencies_table.edit }}"></i>
|
68 |
<span class="truncate">{{ attribute(wc_currencies, wc_currency) }}</span>
|
69 |
<small>{{ positioned_price|raw }}</small>
|
70 |
</td>
|
71 |
+
<td class="wcml-col-rate"> <span class="truncate">{{ strings.currencies_table.default }}</span></td>
|
72 |
<td class="wcml-col-edit">
|
73 |
<a href="#" title="{{ strings.currencies_table.edit }}" class="edit_currency js-wcml-dialog-trigger hidden" data-height="530" data-width="480">
|
74 |
<i class="otgs-ico-edit" title="{{ strings.currencies_table.edit }}"></i>
|
wpml-config.xml
CHANGED
@@ -1,125 +1,135 @@
|
|
1 |
-
<wpml-config>
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
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 |
-
<
|
69 |
-
<
|
70 |
-
<
|
71 |
-
|
72 |
-
|
73 |
-
<
|
74 |
-
|
75 |
-
|
76 |
-
<key name="
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
<key name="
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
<key name="
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
<key name="
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
<key name="
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<wpml-config>
|
2 |
+
<custom-fields>
|
3 |
+
<custom-field action="copy">_backorders</custom-field>
|
4 |
+
<custom-field action="translate">_crosssell_ids</custom-field>
|
5 |
+
<custom-field action="copy">_default_attributes</custom-field>
|
6 |
+
<custom-field action="copy">_download_limit</custom-field>
|
7 |
+
<custom-field action="copy">_download_expiry</custom-field>
|
8 |
+
<custom-field action="copy">_download_type</custom-field>
|
9 |
+
<custom-field action="copy">_downloadable</custom-field>
|
10 |
+
<custom-field action="translate">_file_paths</custom-field>
|
11 |
+
<custom-field action="translate">_downloadable_files</custom-field>
|
12 |
+
<custom-field action="copy">_featured</custom-field>
|
13 |
+
<custom-field action="copy">_manage_stock</custom-field>
|
14 |
+
<custom-field action="copy">_sku</custom-field>
|
15 |
+
<custom-field action="copy">_stock</custom-field>
|
16 |
+
<custom-field action="copy">_stock_status</custom-field>
|
17 |
+
<custom-field action="copy">_sold_individually</custom-field>
|
18 |
+
<custom-field action="copy">_subscription_length</custom-field>
|
19 |
+
<custom-field action="copy">_subscription_period</custom-field>
|
20 |
+
<custom-field action="copy">_subscription_period_interval</custom-field>
|
21 |
+
<custom-field action="copy">_subscription_price</custom-field>
|
22 |
+
<custom-field action="copy">_subscription_sign_up_fee</custom-field>
|
23 |
+
<custom-field action="copy">_subscription_trial_length</custom-field>
|
24 |
+
<custom-field action="copy">_subscription_trial_period</custom-field>
|
25 |
+
<custom-field action="copy">_tax_class</custom-field>
|
26 |
+
<custom-field action="copy">_tax_status</custom-field>
|
27 |
+
<custom-field action="translate">_upsell_ids</custom-field>
|
28 |
+
<custom-field action="copy">_virtual</custom-field>
|
29 |
+
<custom-field action="copy">_visibility</custom-field>
|
30 |
+
<custom-field action="copy">_weight</custom-field>
|
31 |
+
<custom-field action="copy">_width</custom-field>
|
32 |
+
<custom-field action="copy">_height</custom-field>
|
33 |
+
<custom-field action="copy">_length</custom-field>
|
34 |
+
<custom-field action="copy">_woocommerce_exclude_image</custom-field>
|
35 |
+
<custom-field action="copy">total_sales</custom-field>
|
36 |
+
<custom-field action="translate">_product_url</custom-field>
|
37 |
+
<custom-field action="translate">_button_text</custom-field>
|
38 |
+
<custom-field action="translate">_purchase_note</custom-field>
|
39 |
+
<custom-field action="ignore">_wcml_custom_prices_status</custom-field>
|
40 |
+
<custom-field action="ignore">_min_price_variation_id</custom-field>
|
41 |
+
<custom-field action="ignore">_min_regular_price_variation_id</custom-field>
|
42 |
+
<custom-field action="ignore">_min_sale_price_variation_id</custom-field>
|
43 |
+
<custom-field action="ignore">_max_price_variation_id</custom-field>
|
44 |
+
<custom-field action="ignore">_max_regular_price_variation_id</custom-field>
|
45 |
+
<custom-field action="ignore">_max_sale_price_variation_id</custom-field>
|
46 |
+
<custom-field action="ignore">attr_label_translations</custom-field>
|
47 |
+
<custom-field action="copy">_per_product_pricing_active</custom-field>
|
48 |
+
<custom-field action="copy">_pricing_rules</custom-field>
|
49 |
+
<custom-field action="copy">_regular_price</custom-field>
|
50 |
+
<custom-field action="copy">_sale_price</custom-field>
|
51 |
+
<custom-field action="copy">_price</custom-field>
|
52 |
+
<custom-field action="copy">_min_variation_regular_price</custom-field>
|
53 |
+
<custom-field action="copy">_min_variation_sale_price</custom-field>
|
54 |
+
<custom-field action="copy">_min_variation_price</custom-field>
|
55 |
+
<custom-field action="copy">_max_variation_regular_price</custom-field>
|
56 |
+
<custom-field action="copy">_max_variation_sale_price</custom-field>
|
57 |
+
<custom-field action="copy">_max_variation_price</custom-field>
|
58 |
+
<custom-field action="copy">_sale_price_dates_from</custom-field>
|
59 |
+
<custom-field action="copy">_sale_price_dates_to</custom-field>
|
60 |
+
<custom-field action="copy">_wcml_schedule</custom-field>
|
61 |
+
</custom-fields>
|
62 |
+
<custom-types>
|
63 |
+
<custom-type translate="1">product</custom-type>
|
64 |
+
<custom-type translate="1">product_variation</custom-type>
|
65 |
+
<custom-type translate="0">shop_coupon</custom-type>
|
66 |
+
<custom-type translate="0">shop_order</custom-type>
|
67 |
+
</custom-types>
|
68 |
+
<taxonomies>
|
69 |
+
<taxonomy translate="1">product_cat</taxonomy>
|
70 |
+
<taxonomy translate="1">product_tag</taxonomy>
|
71 |
+
<taxonomy translate="0">product_type</taxonomy>
|
72 |
+
<taxonomy translate="0">shop_order_status</taxonomy>
|
73 |
+
<taxonomy translate="1">product_shipping_class</taxonomy>
|
74 |
+
</taxonomies>
|
75 |
+
<admin-texts>
|
76 |
+
<key name="woocommerce_shop_page_title" />
|
77 |
+
<key name="woocommerce_email_footer_text" />
|
78 |
+
<key name="woocommerce_new_order_settings">
|
79 |
+
<key name="subject" />
|
80 |
+
<key name="heading" />
|
81 |
+
</key>
|
82 |
+
<key name="woocommerce_customer_completed_order_settings">
|
83 |
+
<key name="subject" />
|
84 |
+
<key name="heading" />
|
85 |
+
<key name="subject_downloadable" />
|
86 |
+
<key name="heading_downloadable" />
|
87 |
+
</key>
|
88 |
+
<key name="woocommerce_customer_invoice_settings">
|
89 |
+
<key name="subject" />
|
90 |
+
<key name="heading" />
|
91 |
+
<key name="subject_paid" />
|
92 |
+
<key name="heading_paid" />
|
93 |
+
</key>
|
94 |
+
<key name="woocommerce_customer_new_account_settings">
|
95 |
+
<key name="subject" />
|
96 |
+
<key name="heading" />
|
97 |
+
</key>
|
98 |
+
<key name="woocommerce_customer_note_settings">
|
99 |
+
<key name="subject" />
|
100 |
+
<key name="heading" />
|
101 |
+
</key>
|
102 |
+
<key name="woocommerce_customer_reset_password_settings">
|
103 |
+
<key name="subject" />
|
104 |
+
<key name="heading" />
|
105 |
+
</key>
|
106 |
+
<key name="woocommerce_customer_processing_order_settings">
|
107 |
+
<key name="subject" />
|
108 |
+
<key name="heading" />
|
109 |
+
</key>
|
110 |
+
<key name="woocommerce_cancelled_order_settings">
|
111 |
+
<key name="subject" />
|
112 |
+
<key name="heading" />
|
113 |
+
</key>
|
114 |
+
<key name="woocommerce_failed_order_settings">
|
115 |
+
<key name="subject" />
|
116 |
+
<key name="heading" />
|
117 |
+
</key>
|
118 |
+
<key name="woocommerce_customer_on_hold_order_settings">
|
119 |
+
<key name="subject" />
|
120 |
+
<key name="heading" />
|
121 |
+
</key>
|
122 |
+
<key name="woocommerce_customer_refunded_order_settings">
|
123 |
+
<key name="subject_full" />
|
124 |
+
<key name="heading_full" />
|
125 |
+
<key name="subject_partial" />
|
126 |
+
<key name="heading_partial" />
|
127 |
+
</key>
|
128 |
+
<key name="woocommerce_demo_store_notice"/>
|
129 |
+
<key name="woocommerce_price_thousand_sep"/>
|
130 |
+
<key name="woocommerce_price_decimal_sep"/>
|
131 |
+
<key name="woocommerce_price_display_suffix" />
|
132 |
+
<key name="woocommerce_email_from_name"/>
|
133 |
+
<key name="woocommerce_email_from_address" />
|
134 |
+
</admin-texts>
|
135 |
+
</wpml-config>
|
wpml-woocommerce.php
CHANGED
@@ -6,12 +6,12 @@
|
|
6 |
Author: OnTheGoSystems
|
7 |
Author URI: http://www.onthegosystems.com/
|
8 |
Text Domain: woocommerce-multilingual
|
9 |
-
Version: 3.8.
|
10 |
*/
|
11 |
|
12 |
if( defined( 'WCML_VERSION' ) ) return;
|
13 |
|
14 |
-
define( 'WCML_VERSION', '3.8.
|
15 |
define( 'WCML_PLUGIN_PATH', dirname( __FILE__ ) );
|
16 |
define( 'WCML_PLUGIN_FOLDER', basename( WCML_PLUGIN_PATH ) );
|
17 |
define( 'WCML_LOCALE_PATH', WCML_PLUGIN_PATH . '/locale' );
|
6 |
Author: OnTheGoSystems
|
7 |
Author URI: http://www.onthegosystems.com/
|
8 |
Text Domain: woocommerce-multilingual
|
9 |
+
Version: 3.8.5
|
10 |
*/
|
11 |
|
12 |
if( defined( 'WCML_VERSION' ) ) return;
|
13 |
|
14 |
+
define( 'WCML_VERSION', '3.8.5' );
|
15 |
define( 'WCML_PLUGIN_PATH', dirname( __FILE__ ) );
|
16 |
define( 'WCML_PLUGIN_FOLDER', basename( WCML_PLUGIN_PATH ) );
|
17 |
define( 'WCML_LOCALE_PATH', WCML_PLUGIN_PATH . '/locale' );
|