Version Description
- Notices on front when Reset cart feature is enabled and WooCommerce version >
Download this release
Release Info
Developer | sergey.r |
Plugin | WooCommerce Multilingual – run WooCommerce with WPML |
Version | 4.2.7 |
Comparing to | |
See all releases |
Code changes from version 4.2.6 to 4.2.7
- changelog/4.2.7.md +14 -0
- compatibility/class-wcml-etheme-blanco.php +20 -0
- compatibility/class-wcml-product-bundles.php +79 -20
- compatibility/class-wcml-wc-subscriptions.php +9 -5
- inc/class-wcml-attributes.php +100 -1
- inc/class-wcml-cart.php +25 -7
- inc/class-wcml-compatibility.php +6 -0
- inc/class-wcml-endpoints.php +6 -4
- inc/class-wcml-orders.php +14 -16
- inc/class-wcml-products.php +9 -1
- inc/class-wcml-store-pages.php +33 -13
- inc/class-wcml-upgrade.php +50 -2
- inc/class-wcml-url-translation.php +5 -4
- inc/class-woocommerce-wpml.php +1 -0
- inc/currencies/class-wcml-exchange-rates.php +3 -4
- inc/currencies/class-wcml-multi-currency-shipping.php +4 -2
- inc/template-classes/setup/class-wcml-setup-attributes-ui.php +1 -0
- inc/template-classes/setup/class-wcml-setup-introduction-ui.php +6 -5
- inc/template-classes/setup/class-wcml-setup-multi-currency-ui.php +1 -0
- inc/template-classes/setup/class-wcml-setup-ready-ui.php +1 -0
- inc/template-classes/setup/class-wcml-setup-store-pages-ui.php +1 -0
- inc/template-classes/setup/class-wcml-setup-translation-options-ui.php +3 -2
- readme.txt +17 -2
- templates/setup/attributes.twig +2 -0
- templates/setup/introduction.twig +3 -3
- templates/setup/multi-currency.twig +2 -0
- templates/setup/ready.twig +2 -1
- templates/setup/store-pages.twig +2 -0
- templates/setup/translation-options.twig +4 -2
- vendor/autoload.php +1 -1
- vendor/autoload_52.php +1 -1
- vendor/composer/autoload_classmap.php +1 -1
- vendor/composer/autoload_real.php +4 -4
- vendor/composer/autoload_real_52.php +3 -3
- vendor/composer/autoload_static.php +6 -6
- wpml-woocommerce.php +3 -3
changelog/4.2.7.md
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Fixes
|
2 |
+
* [wcml-2258] Notices on front when Reset cart feature is enabled and WooCommerce version >= 2.3
|
3 |
+
* [wcml-2256] Notice in edit order screen and empty comment added to the order (order note)
|
4 |
+
* [wcml-2255] Woo Bundles product filtering for variable products does not work in second language
|
5 |
+
* [wcml-2254] WooCommerce Subscriptions - > sign-up fee in the default currency does not work
|
6 |
+
* [wcml-2250] Visiting customer-logout endpoint in the second language makes it re-register and sets the string as "Translation needs update"
|
7 |
+
* [wcml-2249] Default attributes for variable products were not synchronized correctly for translated variable products.
|
8 |
+
* [wcml-2247] Wrong "product" slug translation on product edit page
|
9 |
+
* [wcml-2246] WooCommerce EU VAT - VAT set when exempt and doubled in second currency
|
10 |
+
* [wcml-2245] WooCommerce widget for filtering by attribute when shop page is front/home page
|
11 |
+
* [wcml-2243] Etheme Blanco compatibility - Inconsistency with minicart
|
12 |
+
* [wcml-2242] Remove Yahoo service from available services because it was discontinued
|
13 |
+
* [wcml-2241] Sync problems with Bundle product which contains one product two times in bundle items
|
14 |
+
* [wcml-2231] Endpoints on my account page removed from the link URL
|
compatibility/class-wcml-etheme-blanco.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WCML_Etheme_Blanco {
|
4 |
+
|
5 |
+
public function add_hooks() {
|
6 |
+
add_filter( 'wcml_calculate_totals_exception', array(
|
7 |
+
$this,
|
8 |
+
'calculate_totals_on_et_refreshed_fragments'
|
9 |
+
), 9 );
|
10 |
+
}
|
11 |
+
|
12 |
+
public function calculate_totals_on_et_refreshed_fragments( $calculate ) {
|
13 |
+
if ( isset( $_POST['action'] ) && 'et_refreshed_fragments' === $_POST['action'] ) {
|
14 |
+
return false;
|
15 |
+
}
|
16 |
+
|
17 |
+
return $calculate;
|
18 |
+
}
|
19 |
+
|
20 |
+
}
|
compatibility/class-wcml-product-bundles.php
CHANGED
@@ -125,12 +125,14 @@ class WCML_Product_Bundles {
|
|
125 |
$translated_product_id = apply_filters( 'translate_object_id', $item_meta['product_id'], get_post_type( $item_meta['product_id'] ), false, $target_lang );
|
126 |
|
127 |
if ( $translated_product_id ) {
|
128 |
-
$translated_item_id = $this->
|
129 |
$translated_item_ids[] = $translated_item_id;
|
130 |
|
131 |
$translated_item = $this->product_bundles_items->get_item_data_object( $translated_item_id );
|
132 |
foreach ( $fields_to_sync as $key ) {
|
133 |
-
|
|
|
|
|
134 |
}
|
135 |
|
136 |
|
@@ -144,6 +146,11 @@ class WCML_Product_Bundles {
|
|
144 |
}
|
145 |
}
|
146 |
|
|
|
|
|
|
|
|
|
|
|
147 |
$this->product_bundles_items->save_item_meta( $translated_item );
|
148 |
|
149 |
}
|
@@ -202,18 +209,62 @@ class WCML_Product_Bundles {
|
|
202 |
return $allowed_variations;
|
203 |
}
|
204 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
private function get_product_id_for_item_id( $item_id ) {
|
206 |
|
207 |
return $this->wpdb->get_var( $this->wpdb->prepare(
|
208 |
"SELECT product_id FROM {$this->wpdb->prefix}woocommerce_bundled_items WHERE bundled_item_id=%d", $item_id ) );
|
209 |
}
|
210 |
|
211 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
|
213 |
return $this->wpdb->get_var( $this->wpdb->prepare(
|
214 |
-
"SELECT
|
215 |
-
|
216 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
}
|
218 |
|
219 |
// Add Bundles Box to WCML Translation GUI
|
@@ -304,7 +355,7 @@ class WCML_Product_Bundles {
|
|
304 |
|
305 |
$translated_product_id = apply_filters( 'translate_object_id', $product_id, get_post_type( $product_id ), false, $lang );
|
306 |
if ( $translation ) {
|
307 |
-
$translated_item_id = $this->
|
308 |
}
|
309 |
|
310 |
if ( $bundle_data[ $item_id ]['override_title'] == 'yes' ) {
|
@@ -344,7 +395,7 @@ class WCML_Product_Bundles {
|
|
344 |
$product_id = $this->get_product_id_for_item_id( $item_id );
|
345 |
foreach ( $fields as $field ) {
|
346 |
if ( $product_data[ 'override_' . $field ] == 'yes' && ! empty( $product_data[ $field ] ) ) {
|
347 |
-
$package['contents'][ 'product_bundles:' . $product_id . ':'
|
348 |
'translate' => 1,
|
349 |
'data' => $this->tp->encode_field_data( $product_data[ $field ], 'base64' ),
|
350 |
'format' => 'base64'
|
@@ -393,9 +444,12 @@ class WCML_Product_Bundles {
|
|
393 |
'menu_order' => $menu_order,
|
394 |
)
|
395 |
);
|
|
|
|
|
|
|
396 |
}
|
397 |
|
398 |
-
$translated_item_id = $this->
|
399 |
|
400 |
//$this->product_bundles_items->copy_item_data( $item_id, $translated_item_id );
|
401 |
|
@@ -447,7 +501,7 @@ class WCML_Product_Bundles {
|
|
447 |
|
448 |
if ( $translated_product_id ) {
|
449 |
|
450 |
-
$translated_item_id = $this->
|
451 |
if ( ! $translated_item_id ) {
|
452 |
$menu_order = $this->wpdb->get_var( $this->wpdb->prepare( "
|
453 |
SELECT menu_order FROM {$this->wpdb->prefix}woocommerce_bundled_items
|
@@ -462,6 +516,7 @@ class WCML_Product_Bundles {
|
|
462 |
)
|
463 |
);
|
464 |
$translated_item_id = $this->wpdb->insert_id;
|
|
|
465 |
}
|
466 |
|
467 |
$translated_bundle_data[ $translated_item_id ] = $product_data;
|
@@ -600,19 +655,19 @@ class WCML_Product_Bundles {
|
|
600 |
|
601 |
foreach ( $data as $value ) {
|
602 |
|
603 |
-
if ( preg_match( '/product_bundles:([0-9]+):(.+)/', $value['field_type'], $matches ) ) {
|
604 |
|
605 |
$product_id = $matches[1];
|
606 |
-
$
|
|
|
|
|
607 |
|
608 |
$translated_product_id = apply_filters( 'translate_object_id', $product_id, get_post_type( $product_id ), false, $job->language_code );
|
609 |
-
$translated_item_id = $this->
|
610 |
if ( empty( $translated_item_id ) ) {
|
611 |
-
$translated_item_id = $this->add_product_to_bundle( $translated_product_id, $translated_bundle_id, $
|
612 |
}
|
613 |
|
614 |
-
$item_id = $this->get_item_id_for_product_id( $product_id, $bundle_id );
|
615 |
-
|
616 |
if ( ! isset( $translated_bundle_data[ $translated_item_id ] ) ) {
|
617 |
$translated_bundle_data[ $translated_item_id ] = array(
|
618 |
'product_id' => $translated_product_id,
|
@@ -649,11 +704,12 @@ class WCML_Product_Bundles {
|
|
649 |
}
|
650 |
}
|
651 |
|
652 |
-
private function add_product_to_bundle( $product_id, $bundle_id, $
|
|
|
653 |
$menu_order = $this->wpdb->get_var( $this->wpdb->prepare( "
|
654 |
SELECT menu_order FROM {$this->wpdb->prefix}woocommerce_bundled_items
|
655 |
-
WHERE
|
656 |
-
", $
|
657 |
|
658 |
$this->wpdb->insert( $this->wpdb->prefix . 'woocommerce_bundled_items',
|
659 |
array(
|
@@ -663,7 +719,10 @@ class WCML_Product_Bundles {
|
|
663 |
)
|
664 |
);
|
665 |
|
666 |
-
|
|
|
|
|
|
|
667 |
}
|
668 |
|
669 |
/**
|
125 |
$translated_product_id = apply_filters( 'translate_object_id', $item_meta['product_id'], get_post_type( $item_meta['product_id'] ), false, $target_lang );
|
126 |
|
127 |
if ( $translated_product_id ) {
|
128 |
+
$translated_item_id = $this->get_item_id_for_language( $item_id, $target_lang );
|
129 |
$translated_item_ids[] = $translated_item_id;
|
130 |
|
131 |
$translated_item = $this->product_bundles_items->get_item_data_object( $translated_item_id );
|
132 |
foreach ( $fields_to_sync as $key ) {
|
133 |
+
if ( isset( $item_meta[ $key ] ) ) {
|
134 |
+
$this->product_bundles_items->update_item_meta( $translated_item, $key, $item_meta[ $key ] );
|
135 |
+
}
|
136 |
}
|
137 |
|
138 |
|
146 |
}
|
147 |
}
|
148 |
|
149 |
+
if ( isset( $item_meta['default_variation_attributes'] ) ) {
|
150 |
+
$default_variation_attributes = $this->translate_default_variation_attributes( $item_meta['default_variation_attributes'], $target_lang );
|
151 |
+
$this->product_bundles_items->update_item_meta( $translated_item, 'default_variation_attributes', $default_variation_attributes );
|
152 |
+
}
|
153 |
+
|
154 |
$this->product_bundles_items->save_item_meta( $translated_item );
|
155 |
|
156 |
}
|
209 |
return $allowed_variations;
|
210 |
}
|
211 |
|
212 |
+
/**
|
213 |
+
* @param array $original_default_variation_attributes
|
214 |
+
* @param string $target_lang
|
215 |
+
*
|
216 |
+
* @return array
|
217 |
+
*/
|
218 |
+
public function translate_default_variation_attributes( $original_default_variation_attributes, $target_lang ) {
|
219 |
+
$default_variation_attributes = array();
|
220 |
+
|
221 |
+
if ( is_array( $original_default_variation_attributes ) ) {
|
222 |
+
foreach ( $original_default_variation_attributes as $attribute_taxonomy => $attribute_slug ) {
|
223 |
+
$attribute_term_id = $this->woocommerce_wpml->terms->wcml_get_term_id_by_slug( $attribute_taxonomy, $attribute_slug );
|
224 |
+
$translated_attribute_term_id = apply_filters( 'translate_object_id', $attribute_term_id, $attribute_taxonomy, true, $target_lang );
|
225 |
+
$translated_term = $this->woocommerce_wpml->terms->wcml_get_term_by_id( $translated_attribute_term_id, $attribute_taxonomy );
|
226 |
+
|
227 |
+
$default_variation_attributes[ $attribute_taxonomy ] = $translated_term->slug;
|
228 |
+
}
|
229 |
+
}
|
230 |
+
|
231 |
+
return $default_variation_attributes;
|
232 |
+
}
|
233 |
+
|
234 |
private function get_product_id_for_item_id( $item_id ) {
|
235 |
|
236 |
return $this->wpdb->get_var( $this->wpdb->prepare(
|
237 |
"SELECT product_id FROM {$this->wpdb->prefix}woocommerce_bundled_items WHERE bundled_item_id=%d", $item_id ) );
|
238 |
}
|
239 |
|
240 |
+
/**
|
241 |
+
* @param array $item_id
|
242 |
+
* @param string $language
|
243 |
+
*
|
244 |
+
* @return string
|
245 |
+
*/
|
246 |
+
public function get_item_id_for_language( $item_id, $language ) {
|
247 |
|
248 |
return $this->wpdb->get_var( $this->wpdb->prepare(
|
249 |
+
"SELECT meta_value FROM {$this->wpdb->prefix}woocommerce_bundled_itemmeta WHERE bundled_item_id=%d AND meta_key=%s", $item_id, 'translation_item_id_of_'.$language ) );
|
250 |
+
|
251 |
+
}
|
252 |
+
|
253 |
+
/**
|
254 |
+
* @param int $original_item_id
|
255 |
+
* @param int $translated_item_id
|
256 |
+
* @param string $language
|
257 |
+
*/
|
258 |
+
public function set_translated_item_id_relationship( $original_item_id, $translated_item_id, $language ) {
|
259 |
+
|
260 |
+
$this->wpdb->insert( $this->wpdb->prefix . 'woocommerce_bundled_itemmeta',
|
261 |
+
array(
|
262 |
+
'bundled_item_id' => $original_item_id,
|
263 |
+
'meta_key' => 'translation_item_id_of_'.$language,
|
264 |
+
'meta_value' => $translated_item_id,
|
265 |
+
)
|
266 |
+
);
|
267 |
+
|
268 |
}
|
269 |
|
270 |
// Add Bundles Box to WCML Translation GUI
|
355 |
|
356 |
$translated_product_id = apply_filters( 'translate_object_id', $product_id, get_post_type( $product_id ), false, $lang );
|
357 |
if ( $translation ) {
|
358 |
+
$translated_item_id = $this->get_item_id_for_language( $item_id, $lang );
|
359 |
}
|
360 |
|
361 |
if ( $bundle_data[ $item_id ]['override_title'] == 'yes' ) {
|
395 |
$product_id = $this->get_product_id_for_item_id( $item_id );
|
396 |
foreach ( $fields as $field ) {
|
397 |
if ( $product_data[ 'override_' . $field ] == 'yes' && ! empty( $product_data[ $field ] ) ) {
|
398 |
+
$package['contents'][ 'product_bundles:' . $product_id . ':'.$item_id.':'. $field ] = array(
|
399 |
'translate' => 1,
|
400 |
'data' => $this->tp->encode_field_data( $product_data[ $field ], 'base64' ),
|
401 |
'format' => 'base64'
|
444 |
'menu_order' => $menu_order,
|
445 |
)
|
446 |
);
|
447 |
+
|
448 |
+
$translated_item_id = $this->wpdb->insert_id;
|
449 |
+
$this->set_translated_item_id_relationship( $item_id, $translated_item_id, $lang );
|
450 |
}
|
451 |
|
452 |
+
$translated_item_id = $this->get_item_id_for_language( $item_id, $lang );
|
453 |
|
454 |
//$this->product_bundles_items->copy_item_data( $item_id, $translated_item_id );
|
455 |
|
501 |
|
502 |
if ( $translated_product_id ) {
|
503 |
|
504 |
+
$translated_item_id = $this->get_item_id_for_language( $item_id, $lang );
|
505 |
if ( ! $translated_item_id ) {
|
506 |
$menu_order = $this->wpdb->get_var( $this->wpdb->prepare( "
|
507 |
SELECT menu_order FROM {$this->wpdb->prefix}woocommerce_bundled_items
|
516 |
)
|
517 |
);
|
518 |
$translated_item_id = $this->wpdb->insert_id;
|
519 |
+
$this->set_translated_item_id_relationship( $item_id, $translated_item_id, $lang );
|
520 |
}
|
521 |
|
522 |
$translated_bundle_data[ $translated_item_id ] = $product_data;
|
655 |
|
656 |
foreach ( $data as $value ) {
|
657 |
|
658 |
+
if ( preg_match( '/product_bundles:([0-9]+):([0-9]+):(.+)/', $value['field_type'], $matches ) ) {
|
659 |
|
660 |
$product_id = $matches[1];
|
661 |
+
$item_id = $matches[2];
|
662 |
+
$field = $matches[3];
|
663 |
+
|
664 |
|
665 |
$translated_product_id = apply_filters( 'translate_object_id', $product_id, get_post_type( $product_id ), false, $job->language_code );
|
666 |
+
$translated_item_id = $this->get_item_id_for_language( $item_id, $job->language_code );
|
667 |
if ( empty( $translated_item_id ) ) {
|
668 |
+
$translated_item_id = $this->add_product_to_bundle( $translated_product_id, $translated_bundle_id, $item_id, $job->language_code );
|
669 |
}
|
670 |
|
|
|
|
|
671 |
if ( ! isset( $translated_bundle_data[ $translated_item_id ] ) ) {
|
672 |
$translated_bundle_data[ $translated_item_id ] = array(
|
673 |
'product_id' => $translated_product_id,
|
704 |
}
|
705 |
}
|
706 |
|
707 |
+
private function add_product_to_bundle( $product_id, $bundle_id, $item_id, $language ) {
|
708 |
+
|
709 |
$menu_order = $this->wpdb->get_var( $this->wpdb->prepare( "
|
710 |
SELECT menu_order FROM {$this->wpdb->prefix}woocommerce_bundled_items
|
711 |
+
WHERE bundled_item_id=%d
|
712 |
+
", $item_id ) );
|
713 |
|
714 |
$this->wpdb->insert( $this->wpdb->prefix . 'woocommerce_bundled_items',
|
715 |
array(
|
719 |
)
|
720 |
);
|
721 |
|
722 |
+
$translated_item_id = $this->wpdb->insert_id;
|
723 |
+
$this->set_translated_item_id_relationship( $item_id, $translated_item_id, $language );
|
724 |
+
|
725 |
+
return $translated_item_id;
|
726 |
}
|
727 |
|
728 |
/**
|
compatibility/class-wcml-wc-subscriptions.php
CHANGED
@@ -66,11 +66,14 @@ class WCML_WC_Subscriptions{
|
|
66 |
function subscriptions_product_sign_up_fee_filter( $subscription_sign_up_fee, $product ) {
|
67 |
|
68 |
if ( wcml_is_multi_currency_on() ) {
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
|
|
|
|
|
|
74 |
}
|
75 |
}
|
76 |
|
@@ -207,6 +210,7 @@ class WCML_WC_Subscriptions{
|
|
207 |
function register_endpoint( $query_vars, $wc_vars, $obj ){
|
208 |
|
209 |
$query_vars[ 'view-subscription' ] = $obj->get_endpoint_translation( 'view-subscription', isset( $wc_vars['view-subscription'] ) ? $wc_vars['view-subscription'] : 'view-subscription' );
|
|
|
210 |
return $query_vars;
|
211 |
}
|
212 |
|
66 |
function subscriptions_product_sign_up_fee_filter( $subscription_sign_up_fee, $product ) {
|
67 |
|
68 |
if ( wcml_is_multi_currency_on() ) {
|
69 |
+
$currency = $this->woocommerce_wpml->multi_currency->get_client_currency();
|
70 |
+
|
71 |
+
if ( $currency !== get_option( 'woocommerce_currency' ) ) {
|
72 |
+
if ( get_post_meta( $product->get_id(), '_wcml_custom_prices_status', true ) ) {
|
73 |
+
$subscription_sign_up_fee = get_post_meta( $product->get_id(), '_subscription_sign_up_fee_' . $currency, true );
|
74 |
+
} else {
|
75 |
+
$subscription_sign_up_fee = apply_filters( 'wcml_raw_price_amount', $subscription_sign_up_fee );
|
76 |
+
}
|
77 |
}
|
78 |
}
|
79 |
|
210 |
function register_endpoint( $query_vars, $wc_vars, $obj ){
|
211 |
|
212 |
$query_vars[ 'view-subscription' ] = $obj->get_endpoint_translation( 'view-subscription', isset( $wc_vars['view-subscription'] ) ? $wc_vars['view-subscription'] : 'view-subscription' );
|
213 |
+
$query_vars[ 'subscriptions' ] = $obj->get_endpoint_translation( 'subscriptions', isset( $wc_vars['subscriptions'] ) ? $wc_vars['subscriptions'] : 'subscriptions' );
|
214 |
return $query_vars;
|
215 |
}
|
216 |
|
inc/class-wcml-attributes.php
CHANGED
@@ -42,6 +42,17 @@ class WCML_Attributes{
|
|
42 |
}else{
|
43 |
add_filter( 'woocommerce_product_get_attributes', array( $this, 'filter_adding_to_cart_product_attributes_names' ) );
|
44 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
}
|
46 |
|
47 |
public function init(){
|
@@ -295,6 +306,7 @@ class WCML_Attributes{
|
|
295 |
|
296 |
public function sync_default_product_attr( $orig_post_id, $transl_post_id, $lang ){
|
297 |
$original_default_attributes = get_post_meta( $orig_post_id, '_default_attributes', true );
|
|
|
298 |
if( !empty( $original_default_attributes ) ){
|
299 |
$unserialized_default_attributes = array();
|
300 |
foreach(maybe_unserialize( $original_default_attributes ) as $attribute => $default_term_slug ){
|
@@ -319,6 +331,7 @@ class WCML_Attributes{
|
|
319 |
|
320 |
if( isset( $unserialized_orig_product_attributes[ $attribute ] ) ){
|
321 |
$orig_attr_values = explode( '|', $unserialized_orig_product_attributes[ $attribute ][ 'value' ] );
|
|
|
322 |
|
323 |
foreach( $orig_attr_values as $key => $orig_attr_value ){
|
324 |
$orig_attr_value_sanitized = strtolower( sanitize_title ( $orig_attr_value ) );
|
@@ -349,7 +362,14 @@ class WCML_Attributes{
|
|
349 |
}
|
350 |
|
351 |
$where = array( 'post_id' => $transl_post_id, 'meta_key' => '_default_attributes' );
|
352 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
353 |
}
|
354 |
|
355 |
/*
|
@@ -504,6 +524,12 @@ class WCML_Attributes{
|
|
504 |
|
505 |
if( isset( $args['attribute'] ) && isset( $args['product'] ) ){
|
506 |
$args['attribute'] = $this->filter_attribute_name( $args['attribute'], WooCommerce_Functions_Wrapper::get_product_id( $args['product'] ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
507 |
}
|
508 |
|
509 |
return $args;
|
@@ -564,4 +590,77 @@ class WCML_Attributes{
|
|
564 |
return false;
|
565 |
}
|
566 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
567 |
}
|
42 |
}else{
|
43 |
add_filter( 'woocommerce_product_get_attributes', array( $this, 'filter_adding_to_cart_product_attributes_names' ) );
|
44 |
}
|
45 |
+
|
46 |
+
if ( $this->woocommerce_wpml->products->is_product_display_as_translated_post_type() ) {
|
47 |
+
add_filter( 'woocommerce_available_variation', array(
|
48 |
+
$this,
|
49 |
+
'filter_available_variation_attribute_values_in_current_language'
|
50 |
+
) );
|
51 |
+
add_filter( 'get_post_metadata', array(
|
52 |
+
$this,
|
53 |
+
'filter_product_variation_post_meta_attribute_values_in_current_language'
|
54 |
+
), 10, 4 );
|
55 |
+
}
|
56 |
}
|
57 |
|
58 |
public function init(){
|
306 |
|
307 |
public function sync_default_product_attr( $orig_post_id, $transl_post_id, $lang ){
|
308 |
$original_default_attributes = get_post_meta( $orig_post_id, '_default_attributes', true );
|
309 |
+
|
310 |
if( !empty( $original_default_attributes ) ){
|
311 |
$unserialized_default_attributes = array();
|
312 |
foreach(maybe_unserialize( $original_default_attributes ) as $attribute => $default_term_slug ){
|
331 |
|
332 |
if( isset( $unserialized_orig_product_attributes[ $attribute ] ) ){
|
333 |
$orig_attr_values = explode( '|', $unserialized_orig_product_attributes[ $attribute ][ 'value' ] );
|
334 |
+
$orig_attr_values = array_map( 'trim', $orig_attr_values );
|
335 |
|
336 |
foreach( $orig_attr_values as $key => $orig_attr_value ){
|
337 |
$orig_attr_value_sanitized = strtolower( sanitize_title ( $orig_attr_value ) );
|
362 |
}
|
363 |
|
364 |
$where = array( 'post_id' => $transl_post_id, 'meta_key' => '_default_attributes' );
|
365 |
+
|
366 |
+
$translated_product_meta = get_post_meta( $transl_post_id );
|
367 |
+
if ( isset( $translated_product_meta['_default_attributes'] ) ) {
|
368 |
+
$this->wpdb->update( $this->wpdb->postmeta, $data, $where );
|
369 |
+
} else {
|
370 |
+
$this->wpdb->insert( $this->wpdb->postmeta, array_merge( $data, $where ) );
|
371 |
+
}
|
372 |
+
|
373 |
}
|
374 |
|
375 |
/*
|
524 |
|
525 |
if( isset( $args['attribute'] ) && isset( $args['product'] ) ){
|
526 |
$args['attribute'] = $this->filter_attribute_name( $args['attribute'], WooCommerce_Functions_Wrapper::get_product_id( $args['product'] ) );
|
527 |
+
|
528 |
+
if( $this->woocommerce_wpml->products->is_product_display_as_translated_post_type() ){
|
529 |
+
foreach( $args[ 'options' ] as $key => $attribute_value ){
|
530 |
+
$args[ 'options' ][ $key ] = $this->get_attribute_term_translation_in_current_language( $args[ 'attribute' ], $attribute_value );
|
531 |
+
}
|
532 |
+
}
|
533 |
}
|
534 |
|
535 |
return $args;
|
590 |
return false;
|
591 |
}
|
592 |
|
593 |
+
/**
|
594 |
+
*
|
595 |
+
* @param array $args
|
596 |
+
*
|
597 |
+
* @return array
|
598 |
+
*/
|
599 |
+
public function filter_available_variation_attribute_values_in_current_language( $args ) {
|
600 |
+
|
601 |
+
foreach ( $args['attributes'] as $attribute_key => $attribute_value ) {
|
602 |
+
|
603 |
+
$args['attributes'][ $attribute_key ] = $this->get_attribute_term_translation_in_current_language( substr( $attribute_key, 10 ), $attribute_value );
|
604 |
+
}
|
605 |
+
|
606 |
+
return $args;
|
607 |
+
}
|
608 |
+
|
609 |
+
/**
|
610 |
+
* @param null $value
|
611 |
+
* @param int $object_id
|
612 |
+
* @param string $meta_key
|
613 |
+
* @param bool $single
|
614 |
+
*
|
615 |
+
* @return array
|
616 |
+
*/
|
617 |
+
public function filter_product_variation_post_meta_attribute_values_in_current_language( $value, $object_id, $meta_key, $single ) {
|
618 |
+
|
619 |
+
if ( 'product_variation' === get_post_type( $object_id ) && '' === $meta_key ) {
|
620 |
+
|
621 |
+
remove_filter( 'get_post_metadata', array(
|
622 |
+
$this,
|
623 |
+
'filter_product_variation_post_meta_attribute_values_in_current_language'
|
624 |
+
), 10, 4 );
|
625 |
+
|
626 |
+
$all_meta = get_post_meta( $object_id );
|
627 |
+
|
628 |
+
add_filter( 'get_post_metadata', array(
|
629 |
+
$this,
|
630 |
+
'filter_product_variation_post_meta_attribute_values_in_current_language'
|
631 |
+
), 10, 4 );
|
632 |
+
|
633 |
+
if ( $all_meta ) {
|
634 |
+
foreach ( $all_meta as $meta_key => $meta_value ) {
|
635 |
+
if ( 'attribute_' === substr( $meta_key, 0, 10 ) ) {
|
636 |
+
foreach ( $meta_value as $key => $value ) {
|
637 |
+
$all_meta[ $meta_key ][ $key ] = $this->get_attribute_term_translation_in_current_language( substr( $meta_key, 10 ), $value );
|
638 |
+
}
|
639 |
+
}
|
640 |
+
}
|
641 |
+
|
642 |
+
return $all_meta;
|
643 |
+
}
|
644 |
+
|
645 |
+
}
|
646 |
+
|
647 |
+
return $value;
|
648 |
+
|
649 |
+
}
|
650 |
+
|
651 |
+
/**
|
652 |
+
*
|
653 |
+
* @param string $attribute_taxonomy
|
654 |
+
* @param string $attribute_value
|
655 |
+
*
|
656 |
+
* @return string
|
657 |
+
*/
|
658 |
+
private function get_attribute_term_translation_in_current_language( $attribute_taxonomy, $attribute_value ) {
|
659 |
+
|
660 |
+
$term = get_term_by( 'slug', $attribute_value, $attribute_taxonomy );
|
661 |
+
|
662 |
+
return $term->slug;
|
663 |
+
}
|
664 |
+
|
665 |
+
|
666 |
}
|
inc/class-wcml-cart.php
CHANGED
@@ -28,17 +28,19 @@ class WCML_Cart {
|
|
28 |
$this->enqueue_dialog_ui();
|
29 |
|
30 |
add_action( 'wcml_removed_cart_items', array( $this, 'wcml_removed_cart_items_widget' ) );
|
31 |
-
|
32 |
add_action( 'wp_ajax_nopriv_wcml_cart_clear_removed_items', array(
|
33 |
$this,
|
34 |
'wcml_cart_clear_removed_items'
|
35 |
) );
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
|
|
42 |
} else {
|
43 |
//cart widget
|
44 |
add_action( 'wp_ajax_woocommerce_get_refreshed_fragments', array( $this, 'wcml_refresh_fragments' ), 0 );
|
@@ -88,6 +90,21 @@ class WCML_Cart {
|
|
88 |
return false;
|
89 |
}
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
public function enqueue_dialog_ui() {
|
92 |
|
93 |
wp_enqueue_script( 'jquery-ui-dialog' );
|
@@ -148,7 +165,8 @@ class WCML_Cart {
|
|
148 |
|
149 |
public function cart_switching_currency( $exc, $current_currency, $new_currency, $return = false ) {
|
150 |
|
151 |
-
$cart_for_session = !is_null( WC()->cart ) ? WC()->cart->
|
|
|
152 |
if ( $this->woocommerce_wpml->settings['cart_sync']['currency_switch'] == WCML_CART_SYNC || empty( $cart_for_session ) ) {
|
153 |
return $exc;
|
154 |
}
|
28 |
$this->enqueue_dialog_ui();
|
29 |
|
30 |
add_action( 'wcml_removed_cart_items', array( $this, 'wcml_removed_cart_items_widget' ) );
|
31 |
+
add_action( 'wp_ajax_wcml_cart_clear_removed_items', array( $this, 'wcml_cart_clear_removed_items' ) );
|
32 |
add_action( 'wp_ajax_nopriv_wcml_cart_clear_removed_items', array(
|
33 |
$this,
|
34 |
'wcml_cart_clear_removed_items'
|
35 |
) );
|
36 |
|
37 |
+
if( $this->is_clean_cart_enabled_for_currency_switch() ){
|
38 |
+
add_filter( 'wcml_switch_currency_exception', array( $this, 'cart_switching_currency' ), 10, 4 );
|
39 |
+
add_action( 'wcml_before_switch_currency', array(
|
40 |
+
$this,
|
41 |
+
'switching_currency_empty_cart_if_needed'
|
42 |
+
), 10, 2 );
|
43 |
+
}
|
44 |
} else {
|
45 |
//cart widget
|
46 |
add_action( 'wp_ajax_woocommerce_get_refreshed_fragments', array( $this, 'wcml_refresh_fragments' ), 0 );
|
90 |
return false;
|
91 |
}
|
92 |
|
93 |
+
private function is_clean_cart_enabled_for_currency_switch() {
|
94 |
+
|
95 |
+
$cart_sync_settings = $this->woocommerce_wpml->settings['cart_sync'];
|
96 |
+
$wpml_cookies_enabled = $this->sitepress->get_setting( $this->sitepress->get_wp_api()->constant( 'WPML_Cookie_Setting::COOKIE_SETTING_FIELD' ) );
|
97 |
+
|
98 |
+
if (
|
99 |
+
$wpml_cookies_enabled &&
|
100 |
+
$cart_sync_settings['currency_switch'] === $this->sitepress->get_wp_api()->constant( 'WCML_CART_CLEAR' )
|
101 |
+
) {
|
102 |
+
return true;
|
103 |
+
}
|
104 |
+
|
105 |
+
return false;
|
106 |
+
}
|
107 |
+
|
108 |
public function enqueue_dialog_ui() {
|
109 |
|
110 |
wp_enqueue_script( 'jquery-ui-dialog' );
|
165 |
|
166 |
public function cart_switching_currency( $exc, $current_currency, $new_currency, $return = false ) {
|
167 |
|
168 |
+
$cart_for_session = !is_null( WC()->cart ) ? array_filter( WC()->cart->get_cart_contents() ) : false;
|
169 |
+
|
170 |
if ( $this->woocommerce_wpml->settings['cart_sync']['currency_switch'] == WCML_CART_SYNC || empty( $cart_for_session ) ) {
|
171 |
return $exc;
|
172 |
}
|
inc/class-wcml-compatibility.php
CHANGED
@@ -229,6 +229,12 @@ class WCML_Compatibility {
|
|
229 |
$this->maxstore->add_hooks();
|
230 |
}
|
231 |
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
}
|
233 |
|
234 |
}
|
229 |
$this->maxstore->add_hooks();
|
230 |
}
|
231 |
|
232 |
+
// MaxStore-Pro Theme
|
233 |
+
if ( defined( 'ETHEME_THEME_NAME') && 'Blanco' === ETHEME_THEME_NAME ) {
|
234 |
+
$this->etheme_blanco = new WCML_Etheme_Blanco();
|
235 |
+
$this->etheme_blanco->add_hooks();
|
236 |
+
}
|
237 |
+
|
238 |
}
|
239 |
|
240 |
}
|
inc/class-wcml-endpoints.php
CHANGED
@@ -12,6 +12,7 @@ class WCML_Endpoints{
|
|
12 |
add_action( 'icl_ajx_custom_call', array( $this, 'rewrite_rule_endpoints' ), 11, 2 );
|
13 |
add_action( 'woocommerce_update_options', array( $this, 'add_endpoints' ) );
|
14 |
add_filter( 'pre_update_option_rewrite_rules', array( $this, 'update_rewrite_rules' ), 100, 2 );
|
|
|
15 |
|
16 |
add_filter( 'page_link', array( $this, 'endpoint_permalink_filter' ), 10, 2 ); //after WPML
|
17 |
|
@@ -20,8 +21,6 @@ class WCML_Endpoints{
|
|
20 |
$this->maybe_flush_rules();
|
21 |
$this->register_endpoints_translations();
|
22 |
add_filter('pre_get_posts', array($this, 'check_if_endpoint_exists'));
|
23 |
-
}else{
|
24 |
-
add_filter( 'wpml_sl_blacklist_requests', array( $this, 'reserved_requests' ), 10, 2 );
|
25 |
}
|
26 |
|
27 |
add_filter( 'woocommerce_get_endpoint_url', array( $this, 'filter_get_endpoint_url' ), 10, 4 );
|
@@ -52,6 +51,7 @@ class WCML_Endpoints{
|
|
52 |
$account_base = $my_account_page->post_name;
|
53 |
|
54 |
$reserved_requests[] = $account_base;
|
|
|
55 |
|
56 |
foreach ( $this->woocommerce_wpml->get_wc_query_vars() as $key => $endpoint ) {
|
57 |
$translated_endpoint = $this->get_endpoint_translation( $key, $endpoint, $language_code );
|
@@ -212,11 +212,13 @@ class WCML_Endpoints{
|
|
212 |
|
213 |
foreach( $endpoints as $key => $endpoint ){
|
214 |
if( isset($wp->query_vars[$key]) ){
|
215 |
-
if(
|
216 |
$endpoint = get_option( 'woocommerce_checkout_pay_endpoint' );
|
217 |
$p .= isset( $_SERVER[ 'QUERY_STRING' ] ) ? '?'.$_SERVER[ 'QUERY_STRING' ] : '';
|
218 |
-
}elseif(
|
219 |
$endpoint = get_option( 'woocommerce_checkout_order_received_endpoint' );
|
|
|
|
|
220 |
}else{
|
221 |
$endpoint = get_option( 'woocommerce_myaccount_'.str_replace( '-','_',$key).'_endpoint', $endpoint );
|
222 |
}
|
12 |
add_action( 'icl_ajx_custom_call', array( $this, 'rewrite_rule_endpoints' ), 11, 2 );
|
13 |
add_action( 'woocommerce_update_options', array( $this, 'add_endpoints' ) );
|
14 |
add_filter( 'pre_update_option_rewrite_rules', array( $this, 'update_rewrite_rules' ), 100, 2 );
|
15 |
+
add_filter( 'wpml_sl_blacklist_requests', array( $this, 'reserved_requests' ), 10, 2 );
|
16 |
|
17 |
add_filter( 'page_link', array( $this, 'endpoint_permalink_filter' ), 10, 2 ); //after WPML
|
18 |
|
21 |
$this->maybe_flush_rules();
|
22 |
$this->register_endpoints_translations();
|
23 |
add_filter('pre_get_posts', array($this, 'check_if_endpoint_exists'));
|
|
|
|
|
24 |
}
|
25 |
|
26 |
add_filter( 'woocommerce_get_endpoint_url', array( $this, 'filter_get_endpoint_url' ), 10, 4 );
|
51 |
$account_base = $my_account_page->post_name;
|
52 |
|
53 |
$reserved_requests[] = $account_base;
|
54 |
+
$reserved_requests[] = '/^' . $account_base . '/'; // regex version
|
55 |
|
56 |
foreach ( $this->woocommerce_wpml->get_wc_query_vars() as $key => $endpoint ) {
|
57 |
$translated_endpoint = $this->get_endpoint_translation( $key, $endpoint, $language_code );
|
212 |
|
213 |
foreach( $endpoints as $key => $endpoint ){
|
214 |
if( isset($wp->query_vars[$key]) ){
|
215 |
+
if( 'order-pay' === $key ){
|
216 |
$endpoint = get_option( 'woocommerce_checkout_pay_endpoint' );
|
217 |
$p .= isset( $_SERVER[ 'QUERY_STRING' ] ) ? '?'.$_SERVER[ 'QUERY_STRING' ] : '';
|
218 |
+
}elseif( 'order-received' === $key ){
|
219 |
$endpoint = get_option( 'woocommerce_checkout_order_received_endpoint' );
|
220 |
+
}elseif( 'customer-logout' === $key ){
|
221 |
+
$endpoint = get_option( 'woocommerce_logout_endpoint' );
|
222 |
}else{
|
223 |
$endpoint = get_option( 'woocommerce_myaccount_'.str_replace( '-','_',$key).'_endpoint', $endpoint );
|
224 |
}
|
inc/class-wcml-orders.php
CHANGED
@@ -88,30 +88,28 @@ class WCML_Orders{
|
|
88 |
return $translations;
|
89 |
}
|
90 |
|
91 |
-
function get_filtered_comments($comments){
|
92 |
|
93 |
$user_id = get_current_user_id();
|
94 |
|
95 |
-
|
96 |
-
|
97 |
-
$user_language = get_user_meta( $user_id, 'icl_admin_language', true );
|
98 |
|
99 |
-
|
|
|
100 |
|
101 |
-
|
|
|
102 |
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
}
|
109 |
-
}
|
110 |
-
|
111 |
-
}
|
112 |
|
113 |
-
|
114 |
|
|
|
115 |
}
|
116 |
|
117 |
function woocommerce_order_get_items( $items, $order ){
|
88 |
return $translations;
|
89 |
}
|
90 |
|
91 |
+
function get_filtered_comments( $comments ){
|
92 |
|
93 |
$user_id = get_current_user_id();
|
94 |
|
95 |
+
if ( $user_id ) {
|
96 |
+
$user_language = get_user_meta( $user_id, 'icl_admin_language', true );
|
|
|
97 |
|
98 |
+
foreach ( $comments as $key => $comment ) {
|
99 |
+
$comment_string_id = icl_get_string_id( $comment->comment_content, 'woocommerce' );
|
100 |
|
101 |
+
if ( $comment_string_id ) {
|
102 |
+
$comment_strings = icl_get_string_translations_by_id( $comment_string_id );
|
103 |
|
104 |
+
if ( $comment_strings && isset( $comment_strings[ $user_language ] ) ) {
|
105 |
+
$comments[ $key ]->comment_content = $comment_strings[ $user_language ][ 'value' ];
|
106 |
+
}
|
107 |
+
}
|
108 |
+
}
|
|
|
|
|
|
|
|
|
109 |
|
110 |
+
}
|
111 |
|
112 |
+
return $comments;
|
113 |
}
|
114 |
|
115 |
function woocommerce_order_get_items( $items, $order ){
|
inc/class-wcml-products.php
CHANGED
@@ -63,7 +63,6 @@ class WCML_Products{
|
|
63 |
|
64 |
add_filter( 'wpml_override_is_translator', array( $this, 'wcml_override_is_translator' ), 10, 3 );
|
65 |
add_filter( 'wc_product_has_unique_sku', array( $this, 'check_product_sku' ), 10, 3 );
|
66 |
-
|
67 |
}
|
68 |
|
69 |
// Check if original product
|
@@ -647,4 +646,13 @@ class WCML_Products{
|
|
647 |
|
648 |
}
|
649 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
650 |
}
|
63 |
|
64 |
add_filter( 'wpml_override_is_translator', array( $this, 'wcml_override_is_translator' ), 10, 3 );
|
65 |
add_filter( 'wc_product_has_unique_sku', array( $this, 'check_product_sku' ), 10, 3 );
|
|
|
66 |
}
|
67 |
|
68 |
// Check if original product
|
646 |
|
647 |
}
|
648 |
|
649 |
+
|
650 |
+
/**
|
651 |
+
*
|
652 |
+
* @return bool
|
653 |
+
*/
|
654 |
+
public function is_product_display_as_translated_post_type() {
|
655 |
+
return apply_filters( 'wpml_is_display_as_translated_post_type', false, 'product' );
|
656 |
+
}
|
657 |
+
|
658 |
}
|
inc/class-wcml-store-pages.php
CHANGED
@@ -11,24 +11,31 @@ class WCML_Store_Pages{
|
|
11 |
*/
|
12 |
private $sitepress;
|
13 |
|
14 |
-
function __construct( $woocommerce_wpml, $sitepress ){
|
15 |
|
16 |
-
|
17 |
-
$this->sitepress
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
|
|
27 |
|
28 |
if( is_admin() ){
|
29 |
-
|
30 |
}
|
31 |
-
|
|
|
|
|
|
|
32 |
|
33 |
function init(){
|
34 |
|
@@ -624,5 +631,18 @@ class WCML_Store_Pages{
|
|
624 |
|
625 |
|
626 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
627 |
|
628 |
}
|
11 |
*/
|
12 |
private $sitepress;
|
13 |
|
14 |
+
function __construct( woocommerce_wpml $woocommerce_wpml, SitePress $sitepress ){
|
15 |
|
16 |
+
$this->woocommerce_wpml = $woocommerce_wpml;
|
17 |
+
$this->sitepress = $sitepress;
|
18 |
|
19 |
+
}
|
20 |
+
|
21 |
+
public function add_hooks(){
|
22 |
+
|
23 |
+
add_action( 'init', array( $this, 'init' ) );
|
24 |
+
add_filter( 'woocommerce_create_pages', array( $this, 'switch_pages_language' ), 9 );
|
25 |
+
add_filter( 'woocommerce_create_pages', array( $this, 'install_pages_action' ), 11 );
|
26 |
+
//update wc pages ids after change default language or create new if not exists
|
27 |
+
add_action( 'icl_after_set_default_language', array( $this, 'after_set_default_language' ), 10, 2 );
|
28 |
+
// Translate shop page ids
|
29 |
+
$this->add_filter_to_get_shop_translated_page_id();
|
30 |
+
add_filter( 'template_include', array( $this, 'template_loader' ), 100 );
|
31 |
|
32 |
if( is_admin() ){
|
33 |
+
add_action( 'icl_post_languages_options_before', array( $this, 'show_translate_shop_pages_notice') );
|
34 |
}
|
35 |
+
|
36 |
+
add_filter( 'post_type_archive_link', array( $this, 'filter_shop_archive_link' ), 10, 2 );
|
37 |
+
|
38 |
+
}
|
39 |
|
40 |
function init(){
|
41 |
|
631 |
|
632 |
|
633 |
}
|
634 |
+
|
635 |
+
public function filter_shop_archive_link( $link, $post_type ){
|
636 |
+
|
637 |
+
if(
|
638 |
+
'product' === $post_type &&
|
639 |
+
(int)$this->front_page_id === (int)$this->shop_page_id &&
|
640 |
+
$this->sitepress->get_current_language() !== $this->sitepress->get_default_language()
|
641 |
+
){
|
642 |
+
$link = home_url( '/' );
|
643 |
+
}
|
644 |
+
|
645 |
+
return $link;
|
646 |
+
}
|
647 |
|
648 |
}
|
inc/class-wcml-upgrade.php
CHANGED
@@ -20,7 +20,8 @@ class WCML_Upgrade{
|
|
20 |
'4.0',
|
21 |
'4.1.0',
|
22 |
'4.2.0',
|
23 |
-
'4.2.2'
|
|
|
24 |
);
|
25 |
|
26 |
function __construct(){
|
@@ -115,7 +116,7 @@ class WCML_Upgrade{
|
|
115 |
}
|
116 |
|
117 |
}
|
118 |
-
|
119 |
if($migration_ran || empty($version_in_db)){
|
120 |
update_option('_wcml_version', WCML_VERSION);
|
121 |
}
|
@@ -617,4 +618,51 @@ class WCML_Upgrade{
|
|
617 |
|
618 |
}
|
619 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
620 |
}
|
20 |
'4.0',
|
21 |
'4.1.0',
|
22 |
'4.2.0',
|
23 |
+
'4.2.2',
|
24 |
+
'4.2.7'
|
25 |
);
|
26 |
|
27 |
function __construct(){
|
116 |
}
|
117 |
|
118 |
}
|
119 |
+
|
120 |
if($migration_ran || empty($version_in_db)){
|
121 |
update_option('_wcml_version', WCML_VERSION);
|
122 |
}
|
618 |
|
619 |
}
|
620 |
|
621 |
+
private function upgrade_4_2_7(){
|
622 |
+
|
623 |
+
// #wcml-2242
|
624 |
+
$wcml_settings = get_option( '_wcml_settings' );
|
625 |
+
if( 'yahoo' === $wcml_settings['multi_currency']['exchange_rates']['service'] ){
|
626 |
+
$wcml_settings['multi_currency']['exchange_rates']['service'] = 'fixierio';
|
627 |
+
update_option( '_wcml_settings', $wcml_settings );
|
628 |
+
}
|
629 |
+
|
630 |
+
global $wpdb, $woocommerce_wpml, $sitepress;
|
631 |
+
// #wcml-2241
|
632 |
+
if( $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->prefix.'woocommerce_bundled_itemmeta' ) ) ){
|
633 |
+
|
634 |
+
$bundled_items = $wpdb->get_results( "SELECT bundled_item_id, bundle_id, product_id FROM {$wpdb->prefix}woocommerce_bundled_items" );
|
635 |
+
$active_languages = $sitepress->get_active_languages();
|
636 |
+
|
637 |
+
foreach( $bundled_items as $bundled_item ){
|
638 |
+
|
639 |
+
if( $woocommerce_wpml->products->is_original_product( $bundled_item->bundle_id ) ){
|
640 |
+
|
641 |
+
foreach( $active_languages as $lang ){
|
642 |
+
|
643 |
+
if( $lang['code'] !== $woocommerce_wpml->products->get_original_product_language( $bundled_item->bundle_id ) ){
|
644 |
+
|
645 |
+
$translated_bundle_id = apply_filters( 'translate_object_id', $bundled_item->bundle_id, get_post_type( $bundled_item->bundle_id ), false, $lang['code'] );
|
646 |
+
$translated_product_id = apply_filters( 'translate_object_id', $bundled_item->product_id, get_post_type( $bundled_item->product_id ), false, $lang['code'] );
|
647 |
+
|
648 |
+
$translated_item_id = $wpdb->get_var( $wpdb->prepare(
|
649 |
+
"SELECT bundled_item_id FROM {$wpdb->prefix}woocommerce_bundled_items WHERE product_id=%d AND bundle_id=%d",
|
650 |
+
$translated_product_id, $translated_bundle_id
|
651 |
+
) );
|
652 |
+
|
653 |
+
$wpdb->insert( $wpdb->prefix . 'woocommerce_bundled_itemmeta',
|
654 |
+
array(
|
655 |
+
'bundled_item_id' => $bundled_item->bundled_item_id,
|
656 |
+
'meta_key' => 'translation_item_id_of_'.$lang['code'],
|
657 |
+
'meta_value' => $translated_item_id,
|
658 |
+
)
|
659 |
+
);
|
660 |
+
}
|
661 |
+
}
|
662 |
+
}
|
663 |
+
}
|
664 |
+
}
|
665 |
+
|
666 |
+
}
|
667 |
+
|
668 |
}
|
inc/class-wcml-url-translation.php
CHANGED
@@ -50,6 +50,10 @@ class WCML_Url_Translation {
|
|
50 |
$this,
|
51 |
'use_untranslated_default_url_bases'
|
52 |
), 1, 1 ); // avoid using the _x translations
|
|
|
|
|
|
|
|
|
53 |
}
|
54 |
|
55 |
add_filter( 'pre_update_option_rewrite_rules', array(
|
@@ -58,10 +62,7 @@ class WCML_Url_Translation {
|
|
58 |
), 1, 1 ); // high priority
|
59 |
add_filter( 'option_rewrite_rules', array( $this, 'translate_bases_in_rewrite_rules' ), 0, 1 ); // high priority
|
60 |
add_filter( 'term_link', array( $this, 'translate_taxonomy_base' ), 0, 3 ); // high priority
|
61 |
-
|
62 |
-
$this,
|
63 |
-
'fix_post_object_rewrite_slug'
|
64 |
-
), 6 ); // handle the particular case of the default product base: wpmlst-540
|
65 |
add_action( 'wp_ajax_wcml_update_base_translation', array( $this, 'wcml_update_base_translation' ) );
|
66 |
add_filter( 'redirect_canonical', array( $this, 'check_wc_tax_url_on_redirect' ), 10, 2 );
|
67 |
add_filter( 'query_vars', array( $this, 'translate_query_var_for_product' ) );
|
50 |
$this,
|
51 |
'use_untranslated_default_url_bases'
|
52 |
), 1, 1 ); // avoid using the _x translations
|
53 |
+
add_action( 'init', array(
|
54 |
+
$this,
|
55 |
+
'fix_post_object_rewrite_slug'
|
56 |
+
), 6 ); // handle the particular case of the default product base: wpmlst-540
|
57 |
}
|
58 |
|
59 |
add_filter( 'pre_update_option_rewrite_rules', array(
|
62 |
), 1, 1 ); // high priority
|
63 |
add_filter( 'option_rewrite_rules', array( $this, 'translate_bases_in_rewrite_rules' ), 0, 1 ); // high priority
|
64 |
add_filter( 'term_link', array( $this, 'translate_taxonomy_base' ), 0, 3 ); // high priority
|
65 |
+
|
|
|
|
|
|
|
66 |
add_action( 'wp_ajax_wcml_update_base_translation', array( $this, 'wcml_update_base_translation' ) );
|
67 |
add_filter( 'redirect_canonical', array( $this, 'check_wc_tax_url_on_redirect' ), 10, 2 );
|
68 |
add_filter( 'query_vars', array( $this, 'translate_query_var_for_product' ) );
|
inc/class-woocommerce-wpml.php
CHANGED
@@ -191,6 +191,7 @@ class woocommerce_wpml {
|
|
191 |
$this->products = new WCML_Products( $this, $sitepress, $wpdb );
|
192 |
$this->products->add_hooks();
|
193 |
$this->store = new WCML_Store_Pages ( $this, $sitepress );
|
|
|
194 |
$this->strings = new WCML_WC_Strings( $this, $sitepress );
|
195 |
$this->strings->add_hooks();
|
196 |
$this->emails = new WCML_Emails( $this, $sitepress, $woocommerce );
|
191 |
$this->products = new WCML_Products( $this, $sitepress, $wpdb );
|
192 |
$this->products->add_hooks();
|
193 |
$this->store = new WCML_Store_Pages ( $this, $sitepress );
|
194 |
+
$this->store->add_hooks();
|
195 |
$this->strings = new WCML_WC_Strings( $this, $sitepress );
|
196 |
$this->strings->add_hooks();
|
197 |
$this->emails = new WCML_Emails( $this, $sitepress, $woocommerce );
|
inc/currencies/class-wcml-exchange-rates.php
CHANGED
@@ -26,7 +26,6 @@ class WCML_Exchange_Rates{
|
|
26 |
$this->initialize_settings();
|
27 |
|
28 |
// Load built in services
|
29 |
-
$this->services['yahoo'] = new WCML_Exchange_Rates_YahooFinance();
|
30 |
$this->services['fixierio'] = new WCML_Exchange_Rates_Fixierio();
|
31 |
$this->services['currencylayer'] = new WCML_Exchange_Rates_Currencylayer();
|
32 |
|
@@ -59,7 +58,7 @@ class WCML_Exchange_Rates{
|
|
59 |
|
60 |
$this->settings = array(
|
61 |
'automatic' => 0,
|
62 |
-
'service' => '
|
63 |
'lifting_charge' => 0,
|
64 |
'schedule' => 'manual',
|
65 |
'week_day' => 1,
|
@@ -318,8 +317,8 @@ class WCML_Exchange_Rates{
|
|
318 |
if( $this->settings['month_day'] >= date('j') && $this->settings['month_day'] <= $days_in_current_month ){
|
319 |
$interval = 3600 * 24 * $days_in_current_month;
|
320 |
}else{
|
321 |
-
$month_number = $current_month == 12 ? 1 : $current_month + 1;
|
322 |
-
$year_number = $current_month == 12 ? date('Y') + 1 : date('Y');
|
323 |
$interval = 3600 * 24 * cal_days_in_month( CAL_GREGORIAN, $month_number, $year_number );
|
324 |
}
|
325 |
|
26 |
$this->initialize_settings();
|
27 |
|
28 |
// Load built in services
|
|
|
29 |
$this->services['fixierio'] = new WCML_Exchange_Rates_Fixierio();
|
30 |
$this->services['currencylayer'] = new WCML_Exchange_Rates_Currencylayer();
|
31 |
|
58 |
|
59 |
$this->settings = array(
|
60 |
'automatic' => 0,
|
61 |
+
'service' => 'fixierio',
|
62 |
'lifting_charge' => 0,
|
63 |
'schedule' => 'manual',
|
64 |
'week_day' => 1,
|
317 |
if( $this->settings['month_day'] >= date('j') && $this->settings['month_day'] <= $days_in_current_month ){
|
318 |
$interval = 3600 * 24 * $days_in_current_month;
|
319 |
}else{
|
320 |
+
$month_number = (int)$current_month == 12 ? 1 : $current_month + 1;
|
321 |
+
$year_number = (int)$current_month == 12 ? date('Y') + 1 : date('Y');
|
322 |
$interval = 3600 * 24 * cal_days_in_month( CAL_GREGORIAN, $month_number, $year_number );
|
323 |
}
|
324 |
|
inc/currencies/class-wcml-multi-currency-shipping.php
CHANGED
@@ -117,8 +117,10 @@ class WCML_Multi_Currency_Shipping{
|
|
117 |
foreach ( $packages as $package_id => $package ) {
|
118 |
if ( isset( $package['rates'] ) ) {
|
119 |
foreach ( $package['rates'] as $rate_id => $rate ) {
|
120 |
-
|
121 |
-
|
|
|
|
|
122 |
}
|
123 |
}
|
124 |
}
|
117 |
foreach ( $packages as $package_id => $package ) {
|
118 |
if ( isset( $package['rates'] ) ) {
|
119 |
foreach ( $package['rates'] as $rate_id => $rate ) {
|
120 |
+
if( $rate->get_shipping_tax() > 0 ){
|
121 |
+
$packages[ $package_id ]['rates'][ $rate_id ]->taxes =
|
122 |
+
WC_Tax::calc_shipping_tax( $packages[ $package_id ]['rates'][ $rate_id ]->cost, WC_Tax::get_shipping_tax_rates() );
|
123 |
+
}
|
124 |
}
|
125 |
}
|
126 |
}
|
inc/template-classes/setup/class-wcml-setup-attributes-ui.php
CHANGED
@@ -33,6 +33,7 @@ class WCML_Setup_Attributes_UI extends WPML_Templates_Factory {
|
|
33 |
|
34 |
$model = array(
|
35 |
'strings' => array(
|
|
|
36 |
'heading' => __('Select Translatable Attributes', 'woocommerce-multilingual'),
|
37 |
'no_attributes' => __('There are no attributes defined', 'woocommerce-multilingual'),
|
38 |
'continue' => __('Continue', 'woocommerce-multilingual'),
|
33 |
|
34 |
$model = array(
|
35 |
'strings' => array(
|
36 |
+
'step_id' => 'attributes_step',
|
37 |
'heading' => __('Select Translatable Attributes', 'woocommerce-multilingual'),
|
38 |
'no_attributes' => __('There are no attributes defined', 'woocommerce-multilingual'),
|
39 |
'continue' => __('Continue', 'woocommerce-multilingual'),
|
inc/template-classes/setup/class-wcml-setup-introduction-ui.php
CHANGED
@@ -17,14 +17,15 @@ class WCML_Setup_Introduction_UI extends WPML_Templates_Factory {
|
|
17 |
|
18 |
$model = array(
|
19 |
'strings' => array(
|
20 |
-
'
|
|
|
21 |
'description1' => __('Thank you for choosing WooCommerce Multilingual. We need to do a few upgrades to your site, so that it has everything needed to run multilingual.', 'woocommerce-multilingual'),
|
22 |
'description2' => array(
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
|
29 |
),
|
30 |
'description3' => sprintf( __("You can make these updates now, or later from the %sWooCommerce » WooCommerce Multilingual%s menu.", 'woocommerce-multilingual'), '<strong>', '</strong>' ),
|
17 |
|
18 |
$model = array(
|
19 |
'strings' => array(
|
20 |
+
'step_id' => 'introduction_step',
|
21 |
+
'heading' => __("Let's turn your WooCommerce shop multilingual", 'woocommerce-multilingual'),
|
22 |
'description1' => __('Thank you for choosing WooCommerce Multilingual. We need to do a few upgrades to your site, so that it has everything needed to run multilingual.', 'woocommerce-multilingual'),
|
23 |
'description2' => array(
|
24 |
|
25 |
+
'title' => __("We'll help you:", 'woocommerce-multilingual'),
|
26 |
+
'step1' => __("Translate the 'store' pages", 'woocommerce-multilingual'),
|
27 |
+
'step2' => __("Choose which attributes to make translatable", 'woocommerce-multilingual'),
|
28 |
+
'step3' => __("Choose if you need multiple currencies", 'woocommerce-multilingual'),
|
29 |
|
30 |
),
|
31 |
'description3' => sprintf( __("You can make these updates now, or later from the %sWooCommerce » WooCommerce Multilingual%s menu.", 'woocommerce-multilingual'), '<strong>', '</strong>' ),
|
inc/template-classes/setup/class-wcml-setup-multi-currency-ui.php
CHANGED
@@ -17,6 +17,7 @@ class WCML_Setup_Multi_Currency_UI extends WPML_Templates_Factory {
|
|
17 |
|
18 |
$model = array(
|
19 |
'strings' => array(
|
|
|
20 |
'heading' => __( 'Enable Multiple Currencies', 'woocommerce-multilingual' ),
|
21 |
'description' => __( "This will allow you to set prices for products in different currencies. The prices can be determined based on a given exchange rate or set explicitly for specific products.", 'woocommerce-multilingual' ),
|
22 |
'label_mco' => __( 'Enable the multi-currency mode', 'woocommerce-multilingual' ),
|
17 |
|
18 |
$model = array(
|
19 |
'strings' => array(
|
20 |
+
'step_id' => 'currency_step',
|
21 |
'heading' => __( 'Enable Multiple Currencies', 'woocommerce-multilingual' ),
|
22 |
'description' => __( "This will allow you to set prices for products in different currencies. The prices can be determined based on a given exchange rate or set explicitly for specific products.", 'woocommerce-multilingual' ),
|
23 |
'label_mco' => __( 'Enable the multi-currency mode', 'woocommerce-multilingual' ),
|
inc/template-classes/setup/class-wcml-setup-ready-ui.php
CHANGED
@@ -27,6 +27,7 @@ class WCML_Setup_Ready_UI extends WPML_Templates_Factory {
|
|
27 |
|
28 |
$model = array(
|
29 |
'strings' => array(
|
|
|
30 |
'heading' => __('Setup Complete', 'woocommerce-multilingual'),
|
31 |
'description1' => __('Your multilingual shop is almost ready. Next, you should go to the different tabs in %sWooCommerce » WooCommerce Multilingual%s admin and do the final setup.', 'woocommerce-multilingual'),
|
32 |
'description2' => __("For your convenience, we've marked items that require your attention with a notice icon. You can see a list of everything that you should complete in the %sStatus%s tab.", 'woocommerce-multilingual'),
|
27 |
|
28 |
$model = array(
|
29 |
'strings' => array(
|
30 |
+
'step_id' => 'ready_step',
|
31 |
'heading' => __('Setup Complete', 'woocommerce-multilingual'),
|
32 |
'description1' => __('Your multilingual shop is almost ready. Next, you should go to the different tabs in %sWooCommerce » WooCommerce Multilingual%s admin and do the final setup.', 'woocommerce-multilingual'),
|
33 |
'description2' => __("For your convenience, we've marked items that require your attention with a notice icon. You can see a list of everything that you should complete in the %sStatus%s tab.", 'woocommerce-multilingual'),
|
inc/template-classes/setup/class-wcml-setup-store-pages-ui.php
CHANGED
@@ -42,6 +42,7 @@ class WCML_Setup_Store_Pages_UI extends WPML_Templates_Factory {
|
|
42 |
|
43 |
$model = array(
|
44 |
'strings' => array(
|
|
|
45 |
'heading' => __('Translate Store Pages', 'woocommerce-multilingual'),
|
46 |
'description' => __("All store pages must be translated in the languages configured on the site.", 'woocommerce-multilingual'),
|
47 |
'continue' => __('Continue', 'woocommerce-multilingual'),
|
42 |
|
43 |
$model = array(
|
44 |
'strings' => array(
|
45 |
+
'step_id' => 'store_pages_step',
|
46 |
'heading' => __('Translate Store Pages', 'woocommerce-multilingual'),
|
47 |
'description' => __("All store pages must be translated in the languages configured on the site.", 'woocommerce-multilingual'),
|
48 |
'continue' => __('Continue', 'woocommerce-multilingual'),
|
inc/template-classes/setup/class-wcml-setup-translation-options-ui.php
CHANGED
@@ -22,11 +22,12 @@ class WCML_Setup_Translation_Options_UI extends WPML_Templates_Factory {
|
|
22 |
|
23 |
$model = array(
|
24 |
'strings' => array(
|
|
|
25 |
'heading' => __( 'Translation Options', 'woocommerce-multilingual' ),
|
26 |
'description' => __( "Normally, you first create products in the site's default language and then you translate them. If products are not translated, do you want to show them on other languages?", 'woocommerce-multilingual' ),
|
27 |
'label_display_as_translated' => sprintf( __( 'Yes - show products even if they are not yet translated (%smore on how this will work%s)',
|
28 |
-
|
29 |
-
|
30 |
),
|
31 |
'label_translated' => __( 'No - only display products on other languages once they are translated', 'woocommerce-multilingual' ),
|
32 |
'description_footer' => __( 'Note, to change this later, go to %sWPML » Translation Management » Multilingual Content Setup.%s', 'woocommerce-multilingual' ),
|
22 |
|
23 |
$model = array(
|
24 |
'strings' => array(
|
25 |
+
'step_id' => 'translation_options_step',
|
26 |
'heading' => __( 'Translation Options', 'woocommerce-multilingual' ),
|
27 |
'description' => __( "Normally, you first create products in the site's default language and then you translate them. If products are not translated, do you want to show them on other languages?", 'woocommerce-multilingual' ),
|
28 |
'label_display_as_translated' => sprintf( __( 'Yes - show products even if they are not yet translated (%smore on how this will work%s)',
|
29 |
+
'woocommerce-multilingual' ),
|
30 |
+
'<a target="blank" href="https://wpml.org/documentation/related-projects/woocommerce-multilingual/displaying-untranslated-products-in-secondary-languages/">', '</a>'
|
31 |
),
|
32 |
'label_translated' => __( 'No - only display products on other languages once they are translated', 'woocommerce-multilingual' ),
|
33 |
'description_footer' => __( 'Note, to change this later, go to %sWPML » Translation Management » Multilingual Content Setup.%s', 'woocommerce-multilingual' ),
|
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.9
|
8 |
-
Stable tag: 4.2.
|
9 |
|
10 |
Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
|
11 |
|
@@ -142,6 +142,21 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
|
|
142 |
|
143 |
== Changelog ==
|
144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
= 4.2.6 =
|
146 |
* WooCommerce Tab Manager categories aren't copied to translated tabs
|
147 |
* Endpoint translation issue when submitting a job post on secondary languages [WP Job Manager]
|
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.9.1
|
8 |
+
Stable tag: 4.2.7
|
9 |
|
10 |
Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
|
11 |
|
142 |
|
143 |
== Changelog ==
|
144 |
|
145 |
+
= 4.2.7 =
|
146 |
+
* Notices on front when Reset cart feature is enabled and WooCommerce version >= 2.3
|
147 |
+
* Notice in edit order screen and empty comment added to the order (order note)
|
148 |
+
* Woo Bundles product filtering for variable products does not work in second language
|
149 |
+
* WooCommerce Subscriptions - > sign-up fee in the default currency does not work
|
150 |
+
* Visiting customer-logout endpoint in the second language makes it re-register and sets the string as "Translation needs update"
|
151 |
+
* Default attributes for variable products were not synchronized correctly for translated variable products.
|
152 |
+
* Wrong "product" slug translation on product edit page
|
153 |
+
* WooCommerce EU VAT - VAT set when exempt and doubled in second currency
|
154 |
+
* WooCommerce widget for filtering by attribute when shop page is front/home page
|
155 |
+
* Etheme Blanco compatibility - Inconsistency with minicart
|
156 |
+
* Remove Yahoo service from available services because it was discontinued
|
157 |
+
* Sync problems with Bundle product which contains one product two times in bundle items
|
158 |
+
* Endpoints on my account page removed from the link URL
|
159 |
+
|
160 |
= 4.2.6 =
|
161 |
* WooCommerce Tab Manager categories aren't copied to translated tabs
|
162 |
* Endpoint translation issue when submitting a job post on secondary languages [WP Job Manager]
|
templates/setup/attributes.twig
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
<h1>{{ strings.heading|raw }}</h1>
|
2 |
|
3 |
{% if attributes %}
|
@@ -19,3 +20,4 @@
|
|
19 |
<p class="wcml-setup-actions step">
|
20 |
<a href="{{ continue_url }}" class="button button-large button-primary submit">{{ strings.continue }}</a>
|
21 |
</p>
|
|
1 |
+
<span id="{{ strings.step_id }}">
|
2 |
<h1>{{ strings.heading|raw }}</h1>
|
3 |
|
4 |
{% if attributes %}
|
20 |
<p class="wcml-setup-actions step">
|
21 |
<a href="{{ continue_url }}" class="button button-large button-primary submit">{{ strings.continue }}</a>
|
22 |
</p>
|
23 |
+
</span>
|
templates/setup/introduction.twig
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
|
2 |
-
|
3 |
<h1>{{ strings.heading }}</h1>
|
4 |
|
5 |
<p>{{ strings.description1 }}</p>
|
@@ -12,7 +12,7 @@
|
|
12 |
<p>{{ strings.description3|raw }}</p>
|
13 |
|
14 |
<p class="wcml-setup-actions step">
|
15 |
-
<a href="{{ later_url }}">{{ strings.later }}</a>
|
16 |
<a href="{{ continue_url }}" class="button button-primary button-large">{{ strings.continue }}</a>
|
17 |
</p>
|
18 |
-
|
1 |
|
2 |
+
<span id="{{ strings.step_id }}">
|
3 |
<h1>{{ strings.heading }}</h1>
|
4 |
|
5 |
<p>{{ strings.description1 }}</p>
|
12 |
<p>{{ strings.description3|raw }}</p>
|
13 |
|
14 |
<p class="wcml-setup-actions step">
|
15 |
+
<a href="{{ later_url }}" class="setup_later">{{ strings.later }}</a>
|
16 |
<a href="{{ continue_url }}" class="button button-primary button-large">{{ strings.continue }}</a>
|
17 |
</p>
|
18 |
+
</span>
|
templates/setup/multi-currency.twig
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
<h1>{{ strings.heading }}</h1>
|
2 |
|
3 |
<p>{{ strings.description }}</p>
|
@@ -11,3 +12,4 @@
|
|
11 |
<p class="wcml-setup-actions step">
|
12 |
<a href="{{ continue_url }}" class="button button-large button-primary submit">{{ strings.continue }}</a>
|
13 |
</p>
|
|
1 |
+
<span id="{{ strings.step_id }}">
|
2 |
<h1>{{ strings.heading }}</h1>
|
3 |
|
4 |
<p>{{ strings.description }}</p>
|
12 |
<p class="wcml-setup-actions step">
|
13 |
<a href="{{ continue_url }}" class="button button-large button-primary submit">{{ strings.continue }}</a>
|
14 |
</p>
|
15 |
+
</span>
|
templates/setup/ready.twig
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
<h1>{{ strings.heading }}</h1>
|
2 |
|
3 |
<p>{{ strings.description1|format('<strong>','</strong>')|raw }}</p>
|
@@ -8,5 +9,5 @@
|
|
8 |
<p class="wcml-setup-actions step">
|
9 |
<a href="{{ continue_url }}" class="button button-primary button-large">{{ strings.continue }}</a>
|
10 |
</p>
|
11 |
-
|
12 |
|
1 |
+
<span id="{{ strings.step_id }}">
|
2 |
<h1>{{ strings.heading }}</h1>
|
3 |
|
4 |
<p>{{ strings.description1|format('<strong>','</strong>')|raw }}</p>
|
9 |
<p class="wcml-setup-actions step">
|
10 |
<a href="{{ continue_url }}" class="button button-primary button-large">{{ strings.continue }}</a>
|
11 |
</p>
|
12 |
+
</span>
|
13 |
|
templates/setup/store-pages.twig
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
<h1>{{ strings.heading }}</h1>
|
2 |
|
3 |
<p>{{ strings.description }}</p>
|
@@ -7,3 +8,4 @@
|
|
7 |
<p class="wcml-setup-actions step">
|
8 |
<a href="{{ continue_url }}" class="button button-primary button-large submit">{{ strings.continue }}</a>
|
9 |
</p>
|
|
1 |
+
<span id="{{ strings.step_id }}">
|
2 |
<h1>{{ strings.heading }}</h1>
|
3 |
|
4 |
<p>{{ strings.description }}</p>
|
8 |
<p class="wcml-setup-actions step">
|
9 |
<a href="{{ continue_url }}" class="button button-primary button-large submit">{{ strings.continue }}</a>
|
10 |
</p>
|
11 |
+
</span>
|
templates/setup/translation-options.twig
CHANGED
@@ -1,16 +1,17 @@
|
|
|
|
1 |
<h1>{{ strings.heading }}</h1>
|
2 |
|
3 |
<p>{{ strings.description }}</p>
|
4 |
|
5 |
<ul class="no-bullets">
|
6 |
<li>
|
7 |
-
<label>
|
8 |
<input type="radio" value="1" name="translation-option" {% if is_display_as_translated_checked %}checked="checked"{% endif %} />
|
9 |
{{ strings.label_display_as_translated|raw }}
|
10 |
</label>
|
11 |
</li>
|
12 |
<li>
|
13 |
-
<label>
|
14 |
<input type="radio" value="2" name="translation-option" />
|
15 |
{{ strings.label_translated }}
|
16 |
</label>
|
@@ -22,3 +23,4 @@
|
|
22 |
<p class="wcml-setup-actions step">
|
23 |
<a href="{{ continue_url }}" class="button button-large button-primary submit">{{ strings.continue }}</a>
|
24 |
</p>
|
|
1 |
+
<span id="{{ strings.step_id }}">
|
2 |
<h1>{{ strings.heading }}</h1>
|
3 |
|
4 |
<p>{{ strings.description }}</p>
|
5 |
|
6 |
<ul class="no-bullets">
|
7 |
<li>
|
8 |
+
<label class="display-as-translated-yes">
|
9 |
<input type="radio" value="1" name="translation-option" {% if is_display_as_translated_checked %}checked="checked"{% endif %} />
|
10 |
{{ strings.label_display_as_translated|raw }}
|
11 |
</label>
|
12 |
</li>
|
13 |
<li>
|
14 |
+
<label class="display-as-translated-no">
|
15 |
<input type="radio" value="2" name="translation-option" />
|
16 |
{{ strings.label_translated }}
|
17 |
</label>
|
23 |
<p class="wcml-setup-actions step">
|
24 |
<a href="{{ continue_url }}" class="button button-large button-primary submit">{{ strings.continue }}</a>
|
25 |
</p>
|
26 |
+
</span>
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderIniteac697898e7b8de14a985d0f073b2ba1::getLoader();
|
vendor/autoload_52.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInitb70efbf85024fd6832eb8f90b8b53b87::getLoader();
|
vendor/composer/autoload_classmap.php
CHANGED
@@ -331,12 +331,12 @@ return array(
|
|
331 |
'WCML_Editor_UI_WYSIWYG_Field' => $baseDir . '/inc/translation-editor/class-wcml-editor-ui-wysiwyg-field.php',
|
332 |
'WCML_Emails' => $baseDir . '/inc/class-wcml-emails.php',
|
333 |
'WCML_Endpoints' => $baseDir . '/inc/class-wcml-endpoints.php',
|
|
|
334 |
'WCML_Exchange_Rate_Service' => $baseDir . '/inc/abstracts/class-wcml-exchange-rate-service.php',
|
335 |
'WCML_Exchange_Rates' => $baseDir . '/inc/currencies/class-wcml-exchange-rates.php',
|
336 |
'WCML_Exchange_Rates_Currencylayer' => $baseDir . '/inc/currencies/exchange-rate-services/class-wcml-exchange-rates-currencylayer.php',
|
337 |
'WCML_Exchange_Rates_Fixierio' => $baseDir . '/inc/currencies/exchange-rate-services/class-wcml-exchange-rates-fixierio.php',
|
338 |
'WCML_Exchange_Rates_UI' => $baseDir . '/inc/template-classes/multi-currency/class-wcml-exchange-rates-ui.php',
|
339 |
-
'WCML_Exchange_Rates_YahooFinance' => $baseDir . '/inc/currencies/exchange-rate-services/class-wcml-exchange-rates-yahoo-finance.php',
|
340 |
'WCML_Extra_Product_Options' => $baseDir . '/compatibility/class-wcml-extra-product-options.php',
|
341 |
'WCML_File' => $baseDir . '/inc/currencies/currency-switcher/class-wcml-file.php',
|
342 |
'WCML_Fix_Copied_Custom_Fields_WPML353' => $baseDir . '/inc/class-wcml-fix-copied-custom-fields-wpml353.php',
|
331 |
'WCML_Editor_UI_WYSIWYG_Field' => $baseDir . '/inc/translation-editor/class-wcml-editor-ui-wysiwyg-field.php',
|
332 |
'WCML_Emails' => $baseDir . '/inc/class-wcml-emails.php',
|
333 |
'WCML_Endpoints' => $baseDir . '/inc/class-wcml-endpoints.php',
|
334 |
+
'WCML_Etheme_Blanco' => $baseDir . '/compatibility/class-wcml-etheme-blanco.php',
|
335 |
'WCML_Exchange_Rate_Service' => $baseDir . '/inc/abstracts/class-wcml-exchange-rate-service.php',
|
336 |
'WCML_Exchange_Rates' => $baseDir . '/inc/currencies/class-wcml-exchange-rates.php',
|
337 |
'WCML_Exchange_Rates_Currencylayer' => $baseDir . '/inc/currencies/exchange-rate-services/class-wcml-exchange-rates-currencylayer.php',
|
338 |
'WCML_Exchange_Rates_Fixierio' => $baseDir . '/inc/currencies/exchange-rate-services/class-wcml-exchange-rates-fixierio.php',
|
339 |
'WCML_Exchange_Rates_UI' => $baseDir . '/inc/template-classes/multi-currency/class-wcml-exchange-rates-ui.php',
|
|
|
340 |
'WCML_Extra_Product_Options' => $baseDir . '/compatibility/class-wcml-extra-product-options.php',
|
341 |
'WCML_File' => $baseDir . '/inc/currencies/currency-switcher/class-wcml-file.php',
|
342 |
'WCML_Fix_Copied_Custom_Fields_WPML353' => $baseDir . '/inc/class-wcml-fix-copied-custom-fields-wpml353.php',
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -19,15 +19,15 @@ class ComposerAutoloaderInitb886f0e360e6838e613d0296417ff87d
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
-
call_user_func(\Composer\Autoload\
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderIniteac697898e7b8de14a985d0f073b2ba1
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderIniteac697898e7b8de14a985d0f073b2ba1', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderIniteac697898e7b8de14a985d0f073b2ba1', 'loadClassLoader'));
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
+
call_user_func(\Composer\Autoload\ComposerStaticIniteac697898e7b8de14a985d0f073b2ba1::getInitializer($loader));
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
vendor/composer/autoload_real_52.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real_52.php generated by xrstf/composer-php52
|
4 |
|
5 |
-
class
|
6 |
private static $loader;
|
7 |
|
8 |
public static function loadClassLoader($class) {
|
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitfa2d9b0a98885165f0c584c602b01930 {
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new xrstf_Composer52_ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$vendorDir = dirname(dirname(__FILE__));
|
27 |
$baseDir = dirname($vendorDir);
|
2 |
|
3 |
// autoload_real_52.php generated by xrstf/composer-php52
|
4 |
|
5 |
+
class ComposerAutoloaderInitb70efbf85024fd6832eb8f90b8b53b87 {
|
6 |
private static $loader;
|
7 |
|
8 |
public static function loadClassLoader($class) {
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInitb70efbf85024fd6832eb8f90b8b53b87', 'loadClassLoader'), true /*, true */);
|
23 |
self::$loader = $loader = new xrstf_Composer52_ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInitb70efbf85024fd6832eb8f90b8b53b87', 'loadClassLoader'));
|
25 |
|
26 |
$vendorDir = dirname(dirname(__FILE__));
|
27 |
$baseDir = dirname($vendorDir);
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'C' =>
|
@@ -363,12 +363,12 @@ class ComposerStaticInitb886f0e360e6838e613d0296417ff87d
|
|
363 |
'WCML_Editor_UI_WYSIWYG_Field' => __DIR__ . '/../..' . '/inc/translation-editor/class-wcml-editor-ui-wysiwyg-field.php',
|
364 |
'WCML_Emails' => __DIR__ . '/../..' . '/inc/class-wcml-emails.php',
|
365 |
'WCML_Endpoints' => __DIR__ . '/../..' . '/inc/class-wcml-endpoints.php',
|
|
|
366 |
'WCML_Exchange_Rate_Service' => __DIR__ . '/../..' . '/inc/abstracts/class-wcml-exchange-rate-service.php',
|
367 |
'WCML_Exchange_Rates' => __DIR__ . '/../..' . '/inc/currencies/class-wcml-exchange-rates.php',
|
368 |
'WCML_Exchange_Rates_Currencylayer' => __DIR__ . '/../..' . '/inc/currencies/exchange-rate-services/class-wcml-exchange-rates-currencylayer.php',
|
369 |
'WCML_Exchange_Rates_Fixierio' => __DIR__ . '/../..' . '/inc/currencies/exchange-rate-services/class-wcml-exchange-rates-fixierio.php',
|
370 |
'WCML_Exchange_Rates_UI' => __DIR__ . '/../..' . '/inc/template-classes/multi-currency/class-wcml-exchange-rates-ui.php',
|
371 |
-
'WCML_Exchange_Rates_YahooFinance' => __DIR__ . '/../..' . '/inc/currencies/exchange-rate-services/class-wcml-exchange-rates-yahoo-finance.php',
|
372 |
'WCML_Extra_Product_Options' => __DIR__ . '/../..' . '/compatibility/class-wcml-extra-product-options.php',
|
373 |
'WCML_File' => __DIR__ . '/../..' . '/inc/currencies/currency-switcher/class-wcml-file.php',
|
374 |
'WCML_Fix_Copied_Custom_Fields_WPML353' => __DIR__ . '/../..' . '/inc/class-wcml-fix-copied-custom-fields-wpml353.php',
|
@@ -482,10 +482,10 @@ class ComposerStaticInitb886f0e360e6838e613d0296417ff87d
|
|
482 |
public static function getInitializer(ClassLoader $loader)
|
483 |
{
|
484 |
return \Closure::bind(function () use ($loader) {
|
485 |
-
$loader->prefixLengthsPsr4 =
|
486 |
-
$loader->prefixDirsPsr4 =
|
487 |
-
$loader->prefixesPsr0 =
|
488 |
-
$loader->classMap =
|
489 |
|
490 |
}, null, ClassLoader::class);
|
491 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticIniteac697898e7b8de14a985d0f073b2ba1
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'C' =>
|
363 |
'WCML_Editor_UI_WYSIWYG_Field' => __DIR__ . '/../..' . '/inc/translation-editor/class-wcml-editor-ui-wysiwyg-field.php',
|
364 |
'WCML_Emails' => __DIR__ . '/../..' . '/inc/class-wcml-emails.php',
|
365 |
'WCML_Endpoints' => __DIR__ . '/../..' . '/inc/class-wcml-endpoints.php',
|
366 |
+
'WCML_Etheme_Blanco' => __DIR__ . '/../..' . '/compatibility/class-wcml-etheme-blanco.php',
|
367 |
'WCML_Exchange_Rate_Service' => __DIR__ . '/../..' . '/inc/abstracts/class-wcml-exchange-rate-service.php',
|
368 |
'WCML_Exchange_Rates' => __DIR__ . '/../..' . '/inc/currencies/class-wcml-exchange-rates.php',
|
369 |
'WCML_Exchange_Rates_Currencylayer' => __DIR__ . '/../..' . '/inc/currencies/exchange-rate-services/class-wcml-exchange-rates-currencylayer.php',
|
370 |
'WCML_Exchange_Rates_Fixierio' => __DIR__ . '/../..' . '/inc/currencies/exchange-rate-services/class-wcml-exchange-rates-fixierio.php',
|
371 |
'WCML_Exchange_Rates_UI' => __DIR__ . '/../..' . '/inc/template-classes/multi-currency/class-wcml-exchange-rates-ui.php',
|
|
|
372 |
'WCML_Extra_Product_Options' => __DIR__ . '/../..' . '/compatibility/class-wcml-extra-product-options.php',
|
373 |
'WCML_File' => __DIR__ . '/../..' . '/inc/currencies/currency-switcher/class-wcml-file.php',
|
374 |
'WCML_Fix_Copied_Custom_Fields_WPML353' => __DIR__ . '/../..' . '/inc/class-wcml-fix-copied-custom-fields-wpml353.php',
|
482 |
public static function getInitializer(ClassLoader $loader)
|
483 |
{
|
484 |
return \Closure::bind(function () use ($loader) {
|
485 |
+
$loader->prefixLengthsPsr4 = ComposerStaticIniteac697898e7b8de14a985d0f073b2ba1::$prefixLengthsPsr4;
|
486 |
+
$loader->prefixDirsPsr4 = ComposerStaticIniteac697898e7b8de14a985d0f073b2ba1::$prefixDirsPsr4;
|
487 |
+
$loader->prefixesPsr0 = ComposerStaticIniteac697898e7b8de14a985d0f073b2ba1::$prefixesPsr0;
|
488 |
+
$loader->classMap = ComposerStaticIniteac697898e7b8de14a985d0f073b2ba1::$classMap;
|
489 |
|
490 |
}, null, ClassLoader::class);
|
491 |
}
|
wpml-woocommerce.php
CHANGED
@@ -8,16 +8,16 @@
|
|
8 |
Text Domain: woocommerce-multilingual
|
9 |
Requires at least: 3.9
|
10 |
Tested up to: 4.9
|
11 |
-
Version: 4.2.
|
12 |
WC requires at least: 2.1.0
|
13 |
-
WC tested up to: 3.2.
|
14 |
*/
|
15 |
|
16 |
if ( defined( 'WCML_VERSION' ) ) {
|
17 |
return;
|
18 |
}
|
19 |
|
20 |
-
define( 'WCML_VERSION', '4.2.
|
21 |
define( 'WCML_PLUGIN_PATH', dirname( __FILE__ ) );
|
22 |
define( 'WCML_PLUGIN_FOLDER', basename( WCML_PLUGIN_PATH ) );
|
23 |
define( 'WCML_LOCALE_PATH', WCML_PLUGIN_PATH . '/locale' );
|
8 |
Text Domain: woocommerce-multilingual
|
9 |
Requires at least: 3.9
|
10 |
Tested up to: 4.9
|
11 |
+
Version: 4.2.7
|
12 |
WC requires at least: 2.1.0
|
13 |
+
WC tested up to: 3.2.5
|
14 |
*/
|
15 |
|
16 |
if ( defined( 'WCML_VERSION' ) ) {
|
17 |
return;
|
18 |
}
|
19 |
|
20 |
+
define( 'WCML_VERSION', '4.2.7' );
|
21 |
define( 'WCML_PLUGIN_PATH', dirname( __FILE__ ) );
|
22 |
define( 'WCML_PLUGIN_FOLDER', basename( WCML_PLUGIN_PATH ) );
|
23 |
define( 'WCML_LOCALE_PATH', WCML_PLUGIN_PATH . '/locale' );
|