WooCommerce Multilingual – run WooCommerce with WPML - Version 3.9.1

Version Description

  • Fixed a bug related to the stock information not syncing correctly across translations
  • Bug fix: and incorrect value for products out of stock was show on the dashboard
  • Bug fix: the link to edit custom prices was not working for variations
Download this release

Release Info

Developer sergey.r
Plugin Icon 128x128 WooCommerce Multilingual – run WooCommerce with WPML
Version 3.9.1
Comparing to
See all releases

Code changes from version 3.9.0 to 3.9.1

inc/class-wcml-cart.php CHANGED
@@ -201,6 +201,18 @@ class WCML_Cart
201
 
202
  public function translate_cart_subtotal( $cart ) {
203
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  if( apply_filters( 'wcml_calculate_totals_exception', true, $cart ) ){
205
  $cart->calculate_totals();
206
  }
201
 
202
  public function translate_cart_subtotal( $cart ) {
203
 
204
+ if( isset( $_SERVER['REQUEST_URI'] ) ){
205
+ //special case: check if attachment loading
206
+ $attachments = array( 'png', 'jpg', 'jpeg', 'gif', 'js', 'css' );
207
+
208
+ foreach( $attachments as $attachment ){
209
+ $match = preg_match( '/\.'.$attachment.'$/', $_SERVER['REQUEST_URI'] );
210
+ if( !empty( $match ) ){
211
+ return false;
212
+ }
213
+ }
214
+ }
215
+
216
  if( apply_filters( 'wcml_calculate_totals_exception', true, $cart ) ){
217
  $cart->calculate_totals();
218
  }
inc/class-wcml-reports.php CHANGED
@@ -25,12 +25,12 @@ class WCML_Reports{
25
  add_filter( 'woocommerce_reports_get_order_report_data', array( $this, 'combine_report_by_languages' ) );
26
  }
27
 
28
- add_filter( 'woocommerce_report_most_stocked_query_from', array( $this, 'filter_reports_stock_query' ) );
29
- add_filter( 'woocommerce_report_out_of_stock_query_from', array( $this, 'filter_reports_stock_query' ) );
30
- add_filter( 'woocommerce_report_low_in_stock_query_from', array( $this, 'filter_reports_stock_query' ) );
31
-
32
  }
33
 
 
 
 
 
34
  }
35
 
36
  public function filter_reports_query($query){
25
  add_filter( 'woocommerce_reports_get_order_report_data', array( $this, 'combine_report_by_languages' ) );
26
  }
27
 
 
 
 
 
28
  }
29
 
30
+ add_filter( 'woocommerce_report_most_stocked_query_from', array( $this, 'filter_reports_stock_query' ) );
31
+ add_filter( 'woocommerce_report_out_of_stock_query_from', array( $this, 'filter_reports_stock_query' ) );
32
+ add_filter( 'woocommerce_report_low_in_stock_query_from', array( $this, 'filter_reports_stock_query' ) );
33
+
34
  }
35
 
36
  public function filter_reports_query($query){
inc/class-wcml-upgrade.php CHANGED
@@ -15,7 +15,8 @@ class WCML_Upgrade{
15
  '3.7.3',
16
  '3.7.11',
17
  '3.8',
18
- '3.9'
 
19
  );
20
 
21
  function __construct(){
@@ -482,5 +483,39 @@ class WCML_Upgrade{
482
 
483
  }
484
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
485
 
486
  }
15
  '3.7.3',
16
  '3.7.11',
17
  '3.8',
18
+ '3.9',
19
+ '3.9.1',
20
  );
21
 
22
  function __construct(){
483
 
484
  }
485
 
