Version Description
- Added a series of compatibility fixes for WooCommerce 2.4.x (custom attributes, endpoints)
- Bug fix: Incorrect prices were calculated for Table Rate Shipping (bug originally fixed in version 3.6.5)
- Bug fix: WooCommerce Bookings - when you deleted a booking from the backend, the calendar on the front end did not update
- Bug fix: WooCommerce Bookings - translations of a booking post were not deleted when the original post was deleted
- Bug fix: WooCommerce Bookings - booking product appeared multiple times in the cart in some cases
- Bug fix: WooCommerce Bookings - when a booking product was created from the backend, multiple posts were created in some cases
- Bug fix: 'Stock Qty' field was not locked in the translated variations section
Download this release
Release Info
Developer | mihaimihai |
Plugin | WooCommerce Multilingual – run WooCommerce with WPML |
Version | 3.6.8 |
Comparing to | |
See all releases |
Code changes from version 3.6.7 to 3.6.8
- assets/js/lock_fields.js +49 -24
- compatibility/wc_bookings.class.php +57 -0
- compatibility/wc_checkout_addons.class.php +20 -0
- inc/compatibility.class.php +12 -6
- inc/endpoints.class.php +2 -0
- inc/multi-currency.class.php +28 -16
- inc/products.class.php +37 -6
- readme.txt +11 -2
- wpml-woocommerce.php +2 -2
assets/js/lock_fields.js
CHANGED
@@ -30,38 +30,15 @@ jQuery(document).ready(function($){
|
|
30 |
$('input[name="'+inpt_names[i]+'"]').attr('readonly','readonly');
|
31 |
$('input[name="'+inpt_names[i]+'"]').after($('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
|
32 |
|
33 |
-
//variation fields
|
34 |
-
$('input[name^="variable'+inpt_names[i]+'"]').each(function(){
|
35 |
-
$(this).attr('readonly','readonly');
|
36 |
-
$(this).after($('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
|
37 |
-
});
|
38 |
-
}
|
39 |
-
|
40 |
-
//variation fields
|
41 |
-
var var_checkboxes = ['_enabled','_is_downloadable','_is_virtual','_manage_stock'];
|
42 |
-
for (i = 0; i < var_checkboxes.length; i++) {
|
43 |
-
$('input[name^="variable'+var_checkboxes[i]+'"]').each(function(){
|
44 |
-
$(this).attr('readonly','readonly');
|
45 |
-
$(this).after($('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
|
46 |
-
});
|
47 |
-
}
|
48 |
-
|
49 |
-
var var_selectboxes = ['_stock_status','_shipping_class','_tax_class'];
|
50 |
-
for (i = 0; i < var_selectboxes.length; i++) {
|
51 |
-
$('select[name^="variable'+var_selectboxes[i]+'"]').each(function(){
|
52 |
-
$(this).attr('disabled','disabled');
|
53 |
-
$(this).after($('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
|
54 |
-
});
|
55 |
}
|
56 |
|
57 |
-
|
58 |
$('.woocommerce_attribute_data td textarea,.attribute_values,.attribute_name').each(function(){
|
59 |
$(this).attr('readonly','readonly');
|
60 |
$(this).after($('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
|
61 |
});
|
62 |
|
63 |
|
64 |
-
$('.
|
65 |
$(this).attr('disabled','disabled');
|
66 |
$(this).after($('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
|
67 |
});
|
@@ -89,3 +66,51 @@ jQuery(document).ready(function($){
|
|
89 |
|
90 |
});
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
$('input[name="'+inpt_names[i]+'"]').attr('readonly','readonly');
|
31 |
$('input[name="'+inpt_names[i]+'"]').after($('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
|
|
|
35 |
$('.woocommerce_attribute_data td textarea,.attribute_values,.attribute_name').each(function(){
|
36 |
$(this).attr('readonly','readonly');
|
37 |
$(this).after($('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
|
38 |
});
|
39 |
|
40 |
|
41 |
+
$('.woocommerce_attribute_data input[type="checkbox"]').each(function(){
|
42 |
$(this).attr('disabled','disabled');
|
43 |
$(this).after($('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
|
44 |
});
|
66 |
|
67 |
});
|
68 |
|
69 |
+
var wcml_lock_variation_fields = function(){
|
70 |
+
|
71 |
+
var check_attr = jQuery('.woocommerce_variation>h3 select').attr('disabled');
|
72 |
+
|
73 |
+
if (typeof check_attr !== typeof undefined && check_attr !== false) {
|
74 |
+
return;
|
75 |
+
}
|
76 |
+
|
77 |
+
jQuery('.woocommerce_variation>h3 select, #variable_product_options .toolbar select, .show_if_variation_manage_stock select').each(function(){
|
78 |
+
|
79 |
+
jQuery(this).attr('disabled','disabled');
|
80 |
+
jQuery(this).after(jQuery('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
|
81 |
+
});
|
82 |
+
|
83 |
+
var i = 0;
|
84 |
+
var inpt_names = ['_width','_height','_sku','_length','_weight','product_length','_regular_price','_sale_price','_sale_price_dates_from','_sale_price_dates_to','_stock','_download_limit','_download_expiry'];
|
85 |
+
|
86 |
+
for (i = 0; i < inpt_names.length; i++) {
|
87 |
+
|
88 |
+
//variation fields
|
89 |
+
jQuery('input[name^="variable'+inpt_names[i]+'"]').each(function(){
|
90 |
+
jQuery(this).attr('readonly','readonly');
|
91 |
+
jQuery(this).after(jQuery('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
|
92 |
+
});
|
93 |
+
}
|
94 |
+
|
95 |
+
//variation fields
|
96 |
+
var var_checkboxes = ['_enabled','_is_downloadable','_is_virtual','_manage_stock'];
|
97 |
+
for (i = 0; i < var_checkboxes.length; i++) {
|
98 |
+
jQuery('input[name^="variable'+var_checkboxes[i]+'"]').each(function(){
|
99 |
+
jQuery(this).attr('disabled','disabled');
|
100 |
+
jQuery(this).after(jQuery('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
|
101 |
+
});
|
102 |
+
}
|
103 |
+
|
104 |
+
var var_selectboxes = ['_stock_status','_shipping_class','_tax_class'];
|
105 |
+
for (i = 0; i < var_selectboxes.length; i++) {
|
106 |
+
jQuery('select[name^="variable'+var_selectboxes[i]+'"]').each(function(){
|
107 |
+
jQuery(this).attr('disabled','disabled');
|
108 |
+
jQuery(this).after(jQuery('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
|
109 |
+
});
|
110 |
+
}
|
111 |
+
|
112 |
+
}
|
113 |
+
|
114 |
+
|
115 |
+
|
116 |
+
|
compatibility/wc_bookings.class.php
CHANGED
@@ -50,6 +50,14 @@ class WCML_Bookings{
|
|
50 |
add_action( 'wcml_update_extra_fields', array( $this, 'wcml_products_tab_sync_resources_and_persons'), 10, 3 );
|
51 |
|
52 |
add_action( 'woocommerce_new_booking', array( $this, 'duplicate_booking_for_translations') );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
}
|
54 |
|
55 |
function wcml_price_field_after_booking_base_cost( $post_id ){
|
@@ -1513,4 +1521,53 @@ class WCML_Bookings{
|
|
1513 |
|
1514 |
}
|
1515 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1516 |
}
|
50 |
add_action( 'wcml_update_extra_fields', array( $this, 'wcml_products_tab_sync_resources_and_persons'), 10, 3 );
|
51 |
|
52 |
add_action( 'woocommerce_new_booking', array( $this, 'duplicate_booking_for_translations') );
|
53 |
+
|
54 |
+
$bookings_statuses = array( 'unpaid', 'pending-confirmation', 'confirmed', 'paid', 'cancelled', 'complete', 'in-cart', 'was-in-cart' );
|
55 |
+
foreach( $bookings_statuses as $status ){
|
56 |
+
add_action('woocommerce_booking_' . $status, array( $this, 'update_status_for_translations' ) );
|
57 |
+
}
|
58 |
+
|
59 |
+
add_filter( 'parse_query', array( $this, 'booking_filters_query' ) );
|
60 |
+
|
61 |
}
|
62 |
|
63 |
function wcml_price_field_after_booking_base_cost( $post_id ){
|
1521 |
|
1522 |
}
|
1523 |
|
1524 |
+
function update_status_for_translations( $booking_id ){
|
1525 |
+
global $wpdb;
|
1526 |
+
|
1527 |
+
$translated_bookings = $wpdb->get_results( $wpdb->prepare( "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key = '_booking_duplicate_of' AND meta_value = %d", $booking_id ) );
|
1528 |
+
|
1529 |
+
foreach( $translated_bookings as $booking ){
|
1530 |
+
|
1531 |
+
$status = $wpdb->get_var( $wpdb->prepare( "SELECT post_status FROM {$wpdb->posts} WHERE ID = %d", $booking_id ) ); //get_post_status( $booking_id );
|
1532 |
+
$language = get_post_meta( $booking->post_id, '_language_code', true );
|
1533 |
+
|
1534 |
+
$wpdb->update(
|
1535 |
+
$wpdb->posts,
|
1536 |
+
array(
|
1537 |
+
'post_status' => $status,
|
1538 |
+
'post_parent' => wp_get_post_parent_id( $booking_id ),
|
1539 |
+
),
|
1540 |
+
array(
|
1541 |
+
'ID' => $booking->post_id
|
1542 |
+
)
|
1543 |
+
);
|
1544 |
+
|
1545 |
+
update_post_meta( $booking->post_id, '_booking_product_id', $this->get_translated_booking_product_id( $booking_id, $language ) );
|
1546 |
+
update_post_meta( $booking->post_id, '_booking_resource_id', $this->get_translated_booking_resource_id( $booking_id, $language ) );
|
1547 |
+
update_post_meta( $booking->post_id, '_booking_persons', $this->get_translated_booking_persons_ids( $booking_id, $language ) );
|
1548 |
+
|
1549 |
+
}
|
1550 |
+
|
1551 |
+
}
|
1552 |
+
|
1553 |
+
|
1554 |
+
public function booking_filters_query( $query ) {
|
1555 |
+
global $typenow, $sitepress, $wpdb;
|
1556 |
+
|
1557 |
+
if ( $typenow == 'wc_booking' && isset( $_GET['post_type'] ) && $_GET['post_type'] == 'wc_booking' && !isset( $_GET['page'] )) {
|
1558 |
+
|
1559 |
+
$product_ids = $wpdb->get_col( $wpdb->prepare(
|
1560 |
+
"SELECT element_id
|
1561 |
+
FROM {$wpdb->prefix}icl_translations
|
1562 |
+
WHERE language_code = %s AND element_type = 'post_product'", $sitepress->get_current_language() ) );
|
1563 |
+
|
1564 |
+
$query->query_vars[ 'meta_query' ] = array(
|
1565 |
+
array(
|
1566 |
+
'key' => '_booking_product_id',
|
1567 |
+
'value' => $product_ids,
|
1568 |
+
'compare ' => 'IN'
|
1569 |
+
)
|
1570 |
+
);
|
1571 |
+
}
|
1572 |
+
}
|
1573 |
}
|
compatibility/wc_checkout_addons.class.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Description of wc_checkout_addons
|
4 |
+
*
|
5 |
+
* @author konrad
|
6 |
+
*/
|
7 |
+
class WCML_Checkout_Addons {
|
8 |
+
public function __construct() {
|
9 |
+
add_filter( 'wc_checkout_add_ons_options', array( $this, 'wc_checkout_add_ons_options_wpml_multi_currency_support' ) );
|
10 |
+
}
|
11 |
+
|
12 |
+
public function wc_checkout_add_ons_options_wpml_multi_currency_support( $options ) {
|
13 |
+
|
14 |
+
foreach ( $options as $i => $option ) {
|
15 |
+
$options[ $i ]['cost'] = apply_filters( 'wcml_raw_price_amount', $options[ $i ]['cost'] );
|
16 |
+
}
|
17 |
+
|
18 |
+
return $options;
|
19 |
+
}
|
20 |
+
}
|
inc/compatibility.class.php
CHANGED
@@ -99,18 +99,24 @@ class WCML_Compatibility {
|
|
99 |
$this->wc_bulk_stock_management = new WCML_Bulk_Stock_Management();
|
100 |
}
|
101 |
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
|
109 |
// woocommerce composite products
|
110 |
if ( isset( $GLOBALS[ 'woocommerce_composite_products' ] ) ) {
|
111 |
require_once WCML_PLUGIN_PATH . '/compatibility/wc_composite_products.class.php';
|
112 |
$this->wc_composite_products = new WCML_Composite_Products();
|
113 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
|
115 |
}
|
116 |
|
99 |
$this->wc_bulk_stock_management = new WCML_Bulk_Stock_Management();
|
100 |
}
|
101 |
|
102 |
+
// WooCommerce Advanced Ajax Layered Navigation
|
103 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
104 |
+
if ( is_plugin_active( 'woocommerce-ajax-layered-nav/ajax_layered_nav-widget.php' ) ) {
|
105 |
+
require_once WCML_PLUGIN_PATH . '/compatibility/wc_ajax_layered_nav_widget.class.php';
|
106 |
+
$this->wc_ajax_layered_nav_widget = new WCML_Ajax_Layered_Nav_Widget();
|
107 |
+
}
|
108 |
|
109 |
// woocommerce composite products
|
110 |
if ( isset( $GLOBALS[ 'woocommerce_composite_products' ] ) ) {
|
111 |
require_once WCML_PLUGIN_PATH . '/compatibility/wc_composite_products.class.php';
|
112 |
$this->wc_composite_products = new WCML_Composite_Products();
|
113 |
}
|
114 |
+
|
115 |
+
// woocommerce checkout addons
|
116 |
+
if (function_exists('init_woocommerce_checkout_add_ons')) {
|
117 |
+
require_once WCML_PLUGIN_PATH . '/compatibility/wc_checkout_addons.class.php';
|
118 |
+
$this->wc_checkout_addons = new WCML_Checkout_Addons();
|
119 |
+
}
|
120 |
|
121 |
}
|
122 |
|
inc/endpoints.class.php
CHANGED
@@ -78,6 +78,8 @@ class WCML_Endpoints{
|
|
78 |
|
79 |
function maybe_flush_rules(){
|
80 |
if( get_option( 'flush_rules_for_endpoints_translations' ) ){
|
|
|
|
|
81 |
flush_rewrite_rules();
|
82 |
delete_option( 'flush_rules_for_endpoints_translations' );
|
83 |
}
|
78 |
|
79 |
function maybe_flush_rules(){
|
80 |
if( get_option( 'flush_rules_for_endpoints_translations' ) ){
|
81 |
+
WC()->query->init_query_vars();
|
82 |
+
WC()->query->add_endpoints();
|
83 |
flush_rewrite_rules();
|
84 |
delete_option( 'flush_rules_for_endpoints_translations' );
|
85 |
}
|
inc/multi-currency.class.php
CHANGED
@@ -33,7 +33,8 @@ class WCML_WC_MultiCurrency{
|
|
33 |
add_action('woocommerce_product_meta_start', array($this, 'currency_switcher'));
|
34 |
|
35 |
add_filter('wcml_get_client_currency', array($this, 'get_client_currency'));
|
36 |
-
|
|
|
37 |
|
38 |
// exchange rate GUI and logic
|
39 |
if(defined('W3TC')){
|
@@ -107,9 +108,9 @@ class WCML_WC_MultiCurrency{
|
|
107 |
$currency = $this->get_client_currency();
|
108 |
}
|
109 |
$price = $this->convert_price_amount($price, $currency);
|
110 |
-
|
111 |
$price = $this->apply_rounding_rules($price);
|
112 |
-
|
113 |
return $price;
|
114 |
|
115 |
}
|
@@ -145,7 +146,7 @@ class WCML_WC_MultiCurrency{
|
|
145 |
|
146 |
function apply_rounding_rules($price, $currency = false ){
|
147 |
global $woocommerce_wpml;
|
148 |
-
|
149 |
if( !$currency )
|
150 |
$currency = $this->get_client_currency();
|
151 |
$currency_options = $woocommerce_wpml->settings['currency_options'][$currency];
|
@@ -189,7 +190,7 @@ class WCML_WC_MultiCurrency{
|
|
189 |
if($currency_options['auto_subtract'] && $currency_options['auto_subtract'] < $price){
|
190 |
$price = $price - $currency_options['auto_subtract'];
|
191 |
}
|
192 |
-
|
193 |
return $price;
|
194 |
|
195 |
}
|
@@ -218,7 +219,7 @@ class WCML_WC_MultiCurrency{
|
|
218 |
|
219 |
function shipping_price_filter($price) {
|
220 |
|
221 |
-
$price = $this->
|
222 |
|
223 |
return $price;
|
224 |
|
@@ -226,7 +227,7 @@ class WCML_WC_MultiCurrency{
|
|
226 |
|
227 |
function shipping_free_min_amount($price) {
|
228 |
|
229 |
-
$price = $this->
|
230 |
|
231 |
return $price;
|
232 |
|
@@ -758,8 +759,8 @@ class WCML_WC_MultiCurrency{
|
|
758 |
$item['line_subtotal'] = $custom_price;
|
759 |
$item['line_total'] = $custom_price;
|
760 |
}else{
|
761 |
-
$item['line_subtotal'] = $this->
|
762 |
-
$item['line_total'] = $this->
|
763 |
}
|
764 |
|
765 |
wc_update_order_item_meta( $item_id, '_line_subtotal', $item['line_subtotal'] );
|
@@ -850,16 +851,11 @@ class WCML_WC_MultiCurrency{
|
|
850 |
|
851 |
|
852 |
function woocommerce_product_after_variable_attributes_custom_pricing($loop, $variation_data, $variation){
|
853 |
-
global $sitepress,$woocommerce_wpml;
|
854 |
-
|
855 |
-
|
856 |
-
if(isset($_GET['post']) && ( get_post_type($_GET['post']) != 'product' || !$woocommerce_wpml->products->is_original_product($_GET['post']))){
|
857 |
-
return;
|
858 |
-
}
|
859 |
|
860 |
echo '<tr><td>';
|
861 |
$this->custom_pricing_output($variation->ID);
|
862 |
echo '</td></tr>';
|
|
|
863 |
}
|
864 |
|
865 |
|
@@ -1046,7 +1042,23 @@ class WCML_WC_MultiCurrency{
|
|
1046 |
|
1047 |
return $where;
|
1048 |
}
|
1049 |
-
/* for WC 2.0.x - end */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1050 |
|
1051 |
}
|
1052 |
|
33 |
add_action('woocommerce_product_meta_start', array($this, 'currency_switcher'));
|
34 |
|
35 |
add_filter('wcml_get_client_currency', array($this, 'get_client_currency'));
|
36 |
+
add_filter('woocommerce_paypal_args', array($this, 'filter_price_woocommerce_paypal_args'));
|
37 |
+
|
38 |
|
39 |
// exchange rate GUI and logic
|
40 |
if(defined('W3TC')){
|
108 |
$currency = $this->get_client_currency();
|
109 |
}
|
110 |
$price = $this->convert_price_amount($price, $currency);
|
111 |
+
|
112 |
$price = $this->apply_rounding_rules($price);
|
113 |
+
|
114 |
return $price;
|
115 |
|
116 |
}
|
146 |
|
147 |
function apply_rounding_rules($price, $currency = false ){
|
148 |
global $woocommerce_wpml;
|
149 |
+
|
150 |
if( !$currency )
|
151 |
$currency = $this->get_client_currency();
|
152 |
$currency_options = $woocommerce_wpml->settings['currency_options'][$currency];
|
190 |
if($currency_options['auto_subtract'] && $currency_options['auto_subtract'] < $price){
|
191 |
$price = $price - $currency_options['auto_subtract'];
|
192 |
}
|
193 |
+
|
194 |
return $price;
|
195 |
|
196 |
}
|
219 |
|
220 |
function shipping_price_filter($price) {
|
221 |
|
222 |
+
$price = $this->raw_price_filter($price, $this->get_client_currency());
|
223 |
|
224 |
return $price;
|
225 |
|
227 |
|
228 |
function shipping_free_min_amount($price) {
|
229 |
|
230 |
+
$price = $this->raw_price_filter($price, $this->get_client_currency());
|
231 |
|
232 |
return $price;
|
233 |
|
759 |
$item['line_subtotal'] = $custom_price;
|
760 |
$item['line_total'] = $custom_price;
|
761 |
}else{
|
762 |
+
$item['line_subtotal'] = $this->raw_price_filter( $item['line_subtotal'], $order_currency );
|
763 |
+
$item['line_total'] = $this->raw_price_filter( $item['line_total'], $order_currency );
|
764 |
}
|
765 |
|
766 |
wc_update_order_item_meta( $item_id, '_line_subtotal', $item['line_subtotal'] );
|
851 |
|
852 |
|
853 |
function woocommerce_product_after_variable_attributes_custom_pricing($loop, $variation_data, $variation){
|
|
|
|
|
|
|
|
|
|
|
|
|
854 |
|
855 |
echo '<tr><td>';
|
856 |
$this->custom_pricing_output($variation->ID);
|
857 |
echo '</td></tr>';
|
858 |
+
|
859 |
}
|
860 |
|
861 |
|
1042 |
|
1043 |
return $where;
|
1044 |
}
|
1045 |
+
/* for WC 2.0.x - end */
|
1046 |
+
|
1047 |
+
|
1048 |
+
function filter_price_woocommerce_paypal_args( $args ){
|
1049 |
+
global $woocommerce_wpml;
|
1050 |
+
|
1051 |
+
foreach( $args as $key => $value ){
|
1052 |
+
if( substr( $key, 0, 7 ) == 'amount_' ){
|
1053 |
+
|
1054 |
+
$currency_details = $woocommerce_wpml->multi_currency_support->get_currency_details_by_code( $args['currency_code'] );
|
1055 |
+
|
1056 |
+
$args[ $key ] = number_format( $value, $currency_details['num_decimals'], $currency_details['decimal_sep'], $currency_details['thousand_sep'] );
|
1057 |
+
}
|
1058 |
+
}
|
1059 |
+
|
1060 |
+
return $args;
|
1061 |
+
}
|
1062 |
|
1063 |
}
|
1064 |
|
inc/products.class.php
CHANGED
@@ -118,6 +118,7 @@ class WCML_Products{
|
|
118 |
add_filter( 'icl_wpml_config_array', array( $this, 'set_taxonomies_config' ) );
|
119 |
|
120 |
add_filter( 'manage_product_posts_columns', array( $this, 'add_languages_column' ), 100 );
|
|
|
121 |
|
122 |
}
|
123 |
|
@@ -1176,7 +1177,8 @@ class WCML_Products{
|
|
1176 |
$values_arrs_tr = array_map('trim',explode('|',$tr_product_attr[$tax]['value']));
|
1177 |
foreach($values_arrs as $key=>$value){
|
1178 |
$value_sanitized = sanitize_title($value);
|
1179 |
-
|
|
|
1180 |
$meta_value = $values_arrs_tr[$key];
|
1181 |
}
|
1182 |
}
|
@@ -2932,12 +2934,18 @@ class WCML_Products{
|
|
2932 |
$elements[ 'excerpt' ] ['editor_type'] = 'editor';
|
2933 |
}
|
2934 |
|
2935 |
-
if(
|
2936 |
-
|
2937 |
-
|
2938 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
2939 |
}
|
2940 |
-
|
2941 |
return $elements;
|
2942 |
}
|
2943 |
|
@@ -3183,4 +3191,27 @@ class WCML_Products{
|
|
3183 |
SELECT * FROM {$wpdb->terms} t JOIN {$wpdb->term_taxonomy} x ON x.term_id = t.term_id WHERE t.term_id = %d AND x.taxonomy = %s", $term_id, $taxonomy ) );
|
3184 |
}
|
3185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3186 |
}
|
118 |
add_filter( 'icl_wpml_config_array', array( $this, 'set_taxonomies_config' ) );
|
119 |
|
120 |
add_filter( 'manage_product_posts_columns', array( $this, 'add_languages_column' ), 100 );
|
121 |
+
add_action( 'woocommerce_product_after_variable_attributes', array( $this, 'lock_variable_fields' ), 10, 3 );
|
122 |
|
123 |
}
|
124 |
|
1177 |
$values_arrs_tr = array_map('trim',explode('|',$tr_product_attr[$tax]['value']));
|
1178 |
foreach($values_arrs as $key=>$value){
|
1179 |
$value_sanitized = sanitize_title($value);
|
1180 |
+
|
1181 |
+
if( ( $value_sanitized == strtolower(urldecode($meta_value)) || strtolower($value_sanitized == $meta_value) ) && isset($values_arrs_tr[$key])){
|
1182 |
$meta_value = $values_arrs_tr[$key];
|
1183 |
}
|
1184 |
}
|
2934 |
$elements[ 'excerpt' ] ['editor_type'] = 'editor';
|
2935 |
}
|
2936 |
|
2937 |
+
if ( function_exists( 'format_for_editor' ) ) {
|
2938 |
+
// WordPress 4.3 uses format_for_editor
|
2939 |
+
$elements[ 'excerpt' ] ['value'] = htmlspecialchars_decode(format_for_editor($elements[ 'excerpt' ] ['value'], $_POST[ 'excerpt_type']));
|
2940 |
+
} else {
|
2941 |
+
// Backwards compatible for WordPress < 4.3
|
2942 |
+
if($_POST[ 'excerpt_type'] == 'rich'){
|
2943 |
+
$elements[ 'excerpt' ] ['value'] = htmlspecialchars_decode(wp_richedit_pre($elements[ 'excerpt' ] ['value']));
|
2944 |
+
}else{
|
2945 |
+
$elements[ 'excerpt' ] ['value'] = htmlspecialchars_decode(wp_htmledit_pre($elements[ 'excerpt' ] ['value']));
|
2946 |
+
}
|
2947 |
}
|
2948 |
+
|
2949 |
return $elements;
|
2950 |
}
|
2951 |
|
3191 |
SELECT * FROM {$wpdb->terms} t JOIN {$wpdb->term_taxonomy} x ON x.term_id = t.term_id WHERE t.term_id = %d AND x.taxonomy = %s", $term_id, $taxonomy ) );
|
3192 |
}
|
3193 |
|
3194 |
+
function lock_variable_fields( $loop, $variation_data, $variation ){
|
3195 |
+
global $woocommerce_wpml;
|
3196 |
+
|
3197 |
+
$product_id = false;
|
3198 |
+
if( ( isset( $_GET['post'] ) && get_post_type( $_GET['post'] ) == 'product' ) ){
|
3199 |
+
$product_id = $_GET['post'];
|
3200 |
+
}elseif( isset( $_POST['action'] ) && $_POST['action'] == 'woocommerce_load_variations' && isset( $_POST['product_id'] ) ){
|
3201 |
+
$product_id = $_POST['product_id'];
|
3202 |
+
}
|
3203 |
+
|
3204 |
+
if( !$product_id ){
|
3205 |
+
return;
|
3206 |
+
}elseif( !$woocommerce_wpml->products->is_original_product( $_POST['product_id'] ) ){ ?>
|
3207 |
+
<script type="text/javascript">
|
3208 |
+
jQuery(document).ready(function() {
|
3209 |
+
wcml_lock_variation_fields();
|
3210 |
+
});
|
3211 |
+
</script>
|
3212 |
+
<?php
|
3213 |
+
}
|
3214 |
+
|
3215 |
+
}
|
3216 |
+
|
3217 |
}
|
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.0
|
7 |
-
Tested up to: 4.
|
8 |
-
Stable tag: 3.6.
|
9 |
|
10 |
Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
|
11 |
|
@@ -78,6 +78,15 @@ In order for the checkout and store pages to appear translated, you need to crea
|
|
78 |
|
79 |
== Changelog ==
|
80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
= 3.6.7 =
|
82 |
* Bug fix: Converted prices in secondary currencies were incorrect in some situations. e.g. For VND with an VND:EUR exchange rate of 30,000:1
|
83 |
* Bug fix: Wrong urls were displayed in the language switcher for product category or product tag urls
|
4 |
Tags: CMS, woocommerce, commerce, ecommerce, e-commerce, products, WPML, multilingual, e-shop, shop
|
5 |
License: GPLv2
|
6 |
Requires at least: 3.0
|
7 |
+
Tested up to: 4.3
|
8 |
+
Stable tag: 3.6.8
|
9 |
|
10 |
Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
|
11 |
|
78 |
|
79 |
== Changelog ==
|
80 |
|
81 |
+
= 3.6.8 =
|
82 |
+
* Added a series of compatibility fixes for WooCommerce 2.4.x (custom attributes, endpoints)
|
83 |
+
* Bug fix: Incorrect prices were calculated for Table Rate Shipping (bug originally fixed in version 3.6.5)
|
84 |
+
* Bug fix: WooCommerce Bookings - when you deleted a booking from the backend, the calendar on the front end did not update
|
85 |
+
* Bug fix: WooCommerce Bookings - translations of a booking post were not deleted when the original post was deleted
|
86 |
+
* Bug fix: WooCommerce Bookings - booking product appeared multiple times in the cart in some cases
|
87 |
+
* Bug fix: WooCommerce Bookings - when a booking product was created from the backend, multiple posts were created in some cases
|
88 |
+
* Bug fix: 'Stock Qty' field was not locked in the translated variations section
|
89 |
+
|
90 |
= 3.6.7 =
|
91 |
* Bug fix: Converted prices in secondary currencies were incorrect in some situations. e.g. For VND with an VND:EUR exchange rate of 30,000:1
|
92 |
* Bug fix: Wrong urls were displayed in the language switcher for product category or product tag urls
|
wpml-woocommerce.php
CHANGED
@@ -5,12 +5,12 @@
|
|
5 |
Description: Allows running fully multilingual e-Commerce sites with WooCommerce and WPML. <a href="http://wpml.org/documentation/related-projects/woocommerce-multilingual/">Documentation</a>.
|
6 |
Author: OnTheGoSystems
|
7 |
Author URI: http://www.onthegosystems.com/
|
8 |
-
Version: 3.6.
|
9 |
*/
|
10 |
|
11 |
|
12 |
if(defined('WCML_VERSION')) return;
|
13 |
-
define('WCML_VERSION', '3.6.
|
14 |
define('WCML_PLUGIN_PATH', dirname(__FILE__));
|
15 |
define('WCML_PLUGIN_FOLDER', basename(WCML_PLUGIN_PATH));
|
16 |
define('WCML_PLUGIN_URL', plugins_url() . '/' . WCML_PLUGIN_FOLDER);
|
5 |
Description: Allows running fully multilingual e-Commerce sites with WooCommerce and WPML. <a href="http://wpml.org/documentation/related-projects/woocommerce-multilingual/">Documentation</a>.
|
6 |
Author: OnTheGoSystems
|
7 |
Author URI: http://www.onthegosystems.com/
|
8 |
+
Version: 3.6.8
|
9 |
*/
|
10 |
|
11 |
|
12 |
if(defined('WCML_VERSION')) return;
|
13 |
+
define('WCML_VERSION', '3.6.8');
|
14 |
define('WCML_PLUGIN_PATH', dirname(__FILE__));
|
15 |
define('WCML_PLUGIN_FOLDER', basename(WCML_PLUGIN_PATH));
|
16 |
define('WCML_PLUGIN_URL', plugins_url() . '/' . WCML_PLUGIN_FOLDER);
|