486
+ function upgrade_3_9_1(){
487
+ global $wpdb, $sitepress;
488
+
489
+ $results = $wpdb->get_results("
490
+ SELECT p.ID, t.trid, t.element_type
491
+ FROM {$wpdb->posts} p
492
+ JOIN {$wpdb->prefix}icl_translations t ON t.element_id = p.ID AND t.element_type IN ('post_product', 'post_product_variation')
493
+ WHERE p.post_type in ('product', 'product_variation') AND t.source_language_code IS NULL
494
+ ");
495
+
496
+ foreach( $results as $product ){
497
+
498
+ if( get_post_meta( $product->ID, '_manage_stock', true ) === 'yes' ){
499
+
500
+ $translations = $sitepress->get_element_translations( $product->trid, $product->element_type );
501
+
502
+ $min_stock = false;
503
+
504
+ //collect min stock
505
+ foreach( $translations as $translation ){
506
+ $stock = get_post_meta( $translation->element_id, '_stock', true );
507
+ if( !$min_stock || $stock < $min_stock ){
508
+ $min_stock = $stock;
509
+ }
510
+ }
511
+
512
+ //update stock value
513
+ foreach( $translations as $translation ){
514
+ update_post_meta( $translation->element_id, '_stock', $min_stock );
515
+ }
516
+ }
517
+ }
518
+ }
519
+
520
 
521
  }
inc/class-woocommerce-wpml.php CHANGED
@@ -137,17 +137,18 @@ class woocommerce_wpml {
137
  add_shortcode('currency_switcher', '__return_empty_string');
138
  }
139
 
140
- if( is_admin() ){
141
- $this->troubleshooting = new WCML_Troubleshooting();
142
- $this->links = new WCML_Links( $this, $sitepress );
143
- $this->translation_editor = new WCML_Translation_Editor( $this, $sitepress, $wpdb );
144
- $this->languages_upgrader = new WCML_Languages_Upgrader;
145
- $this->sync_variations_data = new WCML_Synchronize_Variations_Data( $this, $sitepress, $wpdb );
146
- $this->sync_product_data = new WCML_Synchronize_Product_Data( $this, $sitepress, $wpdb );
147
- $this->wcml_products_screen = new WCML_Products_Screen_Options( $sitepress );
148
- $this->wcml_products_screen->init();
149
- new WCML_Pointers();
150
  }
 
 
151
  $this->endpoints = new WCML_Endpoints;
152
  $this->products = new WCML_Products( $this, $sitepress, $wpdb );
153
  $this->store = new WCML_Store_Pages ($this, $sitepress ) ;
137
  add_shortcode('currency_switcher', '__return_empty_string');
138
  }
139
 
140
+ if( is_admin() ) {
141
+ $this->troubleshooting = new WCML_Troubleshooting();
142
+ $this->links = new WCML_Links($this, $sitepress);
143
+ $this->translation_editor = new WCML_Translation_Editor($this, $sitepress, $wpdb);
144
+ $this->languages_upgrader = new WCML_Languages_Upgrader;
145
+ $this->sync_variations_data = new WCML_Synchronize_Variations_Data($this, $sitepress, $wpdb);
146
+ $this->wcml_products_screen = new WCML_Products_Screen_Options($sitepress);
147
+ $this->wcml_products_screen->init();
148
+ new WCML_Pointers();
 
149
  }
150
+
151
+ $this->sync_product_data = new WCML_Synchronize_Product_Data( $this, $sitepress, $wpdb );
152
  $this->endpoints = new WCML_Endpoints;
153
  $this->products = new WCML_Products( $this, $sitepress, $wpdb );
154
  $this->store = new WCML_Store_Pages ($this, $sitepress ) ;
inc/template-classes/multi-currency/class-wcml-custom-prices-ui.php CHANGED
@@ -27,8 +27,8 @@ class WCML_Custom_Prices_UI extends WPML_Templates_Factory {
27
  $model = array(
28
  'product_id' => $this->product_id,
29
  'currencies' => $this->get_currencies_info(),
30
- 'checked_calc_auto' => !isset($this->custom_prices['_wcml_custom_prices_status']) || (isset($this->custom_prices['_wcml_custom_prices_status']) && $this->custom_prices['_wcml_custom_prices_status'][0] == 0)? 'checked="checked"' : ' ' ,
31
- 'checked_calc_manually' => isset($this->custom_prices['_wcml_custom_prices_status']) && $this->custom_prices['_wcml_custom_prices_status'][0] == 1?'checked="checked"':' ',
32
  'wc_currencies' => get_woocommerce_currencies(),
33
  'is_variation' => $this->is_variation,
34
  'html_id' => $this->is_variation ? '['.$this->product_id.']' : '',
27
  $model = array(
28
  'product_id' => $this->product_id,
29
  'currencies' => $this->get_currencies_info(),
30
+ 'checked_calc_auto' => !isset($this->custom_prices['_wcml_custom_prices_status']) || (isset($this->custom_prices['_wcml_custom_prices_status']) && $this->custom_prices['_wcml_custom_prices_status'][0] == 0)? 'checked="checked"' : '' ,
31
+ 'checked_calc_manually' => isset($this->custom_prices['_wcml_custom_prices_status']) && $this->custom_prices['_wcml_custom_prices_status'][0] == 1?'checked="checked"':'',
32
  'wc_currencies' => get_woocommerce_currencies(),
33
  'is_variation' => $this->is_variation,
34
  'html_id' => $this->is_variation ? '['.$this->product_id.']' : '',
inc/translation-editor/class-wcml-synchronize-product-data.php CHANGED
@@ -14,8 +14,21 @@ class WCML_Synchronize_Product_Data{
14
  $this->sitepress = $sitepress;
15
  $this->wpdb = $wpdb;
16
 
17
- // filters to sync variable products
18
- add_action( 'save_post', array( $this, 'sync_post_action' ), 110, 2 ); // After WPML
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  add_action( 'woocommerce_reduce_order_stock', array( $this, 'sync_product_stocks_reduce' ) );
21
  add_action( 'woocommerce_restore_order_stock', array( $this, 'sync_product_stocks_restore' ) );
@@ -23,17 +36,6 @@ class WCML_Synchronize_Product_Data{
23
  add_action( 'woocommerce_variation_set_stock_status', array($this, 'sync_stock_status_for_translations' ), 10, 2);
24
 
25
  add_filter( 'future_product', array( $this, 'set_schedule_for_translations'), 10, 2 );
26
-
27
- add_action( 'icl_pro_translation_completed', array( $this, 'icl_pro_translation_completed' ) );
28
-
29
- add_filter( 'icl_make_duplicate', array( $this, 'icl_make_duplicate'), 110, 4 );
30
- add_action( 'woocommerce_duplicate_product', array( $this, 'woocommerce_duplicate_product' ), 10, 2 );
31
-
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(){
@@ -267,14 +269,25 @@ class WCML_Synchronize_Product_Data{
267
  $order_id = method_exists( 'WC_Order', 'get_id' ) ? $order->get_id() : $order->id;
268
 
269
  foreach( $order->get_items() as $item ) {
270
- if( isset( $item[ 'variation_id' ] ) && $item[ 'variation_id' ] > 0 ){
271
- $trid = $this->sitepress->get_element_trid( $item[ 'variation_id' ], 'post_product_variation' );
 
 
 
 
 
 
 
 
 
 
 
272
  $translations = $this->sitepress->get_element_translations( $trid, 'post_product_variation' );
273
- $ld = $this->sitepress->get_element_language_details( $item[ 'variation_id' ], 'post_product_variation' );
274
  } else {
275
- $trid = $this->sitepress->get_element_trid( $item[ 'product_id' ], 'post_product' );
276
  $translations = $this->sitepress->get_element_translations( $trid, 'post_product' );
277
- $ld = $this->sitepress->get_element_language_details( $item[ 'product_id' ], 'post_product' );
278
  }
279
 
280
  // Process for non-current languages
@@ -290,11 +303,11 @@ class WCML_Synchronize_Product_Data{
290
  $total_sales = get_post_meta($_product->id, 'total_sales', true);
291
 
292
  if( $action == 'reduce'){
293
- $stock = $_product->reduce_stock( $item[ 'qty' ] );
294
- $total_sales += $item[ 'qty' ];
295
  }else{
296
- $stock = $_product->increase_stock( $item[ 'qty' ] );
297
- $total_sales -= $item[ 'qty' ];
298
  }
299
  update_post_meta( $translation->element_id, 'total_sales', $total_sales );
300
  }
14
  $this->sitepress = $sitepress;
15
  $this->wpdb = $wpdb;
16
 
17
+ if( is_admin() ){
18
+ // filters to sync variable products
19
+ add_action( 'save_post', array( $this, 'sync_post_action' ), 110, 2 ); // After WPML
20
+
21
+ add_action( 'icl_pro_translation_completed', array( $this, 'icl_pro_translation_completed' ) );
22
+
23
+ add_filter( 'icl_make_duplicate', array( $this, 'icl_make_duplicate'), 110, 4 );
24
+ add_action( 'woocommerce_duplicate_product', array( $this, 'woocommerce_duplicate_product' ), 10, 2 );
25
+
26
+ //quick & bulk edit
27
+ add_action( 'woocommerce_product_quick_edit_save', array( $this, 'woocommerce_product_quick_edit_save' ) );
28
+ add_action( 'woocommerce_product_bulk_edit_save', array( $this, 'woocommerce_product_quick_edit_save' ) );
29
+
30
+ add_action( 'init', array( $this, 'init' ) );
31
+ }
32
 
33
  add_action( 'woocommerce_reduce_order_stock', array( $this, 'sync_product_stocks_reduce' ) );
34
  add_action( 'woocommerce_restore_order_stock', array( $this, 'sync_product_stocks_restore' ) );
36
  add_action( 'woocommerce_variation_set_stock_status', array($this, 'sync_stock_status_for_translations' ), 10, 2);
37
 
38
  add_filter( 'future_product', array( $this, 'set_schedule_for_translations'), 10, 2 );
 
 
 
 
 
 
 
 
 
 
 
39
  }
40
 
41
  public function init(){
269
  $order_id = method_exists( 'WC_Order', 'get_id' ) ? $order->get_id() : $order->id;
270
 
271
  foreach( $order->get_items() as $item ) {
272
+
273
+ if( $item instanceof WC_Order_Item_Product ){
274
+ $variation_id = $item->get_variation_id();
275
+ $product_id = $item->get_product_id();
276
+ $qty = $item->get_quantity();
277
+ }else{
278
+ $variation_id = isset( $item[ 'variation_id' ] ) ? $item[ 'variation_id' ] : 0;
279
+ $product_id = $item[ 'product_id' ];
280
+ $qty = $item[ 'qty' ];
281
+ }
282
+
283
+ if( $variation_id > 0 ){
284
+ $trid = $this->sitepress->get_element_trid( $variation_id, 'post_product_variation' );
285
  $translations = $this->sitepress->get_element_translations( $trid, 'post_product_variation' );
286
+ $ld = $this->sitepress->get_element_language_details( $variation_id, 'post_product_variation' );
287
  } else {
288
+ $trid = $this->sitepress->get_element_trid( $product_id, 'post_product' );
289
  $translations = $this->sitepress->get_element_translations( $trid, 'post_product' );
290
+ $ld = $this->sitepress->get_element_language_details( $product_id, 'post_product' );
291
  }
292
 
293
  // Process for non-current languages
303
  $total_sales = get_post_meta($_product->id, 'total_sales', true);
304
 
305
  if( $action == 'reduce'){
306
+ $stock = $_product->reduce_stock( $qty );
307
+ $total_sales += $qty;
308
  }else{
309
+ $stock = $_product->increase_stock( $qty );
310
+ $total_sales -= $qty;
311
  }
312
  update_post_meta( $translation->element_id, 'total_sales', $total_sales );
313
  }
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: CMS, woocommerce, commerce, ecommerce, e-commerce, products, WPML, multili
5
  License: GPLv2
6
  Requires at least: 3.9
7
  Tested up to: 4.6.1
8
- Stable tag: 3.9
9
 
10
  Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
11
 
@@ -142,6 +142,11 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
142
 
143
  == Changelog ==
144
 
 
 
 
 
 
145
  = 3.9 =
146
  * Added compatibility with WooCommerce 2.7 (orders, coupons etc...)
147
  * Included the custom taxonomies associated with products in the WooCommerce Multilingual menu
5
  License: GPLv2
6
  Requires at least: 3.9
7
  Tested up to: 4.6.1
8
+ Stable tag: 3.9.1
9
 
10
  Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
11
 
142
 
143
  == Changelog ==
144
 
145
+ = 3.9.1 =
146
+ * Fixed a bug related to the stock information not syncing correctly across translations
147
+ * Bug fix: and incorrect value for products out of stock was show on the dashboard
148
+ * Bug fix: the link to edit custom prices was not working for variations
149
+
150
  = 3.9 =
151
  * Added compatibility with WooCommerce 2.7 (orders, coupons etc...)
152
  * Included the custom taxonomies associated with products in the WooCommerce Multilingual menu
res/js/prices.js CHANGED
@@ -1,15 +1,5 @@
1
  jQuery(document).ready(function($){
2
 
3
- $('.wcml_custom_prices_input').each(function(){
4
- if($(this).is(':checked')){
5
- if($(this).val() == 0){
6
- $(this).parent().find('.block_actions').show();
7
- }else{
8
- $(this).parent().find('.wcml_custom_prices_manually_block_show').show();
9
- }
10
- }
11
- });
12
-
13
  $('.wcml_schedule_input').each(function(){
14
  if($(this).is(':checked') && $(this).val() == 1){
15
  $(this).parent().find('.block_actions').show();
1
  jQuery(document).ready(function($){
2
 
 
 
 
 
 
 
 
 
 
 
3
  $('.wcml_schedule_input').each(function(){
4
  if($(this).is(':checked') && $(this).val() == 1){
5
  $(this).parent().find('.block_actions').show();
res/js/prices.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(a){function b(){var b="";b="undefined"!=typeof woocommerce_admin_meta_boxes?woocommerce_admin_meta_boxes.calendar_image:woocommerce_writepanel_params.calendar_image,a(".wcml_schedule_dates input").datepicker({defaultDate:"",dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:!0,showOn:"button",buttonImage:b,buttonImageOnly:!0,onSelect:function(b){var c=a(this).data("datepicker"),d=a.datepicker.parseDate(c.settings.dateFormat||a.datepicker._defaults.dateFormat,b,c.settings);a(this).is(".custom_sale_price_dates_from")?a(this).closest("div").find(".custom_sale_price_dates_to").datepicker("option","minDate",d):a(this).closest("div").find(".custom_sale_price_dates_from").datepicker("option","maxDate",d)}})}a(".wcml_custom_prices_input").each(function(){a(this).is(":checked")&&(0==a(this).val()?a(this).parent().find(".block_actions").show():a(this).parent().find(".wcml_custom_prices_manually_block_show").show())}),a(".wcml_schedule_input").each(function(){a(this).is(":checked")&&1==a(this).val()&&a(this).parent().find(".block_actions").show()}),a(document).on("change",".wcml_custom_prices_input",function(){1==a(this).val()?(a(this).closest(".wcml_custom_prices_block").find(".wcml_automaticaly_prices_block").hide(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block").show(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block_hide").show(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block_show").hide(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_auto_block_hide").hide(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_auto_block_show").show(),a(this).parent().find(".block_actions").hide()):(a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block").hide(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block_hide").hide(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block_show").hide(),a(this).parent().find(".block_actions").show())}),a(document).on("click",".wcml_custom_prices_auto_block_show",function(b){b.preventDefault(),0==a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_input:checked").val()&&(a(this).closest(".wcml_custom_prices_block").find(".wcml_automaticaly_prices_block").is(":visible")||(a(this).hide(),a(this).closest(".wcml_custom_prices_block").find(".wcml_automaticaly_prices_block").show(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_auto_block_hide").show()))}),a(document).on("click",".wcml_custom_prices_auto_block_hide",function(b){b.preventDefault(),0==a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_input:checked").val()&&a(this).closest(".wcml_custom_prices_block").find(".wcml_automaticaly_prices_block").is(":visible")&&(a(this).hide(),a(this).closest(".wcml_custom_prices_block").find(".wcml_automaticaly_prices_block").hide(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_auto_block_show").show())}),a(document).on("click",".wcml_custom_prices_manually_block_hide",function(b){b.preventDefault(),1==a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_input:checked").val()&&(a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block").hide(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block_hide").hide(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block_show").show())}),a(document).on("click",".wcml_custom_prices_manually_block_show",function(b){b.preventDefault(),1==a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_input:checked").val()&&(a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block").show(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block_hide").show(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block_show").hide())}),a(document).on("change","#_regular_price",function(){var b=a(this).val();a(this).closest("div").find('input[name="_readonly_regular_price"]').each(function(){a(this).val(b*a(this).attr("rel"))})}),a(document).on("change","#_sale_price",function(){var b=a(this).val();a(this).closest("div").find('input[name="_readonly_sale_price"]').each(function(){a(this).val(b*a(this).attr("rel"))})}),a(document).on("change",'input[name^="variable_regular_price"]',function(){var b=a(this).val();a(this).closest("table").find('input[name="_readonly_regular_price"]').each(function(){a(this).val(b*a(this).attr("rel"))})}),a(document).on("change",'input[name^="variable_sale_price"]',function(){var b=a(this).val();a(this).closest("table").find('input[name="_readonly_sale_price"]').each(function(){a(this).val(b*a(this).attr("rel"))})}),a(document).on("change","input.wcml_input_price",function(){a(this).val()>0&&a(this).closest(".currency_blck").find(".wcml_no_price_message").hide()}),a(document).on("change",".wcml_schedule_input",function(){1==a(this).val()?(b(),a(this).closest("div").find(".wcml_schedule_dates").show(),a(this).closest("div").find(".wcml_schedule_manually_block_show").hide(),a(this).closest("div").find(".wcml_schedule_manually_block_hide").show(),a(this).parent().find(".block_actions").show()):(a(this).closest("div").find(".wcml_schedule_dates").hide(),a(this).closest("div").find(".wcml_schedule_manually_block_show").show(),a(this).closest("div").find(".wcml_schedule_manually_block_hide").hide(),a(this).parent().find(".block_actions").hide())}),a(document).on("click",".wcml_schedule_manually_block_hide",function(b){b.preventDefault(),1==a(this).closest("div").find(".wcml_schedule_input:checked").val()&&(a(this).closest("div").find(".wcml_schedule_dates").hide(),a(this).closest("div").find(".wcml_schedule_manually_block_show").show(),a(this).closest("div").find(".wcml_schedule_manually_block_hide").hide())}),a(document).on("click",".wcml_schedule_manually_block_show",function(c){c.preventDefault(),1==a(this).closest("div").find(".wcml_schedule_input:checked").val()&&(b(),a(this).closest("div").find(".wcml_schedule_dates").show(),a(this).closest("div").find(".wcml_schedule_manually_block_show").hide(),a(this).closest("div").find(".wcml_schedule_manually_block_hide").show())}),a(document).on("keyup",".wcml_sale_price",function(){parseInt(a(this).val())>parseInt(a(this).closest("div").find(".wcml_regular_price").val())?0==a(this).closest("p").find(".wcml_price_error").size()&&a(this).after(a(".wcml_price_error").clone().show()):a(this).closest("p").find(".wcml_price_error").remove()}),a(document).on("change",".wcml_sale_price",function(){parseInt(a(this).val())>parseInt(a(this).closest("div").find(".wcml_regular_price").val())&&(a(this).val(a(this).closest("div").find(".wcml_regular_price").val()),a(this).closest("p").find(".wcml_price_error").remove())})});
1
+ jQuery(document).ready(function(a){function b(){var b="";b="undefined"!=typeof woocommerce_admin_meta_boxes?woocommerce_admin_meta_boxes.calendar_image:woocommerce_writepanel_params.calendar_image,a(".wcml_schedule_dates input").datepicker({defaultDate:"",dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:!0,showOn:"button",buttonImage:b,buttonImageOnly:!0,onSelect:function(b){var c=a(this).data("datepicker"),d=a.datepicker.parseDate(c.settings.dateFormat||a.datepicker._defaults.dateFormat,b,c.settings);a(this).is(".custom_sale_price_dates_from")?a(this).closest("div").find(".custom_sale_price_dates_to").datepicker("option","minDate",d):a(this).closest("div").find(".custom_sale_price_dates_from").datepicker("option","maxDate",d)}})}a(".wcml_schedule_input").each(function(){a(this).is(":checked")&&1==a(this).val()&&a(this).parent().find(".block_actions").show()}),a(document).on("change",".wcml_custom_prices_input",function(){1==a(this).val()?(a(this).closest(".wcml_custom_prices_block").find(".wcml_automaticaly_prices_block").hide(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block").show(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block_hide").show(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block_show").hide(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_auto_block_hide").hide(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_auto_block_show").show(),a(this).parent().find(".block_actions").hide()):(a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block").hide(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block_hide").hide(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block_show").hide(),a(this).parent().find(".block_actions").show())}),a(document).on("click",".wcml_custom_prices_auto_block_show",function(b){b.preventDefault(),0==a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_input:checked").val()&&(a(this).closest(".wcml_custom_prices_block").find(".wcml_automaticaly_prices_block").is(":visible")||(a(this).hide(),a(this).closest(".wcml_custom_prices_block").find(".wcml_automaticaly_prices_block").show(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_auto_block_hide").show()))}),a(document).on("click",".wcml_custom_prices_auto_block_hide",function(b){b.preventDefault(),0==a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_input:checked").val()&&a(this).closest(".wcml_custom_prices_block").find(".wcml_automaticaly_prices_block").is(":visible")&&(a(this).hide(),a(this).closest(".wcml_custom_prices_block").find(".wcml_automaticaly_prices_block").hide(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_auto_block_show").show())}),a(document).on("click",".wcml_custom_prices_manually_block_hide",function(b){b.preventDefault(),1==a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_input:checked").val()&&(a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block").hide(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block_hide").hide(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block_show").show())}),a(document).on("click",".wcml_custom_prices_manually_block_show",function(b){b.preventDefault(),1==a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_input:checked").val()&&(a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block").show(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block_hide").show(),a(this).closest(".wcml_custom_prices_block").find(".wcml_custom_prices_manually_block_show").hide())}),a(document).on("change","#_regular_price",function(){var b=a(this).val();a(this).closest("div").find('input[name="_readonly_regular_price"]').each(function(){a(this).val(b*a(this).attr("rel"))})}),a(document).on("change","#_sale_price",function(){var b=a(this).val();a(this).closest("div").find('input[name="_readonly_sale_price"]').each(function(){a(this).val(b*a(this).attr("rel"))})}),a(document).on("change",'input[name^="variable_regular_price"]',function(){var b=a(this).val();a(this).closest("table").find('input[name="_readonly_regular_price"]').each(function(){a(this).val(b*a(this).attr("rel"))})}),a(document).on("change",'input[name^="variable_sale_price"]',function(){var b=a(this).val();a(this).closest("table").find('input[name="_readonly_sale_price"]').each(function(){a(this).val(b*a(this).attr("rel"))})}),a(document).on("change","input.wcml_input_price",function(){a(this).val()>0&&a(this).closest(".currency_blck").find(".wcml_no_price_message").hide()}),a(document).on("change",".wcml_schedule_input",function(){1==a(this).val()?(b(),a(this).closest("div").find(".wcml_schedule_dates").show(),a(this).closest("div").find(".wcml_schedule_manually_block_show").hide(),a(this).closest("div").find(".wcml_schedule_manually_block_hide").show(),a(this).parent().find(".block_actions").show()):(a(this).closest("div").find(".wcml_schedule_dates").hide(),a(this).closest("div").find(".wcml_schedule_manually_block_show").show(),a(this).closest("div").find(".wcml_schedule_manually_block_hide").hide(),a(this).parent().find(".block_actions").hide())}),a(document).on("click",".wcml_schedule_manually_block_hide",function(b){b.preventDefault(),1==a(this).closest("div").find(".wcml_schedule_input:checked").val()&&(a(this).closest("div").find(".wcml_schedule_dates").hide(),a(this).closest("div").find(".wcml_schedule_manually_block_show").show(),a(this).closest("div").find(".wcml_schedule_manually_block_hide").hide())}),a(document).on("click",".wcml_schedule_manually_block_show",function(c){c.preventDefault(),1==a(this).closest("div").find(".wcml_schedule_input:checked").val()&&(b(),a(this).closest("div").find(".wcml_schedule_dates").show(),a(this).closest("div").find(".wcml_schedule_manually_block_show").hide(),a(this).closest("div").find(".wcml_schedule_manually_block_hide").show())}),a(document).on("keyup",".wcml_sale_price",function(){parseInt(a(this).val())>parseInt(a(this).closest("div").find(".wcml_regular_price").val())?0==a(this).closest("p").find(".wcml_price_error").size()&&a(this).after(a(".wcml_price_error").clone().show()):a(this).closest("p").find(".wcml_price_error").remove()}),a(document).on("change",".wcml_sale_price",function(){parseInt(a(this).val())>parseInt(a(this).closest("div").find(".wcml_regular_price").val())&&(a(this).val(a(this).closest("div").find(".wcml_regular_price").val()),a(this).closest("p").find(".wcml_price_error").remove())})});
screenshot-5.png CHANGED
Binary file
templates/multi-currency/custom-prices.twig CHANGED
@@ -12,7 +12,7 @@
12
 
13
  <input type="radio" name="_wcml_custom_prices[{{ product_id }}]" id="wcml_custom_prices_auto[{{ product_id }}]" value="0" class="wcml_custom_prices_input" {{ checked_calc_auto|raw }} />
14
  <label for="wcml_custom_prices_auto[{{ product_id }}]">{{ strings.calc_auto }}&nbsp;
15
- <span class="block_actions">(
16
  <a href="" class="wcml_custom_prices_auto_block_show" title="{{ strings.see_prices|e }}">{{ strings.show }}</a>
17
  <a href="" class="wcml_custom_prices_auto_block_hide">{{ strings.hide }}</a>
18
  )</span>
@@ -27,7 +27,7 @@
27
  </div>
28
  </div>
29
 
30
- <div class="wcml_custom_prices_manually_block">
31
  {% for currency in currencies %}
32
  <div class="currency_blck">
33
  <label>
12
 
13
  <input type="radio" name="_wcml_custom_prices[{{ product_id }}]" id="wcml_custom_prices_auto[{{ product_id }}]" value="0" class="wcml_custom_prices_input" {{ checked_calc_auto|raw }} />
14
  <label for="wcml_custom_prices_auto[{{ product_id }}]">{{ strings.calc_auto }}&nbsp;
15
+ <span class="block_actions" {% if checked_calc_auto is not empty %} style="display: inline;" {% endif %}>(
16
  <a href="" class="wcml_custom_prices_auto_block_show" title="{{ strings.see_prices|e }}">{{ strings.show }}</a>
17
  <a href="" class="wcml_custom_prices_auto_block_hide">{{ strings.hide }}</a>
18
  )</span>
27
  </div>
28
  </div>
29
 
30
+ <div class="wcml_custom_prices_manually_block" {% if checked_calc_manually is not empty %} style="display: block;" {% endif %}>
31
  {% for currency in currencies %}
32
  <div class="currency_blck">
33
  <label>
vendor/autoload_52.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
- return ComposerAutoloaderInitefe6fe50c1ef82ad3634a50d66bf7f39::getLoader();
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
+ return ComposerAutoloaderInit722263f42137f6d10769c87c0c845ff7::getLoader();
vendor/composer/autoload_real_52.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
- class ComposerAutoloaderInitefe6fe50c1ef82ad3634a50d66bf7f39 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitefe6fe50c1ef82ad3634a50d66bf7f39 {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitefe6fe50c1ef82ad3634a50d66bf7f39', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitefe6fe50c1ef82ad3634a50d66bf7f39', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
+ class ComposerAutoloaderInit722263f42137f6d10769c87c0c845ff7 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit722263f42137f6d10769c87c0c845ff7', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit722263f42137f6d10769c87c0c845ff7', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
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.9
10
  */
11
 
12
  if( defined( 'WCML_VERSION' ) ) return;
13
 
14
- define( 'WCML_VERSION', '3.9' );
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.9.1
10
  */
11
 
12
  if( defined( 'WCML_VERSION' ) ) return;
13
 
14
+ define( 'WCML_VERSION', '3.9.1' );
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' );