WooCommerce Multilingual – run WooCommerce with WPML - Version 4.1.0

Version Description

  • Enhanced language switchers
  • Improved REST API support
  • Updated WooCommerce 2.7 compatibiilty
  • Added the ability to translate product terms in the products translation editor
  • Enhanced the translation of rich text custom fields in the products translation editor.
  • Compatibility with WooCommerce Product Bundles (updated, not for WooCommerce 2.7)
  • Compatibility with ACF Pro (fixes)
  • Compatibility with WooCommerce Bookings (fixes)
  • Compatibility with WP Simple Survey (fixes)
  • Fix: Translations for custom attributes containing the umlaut character were not showing on the frontend.
  • Fix: Some gallery images were not synchronized when using the corresponding option on the troubleshooting page.
  • Fix: Incorrect country name translations were used in the order confirmation email is some situations.
  • Fix: Some endpoints were not accessible when using the Different languages in directories configuration.
  • Fix: Order screen displayed Variation # of Product name instead of just the product name.
  • Fix: The custom prices were not displayed correctly on the front end when using , as a decimal separator.
  • Fix: In specific circumstances, the product category URLs were returning a 404 error.
  • Fix: New lines were not copied correctly when using the products translation editor.
  • Fix: In some circumstances, accessing product categories without a trailing slash generated PHP notices.
  • Fix: The stock status was not synchronized correctly for variable products.
  • Fix: By removing an attribute, only the terms in the default language were removed from the database.
  • Fix: When using the option to display only products with custom prices in the secondary currencies and the price was 0, the products variations were not visible on the front end.
  • Fix: The option to set separate download files for each translation was not working correctly for variable products
Download this release

Release Info

Developer mihaimihai
Plugin Icon 128x128 WooCommerce Multilingual – run WooCommerce with WPML
Version 4.1.0
Comparing to
See all releases

Code changes from version 4.0.4 to 4.1.0

Files changed (137) hide show
  1. compatibility/class-wcml-bookings.php +68 -7
  2. compatibility/class-wcml-dynamic-pricing.php +1 -1
  3. compatibility/class-wcml-product-bundles-legacy.php +412 -0
  4. compatibility/class-wcml-product-bundles.php +446 -258
  5. compatibility/class-wcml-sensei.php +2 -1
  6. compatibility/class-wcml-tab-manager.php +1 -1
  7. compatibility/class-wcml-table-rate-shipping.php +6 -2
  8. compatibility/class-wcml-the-events-calendar.php +492 -0
  9. compatibility/includes/class-wcml-wc-product-bundles-items.php +74 -0
  10. compatibility/res/css/wcml-bookings.css +4 -0
  11. inc/admin-menus/class-wcml-setup.php +1 -1
  12. inc/class-wcml-attributes.php +73 -1
  13. inc/class-wcml-cart.php +8 -3
  14. inc/class-wcml-compatibility.php +11 -1
  15. inc/class-wcml-emails.php +12 -3
  16. inc/class-wcml-endpoints.php +8 -4
  17. inc/class-wcml-install.php +4 -2
  18. inc/class-wcml-languages-upgrader.php +1 -1
  19. inc/class-wcml-orders.php +0 -1
  20. inc/class-wcml-products.php +2 -2
  21. inc/class-wcml-resources.php +52 -27
  22. inc/class-wcml-terms.php +22 -0
  23. inc/class-wcml-troubleshooting.php +59 -40
  24. inc/class-wcml-upgrade.php +55 -1
  25. inc/class-wcml-url-translation.php +7 -6
  26. inc/class-wcml-wc-strings.php +19 -18
  27. inc/class-wcml-woocommerce-rest-api-support.php +3 -2
  28. inc/class-woocommerce-wpml.php +20 -9
  29. inc/currencies/class-wcml-admin-currency-selector.php +3 -4
  30. inc/currencies/class-wcml-currencies.php +1 -1
  31. inc/currencies/class-wcml-custom-prices.php +11 -17
  32. inc/currencies/class-wcml-multi-currency-configuration.php +1 -9
  33. inc/currencies/class-wcml-multi-currency-orders.php +32 -1
  34. inc/currencies/class-wcml-multi-currency-prices.php +3 -4
  35. inc/currencies/class-wcml-multi-currency-resources.php +8 -18
  36. inc/currencies/class-wcml-multi-currency.php +9 -4
  37. inc/currencies/currency-switcher/class-wcml-currency-switcher-ajax.php +217 -0
  38. inc/currencies/currency-switcher/class-wcml-currency-switcher-templates.php +414 -0
  39. inc/currencies/currency-switcher/class-wcml-currency-switcher-widget.php +47 -0
  40. inc/currencies/currency-switcher/class-wcml-currency-switcher.php +278 -0
  41. inc/rest-api-support/class-wcml-rest-api-suport.php +385 -0
  42. inc/template-classes/class-wcml-custom-files-ui.php +1 -1
  43. inc/template-classes/class-wcml-plugins-wrap.php +9 -10
  44. inc/template-classes/class-wcml-settings-ui.php +1 -1
  45. inc/template-classes/currency-switcher/class-wcml-currency-switcher-options-dialog.php +148 -0
  46. inc/template-classes/currency-switcher/class-wcml-currency-switcher-template.php +220 -0
  47. inc/template-classes/multi-currency/class-wcml-custom-currency-options.php +4 -1
  48. inc/template-classes/multi-currency/class-wcml-custom-prices-ui.php +4 -6
  49. inc/template-classes/multi-currency/class-wcml-multi-currency-ui.php +101 -25
  50. inc/template-classes/setup/class-wcml-setup-introduction-ui.php +1 -1
  51. inc/template-classes/setup/class-wcml-setup-ready-ui.php +1 -1
  52. inc/template-classes/status/class-wcml-status-config-warnings-ui.php +0 -2
  53. inc/template-classes/status/class-wcml-status-store-pages-ui.php +2 -2
  54. inc/template-classes/status/class-wcml-status-taxonomies-ui.php +1 -1
  55. inc/translation-editor/class-wcml-downloadable-products.php +10 -8
  56. inc/translation-editor/class-wcml-editor-ui-product-job.php +103 -6
  57. inc/translation-editor/class-wcml-editor-ui-wysiwyg-field.php +13 -0
  58. inc/translation-editor/class-wcml-synchronize-product-data.php +41 -24
  59. inc/translation-editor/class-wcml-synchronize-variations-data.php +32 -2
  60. inc/translation-editor/class-wcml-translation-editor.php +30 -2
  61. inc/wcml-cart-switch-lang-functions.php +4 -1
  62. inc/wcml-switch-lang-request.php +7 -1
  63. locale/orig/woocommerce-multilingual.po +2490 -1972
  64. locale/woocommerce-multilingual-ar.mo +0 -0
  65. locale/woocommerce-multilingual-de_DE.mo +0 -0
  66. locale/woocommerce-multilingual-el.mo +0 -0
  67. locale/woocommerce-multilingual-es_ES.mo +0 -0
  68. locale/woocommerce-multilingual-fr_FR.mo +0 -0
  69. locale/woocommerce-multilingual-he_IL.mo +0 -0
  70. locale/woocommerce-multilingual-it_IT.mo +0 -0
  71. locale/woocommerce-multilingual-ja.mo +0 -0
  72. locale/woocommerce-multilingual-ko_KR.mo +0 -0
  73. locale/woocommerce-multilingual-nl_NL.mo +0 -0
  74. locale/woocommerce-multilingual-pl_PL.mo +0 -0
  75. locale/woocommerce-multilingual-pt_BR.mo +0 -0
  76. locale/woocommerce-multilingual-pt_PT.mo +0 -0
  77. locale/woocommerce-multilingual-ru_RU.mo +0 -0
  78. locale/woocommerce-multilingual-sv_SE.mo +0 -0
  79. locale/woocommerce-multilingual-uk_UA.mo +0 -0
  80. locale/woocommerce-multilingual-vi.mo +0 -0
  81. locale/woocommerce-multilingual-zh_CN.mo +0 -0
  82. locale/woocommerce-multilingual-zh_TW.mo +0 -0
  83. readme.txt +26 -2
  84. res/css/admin.css +1 -64
  85. res/css/currency-switcher.css +1 -1
  86. res/css/management.css +1 -1
  87. res/js/currency-switcher-settings.js +270 -0
  88. res/js/currency-switcher-settings.min.js +1 -0
  89. res/js/dialogs.js +86 -22
  90. res/js/dialogs.min.js +1 -1
  91. res/js/languages_notice.js +2 -4
  92. res/js/languages_notice.min.js +1 -1
  93. res/js/lock_fields.js +25 -13
  94. res/js/lock_fields.min.js +1 -1
  95. res/js/multi-currency.js +42 -69
  96. res/js/multi-currency.min.js +1 -1
  97. res/js/wcml-multi-currency.js +7 -10
  98. res/js/wcml-multi-currency.min.js +1 -1
  99. res/js/widgets.js +15 -0
  100. res/js/widgets.min.js +1 -0
  101. res/scss/currency-switcher.scss +35 -4
  102. res/scss/management.scss +170 -13
  103. templates/currency-switchers/legacy-dropdown-click/config.json +4 -0
  104. templates/currency-switchers/legacy-dropdown-click/script.js +72 -0
  105. templates/currency-switchers/legacy-dropdown-click/style.css +1 -0
  106. templates/currency-switchers/legacy-dropdown-click/style.scss +91 -0
  107. templates/currency-switchers/legacy-dropdown-click/template.twig +16 -0
  108. templates/currency-switchers/legacy-dropdown/config.json +4 -0
  109. templates/currency-switchers/legacy-dropdown/style.css +1 -0
  110. templates/currency-switchers/legacy-dropdown/style.scss +94 -0
  111. templates/currency-switchers/legacy-dropdown/template.twig +16 -0
  112. templates/currency-switchers/legacy-list-horizontal/config.json +4 -0
  113. templates/currency-switchers/legacy-list-horizontal/style.css +1 -0
  114. templates/currency-switchers/legacy-list-horizontal/style.scss +33 -0
  115. templates/currency-switchers/legacy-list-horizontal/template.twig +9 -0
  116. templates/currency-switchers/legacy-list-vertical/config.json +4 -0
  117. templates/currency-switchers/legacy-list-vertical/style.css +1 -0
  118. templates/currency-switchers/legacy-list-vertical/style.scss +33 -0
  119. templates/currency-switchers/legacy-list-vertical/template.twig +9 -0
  120. templates/multi-currency/currency-switcher-options-dialog.twig +114 -0
  121. templates/multi-currency/currency-switcher-options.twig +148 -72
  122. templates/multi-currency/custom-currency-options.twig +3 -3
  123. templates/multi-currency/custom-prices.twig +2 -2
  124. templates/multi-currency/multi-currency.twig +2 -1
  125. templates/setup/attributes.twig +1 -1
  126. vendor/autoload.php +2 -2
  127. vendor/autoload_52.php +1 -1
  128. vendor/composer/ClassLoader.php +38 -10
  129. vendor/composer/autoload_classmap.php +283 -7
  130. vendor/composer/autoload_real.php +5 -5
  131. vendor/composer/autoload_real_52.php +3 -3
  132. vendor/composer/autoload_static.php +288 -12
  133. vendor/otgs/installer/includes/class-installer-dependencies.php +278 -278
  134. vendor/otgs/installer/includes/class-installer-theme.php +978 -978
  135. vendor/otgs/installer/includes/installer-api.php +115 -115
  136. vendor/otgs/installer/includes/installer-upgrader-skins.php +36 -36
  137. vendor/otgs/installer/includes/installer.class.php +1466 -2680
compatibility/class-wcml-bookings.php CHANGED
@@ -158,8 +158,12 @@ class WCML_Bookings {
158
 
159
  //allow filtering resources by language
160
  add_filter( 'get_booking_resources_args', array( $this, 'filter_get_booking_resources_args' ) );
 
 
161
 
162
  add_action( 'woocommerce_product_data_panels', array( $this, 'show_pointer_info' ) );
 
 
163
  }
164
 
165
  if ( ! is_admin() || isset( $_POST['action'] ) && $_POST['action'] == 'wc_bookings_calculate_costs' ) {
@@ -1497,10 +1501,14 @@ class WCML_Bookings {
1497
  'post_type' => 'wc_booking',
1498
  'post_title' => $booking_object->post_title,
1499
  'post_status' => $booking_object->post_status,
1500
- 'ping_status' => 'closed',
1501
- 'post_parent' => $booking_object->post_parent,
1502
  );
1503
 
 
 
 
 
 
1504
  $active_languages = $this->sitepress->get_active_languages();
1505
 
1506
  foreach ( $active_languages as $language ) {
@@ -1538,7 +1546,7 @@ class WCML_Bookings {
1538
  $this->sitepress->set_element_language_details( $trnsl_booking_id, 'post_wc_booking', $trid, $language['code'] );
1539
 
1540
  $meta_args = array(
1541
- '_booking_order_item_id' => get_post_meta( $booking_id, '_booking_order_item_id', true ),
1542
  '_booking_product_id' => $this->get_translated_booking_product_id( $booking_id, $language['code'] ),
1543
  '_booking_resource_id' => $this->get_translated_booking_resource_id( $booking_id, $language['code'] ),
1544
  '_booking_persons' => $this->get_translated_booking_persons_ids( $booking_id, $language['code'] ),
@@ -1782,13 +1790,13 @@ class WCML_Bookings {
1782
 
1783
  $package['contents'][ 'wc_bookings:person:' . $person_type->ID . ':name' ] = array(
1784
  'translate' => 1,
1785
- 'data' => $this->tp->encode_field_data( $person_type->post_title, 'base64' ),
1786
  'format' => 'base64'
1787
  );
1788
 
1789
  $package['contents'][ 'wc_bookings:person:' . $person_type->ID . ':description' ] = array(
1790
  'translate' => 1,
1791
- 'data' => $this->tp->encode_field_data( $person_type->post_excerpt, 'base64' ),
1792
  'format' => 'base64'
1793
  );
1794
 
@@ -2257,9 +2265,10 @@ class WCML_Bookings {
2257
  $sold_indiv = false;
2258
  foreach( WC()->cart->cart_contents as $cart_item ){
2259
  if(
2260
- isset( $cart_item[ 'booking' ] ) &&
2261
  $cart_item[ 'booking' ][ '_start_date' ] == $cart_item_data[ 'booking' ][ '_start_date' ] &&
2262
- $cart_item[ 'booking' ][ '_end_date' ] == $cart_item_data[ 'booking' ][ '_end_date' ]
 
2263
  ){
2264
  $sold_indiv = true;
2265
  }
@@ -2269,4 +2278,56 @@ class WCML_Bookings {
2269
  return $sold_indiv;
2270
  }
2271
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2272
  }
158
 
159
  //allow filtering resources by language
160
  add_filter( 'get_booking_resources_args', array( $this, 'filter_get_booking_resources_args' ) );
161
+ add_filter( 'get_translatable_documents', array( $this, 'filter_translatable_documents' ) );
162
+ add_filter( 'pre_wpml_is_translated_post_type', array( $this, 'filter_is_translated_post_type' ) );
163
 
164
  add_action( 'woocommerce_product_data_panels', array( $this, 'show_pointer_info' ) );
165
+
166
+ add_action( 'save_post', array( $this, 'sync_booking_status' ), 10, 3 );
167
  }
168
 
169
  if ( ! is_admin() || isset( $_POST['action'] ) && $_POST['action'] == 'wc_bookings_calculate_costs' ) {
1501
  'post_type' => 'wc_booking',
1502
  'post_title' => $booking_object->post_title,
1503
  'post_status' => $booking_object->post_status,
1504
+ 'ping_status' => 'closed'
 
1505
  );
1506
 
1507
+ if( $booking_object->post_parent && $lang ){
1508
+ $translated_parent = apply_filters( 'translate_object_id', $booking_object->post_parent, get_post_type( $booking_object->post_parent ), false, $lang );
1509
+ if( $translated_parent ) $booking_data[ 'post_parent' ] = $translated_parent;
1510
+ }
1511
+
1512
  $active_languages = $this->sitepress->get_active_languages();
1513
 
1514
  foreach ( $active_languages as $language ) {
1546
  $this->sitepress->set_element_language_details( $trnsl_booking_id, 'post_wc_booking', $trid, $language['code'] );
1547
 
1548
  $meta_args = array(
1549
+ '_booking_order_item_id' => 0,
1550
  '_booking_product_id' => $this->get_translated_booking_product_id( $booking_id, $language['code'] ),
1551
  '_booking_resource_id' => $this->get_translated_booking_resource_id( $booking_id, $language['code'] ),
1552
  '_booking_persons' => $this->get_translated_booking_persons_ids( $booking_id, $language['code'] ),
1790
 
1791
  $package['contents'][ 'wc_bookings:person:' . $person_type->ID . ':name' ] = array(
1792
  'translate' => 1,
1793
+ 'data' => $this->tp->encode_field_data( $person_type->get_name(), 'base64' ),
1794
  'format' => 'base64'
1795
  );
1796
 
1797
  $package['contents'][ 'wc_bookings:person:' . $person_type->ID . ':description' ] = array(
1798
  'translate' => 1,
1799
+ 'data' => $this->tp->encode_field_data( $person_type->get_description(), 'base64' ),
1800
  'format' => 'base64'
1801
  );
1802
 
2265
  $sold_indiv = false;
2266
  foreach( WC()->cart->cart_contents as $cart_item ){
2267
  if(
2268
+ isset( $cart_item[ 'booking' ] ) && isset( $cart_item[ 'booking' ][ '_booking_id' ] ) &&
2269
  $cart_item[ 'booking' ][ '_start_date' ] == $cart_item_data[ 'booking' ][ '_start_date' ] &&
2270
+ $cart_item[ 'booking' ][ '_end_date' ] == $cart_item_data[ 'booking' ][ '_end_date' ] &&
2271
+ $cart_item[ 'booking' ][ '_booking_id' ] == $cart_item_data[ 'booking' ][ '_booking_id' ]
2272
  ){
2273
  $sold_indiv = true;
2274
  }
2278
  return $sold_indiv;
2279
  }
2280
 
2281
+ // unset "bookings" from translatable documents to hide WPML languages section from booking edit page
2282
+ public function filter_translatable_documents( $icl_post_types ){
2283
+
2284
+ if(
2285
+ ( isset( $_GET[ 'post' ] ) && get_post_type( $_GET[ 'post' ] ) == 'wc_booking' ) ||
2286
+ ( isset( $_GET[ 'post_type' ] ) && $_GET[ 'post_type' ] == 'wc_booking' )
2287
+ ){
2288
+ unset( $icl_post_types[ 'wc_booking' ] );
2289
+ }
2290
+
2291
+ return $icl_post_types;
2292
+ }
2293
+
2294
+ // hide WPML languages links section from bookings list page
2295
+ public function filter_is_translated_post_type( $type ){
2296
+
2297
+ if( isset( $_GET[ 'post_type' ] ) && $_GET[ 'post_type' ] == 'wc_booking' ){
2298
+ return false;
2299
+ }
2300
+
2301
+ return $type;
2302
+ }
2303
+
2304
+ /**
2305
+ * @param int $post_id
2306
+ * @param WP_Post $post
2307
+ * @param bool $update
2308
+ *
2309
+ */
2310
+ public function sync_booking_status( $post_id, $post, $update ){
2311
+
2312
+ if( $post->post_type === 'wc_booking' && $update ){
2313
+
2314
+ $trid = $this->sitepress->get_element_trid( $post_id, 'post_wc_booking' );
2315
+ $translations = $this->sitepress->get_element_translations( $trid, 'post_wc_booking' );
2316
+
2317
+ foreach( $translations as $translation ){
2318
+ if( $translation->element_id != $post_id ){
2319
+ $this->wpdb->update(
2320
+ $this->wpdb->posts,
2321
+ array( 'post_status' => $post->post_status ),
2322
+ array( 'ID' => $translation->element_id )
2323
+ );
2324
+ }
2325
+ }
2326
+
2327
+ }
2328
+
2329
+ }
2330
+
2331
+
2332
+
2333
  }
compatibility/class-wcml-dynamic-pricing.php CHANGED
@@ -66,7 +66,7 @@ class WCML_Dynamic_Pricing {
66
  function woocommerce_dynamic_pricing_is_applied_to( $process_discounts, $_product, $module_id, $obj, $cat_id ) {
67
  if ( $cat_id && isset( $obj->available_rulesets ) && count( $obj->available_rulesets ) > 0 ) {
68
  $cat_id = apply_filters( 'translate_object_id', $cat_id, 'product_cat', true, $this->sitepress->get_current_language() );
69
- $process_discounts = is_object_in_term( $_product->id, 'product_cat', $cat_id );
70
  }
71
 
72
  return $process_discounts;
66
  function woocommerce_dynamic_pricing_is_applied_to( $process_discounts, $_product, $module_id, $obj, $cat_id ) {
67
  if ( $cat_id && isset( $obj->available_rulesets ) && count( $obj->available_rulesets ) > 0 ) {
68
  $cat_id = apply_filters( 'translate_object_id', $cat_id, 'product_cat', true, $this->sitepress->get_current_language() );
69
+ $process_discounts = is_object_in_term( WooCommerce_Functions_Wrapper::get_product_id( $_product ), 'product_cat', $cat_id );
70
  }
71
 
72
  return $process_discounts;
compatibility/class-wcml-product-bundles-legacy.php ADDED
@@ -0,0 +1,412 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class WCML_Product_Bundles_Legacy{
3
+
4
+ /**
5
+ * @var WPML_Element_Translation_Package
6
+ */
7
+ var $tp;
8
+
9
+ /**
10
+ * @var SitePress
11
+ */
12
+ private $sitepress;
13
+
14
+ /**
15
+ * @var woocommerce_wpml
16
+ */
17
+ private $woocommerce_wpml;
18
+
19
+ /**
20
+ * WCML_Product_Bundles constructor.
21
+ */
22
+ function __construct( &$sitepress, &$woocommerce_wpml ){
23
+ $this->sitepress = $sitepress;
24
+ $this->woocommerce_wpml = $woocommerce_wpml;
25
+
26
+ add_action( 'wcml_gui_additional_box_html', array( $this, 'custom_box_html' ), 10, 3 );
27
+ add_filter( 'wcml_gui_additional_box_data', array( $this, 'custom_box_html_data' ), 10, 4 );
28
+ add_action( 'wcml_after_duplicate_product_post_meta', array( $this, 'sync_bundled_ids' ), 10, 2 );
29
+ add_action( 'wcml_update_extra_fields', array( $this, 'bundle_update' ), 10, 4 );
30
+ add_action( 'woocommerce_get_cart_item_from_session', array( $this, 'resync_bundle' ), 5, 3 );
31
+ add_filter( 'woocommerce_cart_loaded_from_session', array( $this, 'resync_bundle_clean' ), 10 );
32
+
33
+ if( version_compare( WCML_VERSION, '3.7.2', '>' ) ){
34
+ add_filter( 'option_wpml_config_files_arr', array( $this, 'make__bundle_data_not_translatable_by_default' ), 0 );
35
+ }
36
+
37
+ if( is_admin() ){
38
+ $this->tp = new WPML_Element_Translation_Package();
39
+
40
+ add_filter( 'wpml_tm_translation_job_data', array( $this, 'append_bundle_data_translation_package' ), 10, 2 );
41
+ add_action( 'wpml_translation_job_saved', array( $this, 'save_bundle_data_translation' ), 10, 3 );
42
+
43
+ }
44
+
45
+
46
+ }
47
+
48
+ function make__bundle_data_not_translatable_by_default( $wpml_config_array ){
49
+
50
+ if( isset( $wpml_config_array->plugins[ 'WooCommerce Product Bundles' ] ) ){
51
+ $wpml_config_array->plugins[ 'WooCommerce Product Bundles' ] =
52
+ str_replace(
53
+ '<custom-field action="translate">_bundle_data</custom-field>',
54
+ '<custom-field action="nothing">_bundle_data</custom-field>',
55
+ $wpml_config_array->plugins[ 'WooCommerce Product Bundles' ] );
56
+ }
57
+
58
+ return $wpml_config_array;
59
+ }
60
+
61
+ // Sync Bundled product '_bundle_data' with translated values when the product is duplicated
62
+ function sync_bundled_ids( $original_product_id, $trnsl_product_id ){
63
+
64
+ $bundle_data_array = maybe_unserialize( get_post_meta( $original_product_id, '_bundle_data', true ) );
65
+ if( $bundle_data_array ){
66
+ $lang = $this->sitepress->get_language_for_element( $trnsl_product_id, 'post_product' );
67
+ $tr_bundle_meta = maybe_unserialize( get_post_meta( $trnsl_product_id, '_bundle_data', true ) );
68
+
69
+ $i = 2;
70
+ foreach( $bundle_data_array as $bundle_key => $bundle_data ){
71
+
72
+ $key_data = $this->translate_bundle_key( $bundle_key, $lang );
73
+ $tr_id = $key_data->tr_id;
74
+ $tr_bundle_key = $key_data->tr_key;
75
+
76
+ $tr_bundle[ $tr_bundle_key ] = $bundle_data;
77
+ $tr_bundle[ $tr_bundle_key ][ 'product_id' ] = $tr_id;
78
+ if( isset( $bundle_data[ 'product_title' ] ) ){
79
+ if( $bundle_data[ 'override_title' ] == 'yes' ){
80
+ $tr_bundle[ $tr_bundle_key ][ 'product_title' ] =
81
+ isset( $tr_bundle_meta[ $tr_bundle_key ][ 'product_title' ] ) ?
82
+ $tr_bundle_meta[ $tr_bundle_key ][ 'product_title' ] :
83
+ '';
84
+ }else{
85
+ $tr_title= get_the_title( $tr_id );
86
+ $tr_bundle[ $tr_bundle_key ][ 'product_title' ] = $tr_title;
87
+ }
88
+ }
89
+ if( isset( $bundle_data[ 'product_description' ] ) ){
90
+ if( $bundle_data[ 'override_description' ] == 'yes' ){
91
+ $tr_bundle[ $tr_bundle_key ][ 'product_description' ] =
92
+ isset( $tr_bundle_meta[ $tr_bundle_key ][ 'product_description' ] ) ?
93
+ $tr_bundle_meta[ $tr_bundle_key ][ 'product_description' ] :
94
+ '';
95
+ }else{
96
+ $tr_prod = get_post( $tr_id );
97
+ $tr_desc = $tr_prod->post_excerpt;
98
+ $tr_bundle[ $tr_bundle_key ][ 'product_description' ] = $tr_desc;
99
+ }
100
+ }
101
+ if( isset( $bundle_data[ 'filter_variations' ] ) && $bundle_data[ 'filter_variations' ] == 'yes' ){
102
+ $allowed_var = $bundle_data[ 'allowed_variations' ];
103
+ foreach( $allowed_var as $key => $var_id ){
104
+ $tr_var_id = apply_filters( 'translate_object_id', $var_id, get_post_type( $var_id ), true, $lang );
105
+ $tr_bundle[ $tr_bundle_key ][ 'allowed_variations' ][ $key ] = $tr_var_id;
106
+ }
107
+ }
108
+ if( isset( $bundle_data[ 'bundle_defaults' ] ) && !empty( $bundle_data[ 'bundle_defaults' ] ) ){
109
+ foreach( $bundle_data[ 'bundle_defaults' ] as $tax => $term_slug ){
110
+
111
+ $term_id = $this->woocommerce_wpml->terms->wcml_get_term_id_by_slug( $tax, $term_slug );
112
+ if( $term_id ){
113
+ // Global Attribute
114
+ $tr_def_id = apply_filters( 'translate_object_id', $term_id, $tax, true, $lang );
115
+ $tr_term = $this->woocommerce_wpml->terms->wcml_get_term_by_id( $tr_def_id, $tax );
116
+ $tr_bundle[ $tr_bundle_key ][ 'bundle_defaults' ][ $tax ] = $tr_term->slug;
117
+ }else{
118
+ // Custom Attribute
119
+ $args = array(
120
+ 'post_type' => 'product_variation',
121
+ 'meta_key' => 'attribute_'.$tax,
122
+ 'meta_value' => $term_slug,
123
+ 'meta_compare' => '='
124
+ );
125
+ $variationloop = new WP_Query( $args );
126
+ while ( $variationloop->have_posts() ) : $variationloop->the_post();
127
+ $tr_var_id = apply_filters( 'translate_object_id', get_the_ID(), 'product_variation', true, $lang );
128
+ $tr_meta = get_post_meta( $tr_var_id, 'attribute_'.$tax , true );
129
+ $tr_bundle[ $tr_bundle_key ][ 'bundle_defaults' ][ $tax ] = $tr_meta;
130
+ endwhile;
131
+ }
132
+ }
133
+ }
134
+ }
135
+ update_post_meta( $trnsl_product_id, '_bundle_data', $tr_bundle );
136
+
137
+ return $tr_bundle;
138
+ }
139
+
140
+ }
141
+
142
+
143
+ public function translate_bundle_key( $key, $lang, $return_original_if_missing = true ) {
144
+ $key_parts = explode( '_', $key );
145
+ $has_multiple_products = count( $key_parts ) > 1;
146
+
147
+ $data = new stdClass;
148
+ $data->id = $has_multiple_products ? $key_parts[ 0 ] : $key;
149
+ $data->tr_id = apply_filters( 'translate_object_id', $data->id, get_post_type( $data->id ), $return_original_if_missing, $lang );
150
+ $data->tr_key = $data->tr_id . ( $has_multiple_products ? '_' . $key_parts[ 1 ] : '' );
151
+
152
+ return $data;
153
+ }
154
+
155
+ // Update Bundled products title and descritpion after saving the translation
156
+ function bundle_update( $original_product_id, $tr_id, $data, $lang ){
157
+
158
+ $tr_bundle_data = array();
159
+ $tr_bundle_data = maybe_unserialize( get_post_meta($tr_id,'_bundle_data', true ) );
160
+
161
+ $bundle_data = maybe_unserialize( get_post_meta( $original_product_id, '_bundle_data', true ) );
162
+
163
+ if( empty( $bundle_data ) ){
164
+ return;
165
+ }
166
+
167
+ $product_bundles = array_keys( $bundle_data );
168
+
169
+ foreach ( $product_bundles as $key => $bundle_key ) {
170
+
171
+ $key_data = $this->translate_bundle_key( $bundle_key, $lang );
172
+ $tr_bundle_key = $key_data->tr_key;
173
+
174
+ if( isset( $tr_bundle_data[ $tr_bundle_key ] ) ){
175
+ $tr_bundle_data[ $tr_bundle_key ][ 'product_title' ] = $data[ md5( 'bundle_'.$bundle_key.'_title' ) ];
176
+ $tr_bundle_data[ $tr_bundle_key ][ 'product_description' ] = $data[ md5( 'bundle_'.$bundle_key.'_desc' ) ];
177
+ }
178
+ }
179
+ update_post_meta( $tr_id, '_bundle_data', $tr_bundle_data );
180
+
181
+ return $tr_bundle_data;
182
+ }
183
+
184
+ // Add Bundles Box to WCML Translation GUI
185
+ function custom_box_html( $obj, $product_id, $data ){
186
+
187
+ $product_bundles = maybe_unserialize( get_post_meta( $product_id, '_bundle_data', true ) );
188
+
189
+ if( empty( $product_bundles ) || $product_bundles == false ){
190
+ return false;
191
+ }
192
+
193
+ $bundles_section = new WPML_Editor_UI_Field_Section( __( 'Product Bundles', 'woocommerce-multilingual' ) );
194
+ end( $product_bundles );
195
+ $last_key = key( $product_bundles );
196
+ $divider = true;
197
+ $flag = false;
198
+
199
+ foreach ( $product_bundles as $bundle_id => $product_bundle ) {
200
+ $add_group = false;
201
+ if( $bundle_id == $last_key ){
202
+ $divider = false;
203
+ }
204
+
205
+ $group = new WPML_Editor_UI_Field_Group( get_the_title( $bundle_id ), $divider );
206
+
207
+ if( $product_bundle[ 'override_title' ] == 'yes' ) {
208
+ $bundle_field = new WPML_Editor_UI_Single_Line_Field(
209
+ 'bundle_' . $bundle_id . '_title',
210
+ __( 'Name', 'woocommerce-multilingual' ),
211
+ $data,
212
+ false
213
+ );
214
+ $group->add_field( $bundle_field );
215
+ $add_group = true;
216
+ }
217
+
218
+ if( $product_bundle[ 'override_description' ] == 'yes' ){
219
+ $bundle_field = new WPML_Editor_UI_Single_Line_Field(
220
+ 'bundle_'.$bundle_id.'_desc' ,
221
+ __( 'Description', 'woocommerce-multilingual' ),
222
+ $data,
223
+ false
224
+ );
225
+ $group->add_field( $bundle_field );
226
+ $add_group = true;
227
+ }
228
+
229
+ if( $add_group ){
230
+ $bundles_section->add_field( $group );
231
+ $flag = true;
232
+ }
233
+ }
234
+
235
+ if( $flag ){
236
+ $obj->add_field( $bundles_section );
237
+ }
238
+ }
239
+
240
+
241
+ function custom_box_html_data( $data, $product_id, $translation, $lang ){
242
+ $bundle_data = maybe_unserialize( get_post_meta( $product_id, '_bundle_data', true ) );
243
+
244
+ if( $translation ) {
245
+ $tr_product_id = $translation->ID;
246
+ $tr_bundle_data = maybe_unserialize( get_post_meta( $tr_product_id, '_bundle_data', true ) );
247
+ }
248
+
249
+ if( empty( $bundle_data ) || $bundle_data == false ){
250
+ return $data;
251
+ }
252
+
253
+ $product_bundles = array_keys( $bundle_data );
254
+
255
+ foreach ( $product_bundles as $bundle_key ) {
256
+
257
+ $key_data = $this->translate_bundle_key( $bundle_key, $lang );
258
+ $tr_bundle_key = $key_data->tr_key;
259
+
260
+ if( $bundle_data[ $bundle_key ][ 'override_title' ] == 'yes' ){
261
+ $data[ 'bundle_'.$bundle_key.'_title' ] = array( 'original' => $bundle_data[ $bundle_key ][ 'product_title' ] );
262
+ if( isset( $tr_bundle_data[ $tr_bundle_key ][ 'override_title' ] ) ){
263
+ $data[ 'bundle_'.$bundle_key.'_title' ][ 'translation' ] = $tr_bundle_data[ $tr_bundle_key ][ 'product_title' ];
264
+ }else{
265
+ $data[ 'bundle_'.$bundle_key.'_title' ][ 'translation' ] = '';
266
+ }
267
+ }
268
+
269
+ if( $bundle_data[ $bundle_key ][ 'override_description' ] == 'yes' ){
270
+ $data[ 'bundle_'.$bundle_key.'_desc' ] = array( 'original' => $bundle_data[ $bundle_key ][ 'product_description' ] );
271
+ if( isset( $tr_bundle_data[ $tr_bundle_key ][ 'override_description' ] ) ){
272
+ $data[ 'bundle_'.$bundle_key.'_desc' ][ 'translation' ] = $tr_bundle_data[ $tr_bundle_key ][ 'product_description' ];
273
+ }else{
274
+ $data[ 'bundle_'.$bundle_key.'_desc' ][ 'translation' ] = '';
275
+ }
276
+ }
277
+ }
278
+
279
+ return $data;
280
+ }
281
+
282
+ function resync_bundle( $cart_item, $session_values, $cart_item_key ) {
283
+ if ( isset( $cart_item[ 'bundled_items' ] ) && $cart_item[ 'data' ]->product_type === 'bundle' ) {
284
+ $current_bundle_id = apply_filters( 'translate_object_id', $cart_item[ 'product_id' ], 'product', true );
285
+ if ( $cart_item[ 'product_id' ] != $current_bundle_id ) {
286
+ $old_bundled_item_ids = array_keys( $cart_item[ 'data' ]->bundle_data );
287
+ $cart_item[ 'data' ] = wc_get_product( $current_bundle_id );
288
+ if( is_array( $cart_item[ 'data' ]->bundle_data ) ){
289
+ $new_bundled_item_ids = array_keys( $cart_item[ 'data' ]->bundle_data );
290
+ $remapped_bundled_item_ids = array();
291
+ foreach ( $old_bundled_item_ids as $old_item_id_index => $old_item_id ) {
292
+ $remapped_bundled_item_ids[ $old_item_id ] = $new_bundled_item_ids[ $old_item_id_index ];
293
+ }
294
+ $cart_item[ 'remapped_bundled_item_ids' ] = $remapped_bundled_item_ids;
295
+ if ( isset( $cart_item[ 'stamp' ] ) ) {
296
+ $new_stamp = array();
297
+ foreach ( $cart_item[ 'stamp' ] as $bundled_item_id => $stamp_data ) {
298
+ $new_stamp[ $remapped_bundled_item_ids[ $bundled_item_id ] ] = $stamp_data;
299
+ }
300
+ $cart_item[ 'stamp' ] = $new_stamp;
301
+ }
302
+ }
303
+ }
304
+ }
305
+ if ( isset( $cart_item[ 'bundled_by' ] ) && isset( WC()->cart->cart_contents[ $cart_item[ 'bundled_by' ] ] ) ) {
306
+ $bundle_cart_item = WC()->cart->cart_contents[ $cart_item[ 'bundled_by' ] ];
307
+ if (
308
+ isset( $bundle_cart_item[ 'remapped_bundled_item_ids' ] ) &&
309
+ isset( $cart_item[ 'bundled_item_id' ] ) &&
310
+ isset( $bundle_cart_item[ 'remapped_bundled_item_ids' ][ $cart_item[ 'bundled_item_id' ] ] )
311
+ ) {
312
+ $old_id = $cart_item[ 'bundled_item_id' ];
313
+ $remapped_bundled_item_ids = $bundle_cart_item[ 'remapped_bundled_item_ids' ];
314
+ $cart_item[ 'bundled_item_id' ] = $remapped_bundled_item_ids[ $cart_item[ 'bundled_item_id' ] ];
315
+ if ( isset( $cart_item[ 'stamp' ] ) ) {
316
+ $new_stamp = array();
317
+ foreach ( $cart_item[ 'stamp' ] as $bundled_item_id => $stamp_data ) {
318
+ $new_stamp[ $remapped_bundled_item_ids[ $bundled_item_id ] ] = $stamp_data;
319
+ }
320
+ $cart_item[ 'stamp' ] = $new_stamp;
321
+ }
322
+ }
323
+ }
324
+
325
+ return $cart_item;
326
+ }
327
+
328
+ function resync_bundle_clean( $cart ) {
329
+ foreach ( $cart->cart_contents as $cart_item_key => $cart_item ) {
330
+ if ( isset( $cart_item[ 'bundled_items' ] ) && WooCommerce_Functions_Wrapper::get_product_type( $cart_item[ 'product_id' ] ) === 'bundle' ) {
331
+ if ( isset( $cart_item[ 'remapped_bundled_item_ids' ] ) ) {
332
+ unset( WC()->cart->cart_contents[ $cart_item_key ][ 'remapped_bundled_item_ids' ] );
333
+ }
334
+ }
335
+ }
336
+ }
337
+
338
+ function append_bundle_data_translation_package( $package, $post ){
339
+
340
+ if( $post->post_type == 'product' ) {
341
+
342
+ $bundle_data = get_post_meta( $post->ID, '_bundle_data', true );
343
+
344
+ if( $bundle_data ){
345
+
346
+ $fields = array( 'title', 'description' );
347
+
348
+ foreach( $bundle_data as $bundle_key => $product ){
349
+
350
+ foreach( $fields as $field ) {
351
+ if ( $product[ 'override_' . $field ] == 'yes' && !empty( $product[ 'product_' . $field ] ) ) {
352
+
353
+ $package[ 'contents' ][ 'product_bundles:' . $bundle_key . ':' . $field ] = array(
354
+ 'translate' => 1,
355
+ 'data' => $this->tp->encode_field_data( $product[ 'product_' . $field ], 'base64' ),
356
+ 'format' => 'base64'
357
+ );
358
+
359
+ }
360
+ }
361
+ }
362
+ }
363
+ }
364
+
365
+ return $package;
366
+
367
+ }
368
+
369
+ function save_bundle_data_translation( $post_id, $data, $job ){
370
+
371
+ remove_action( 'wcml_after_duplicate_product_post_meta', array( $this, 'sync_bundled_ids' ), 10, 2 );
372
+
373
+ $bundle_data = get_post_meta( $post_id, '_bundle_data', true );
374
+
375
+ $bundle_data_original = get_post_meta( $job->original_doc_id , '_bundle_data', true );
376
+
377
+ $translated_bundle_pieces = array();
378
+
379
+ foreach( $data as $value){
380
+
381
+ if( preg_match( '/product_bundles:([0-9]+):(.+)/', $value[ 'field_type' ], $matches ) ){
382
+
383
+ $bundle_key = $matches[1];
384
+ $field = $matches[2];
385
+
386
+ $key_data = $this->translate_bundle_key( $bundle_key, $job->language_code );
387
+
388
+ if( !isset( $bundle_data[ $key_data->tr_key ] ) ){
389
+ $bundle_data[ $key_data->tr_key ] = array(
390
+ 'product_id' => $key_data->tr_id,
391
+ 'hide_thumbnail' => $bundle_data_original[ $bundle_key ][ 'hide_thumbnail' ],
392
+ 'override_title' => $bundle_data_original[ $bundle_key ][ 'override_title' ],
393
+ 'product_title' => '',
394
+ 'override_description' => $bundle_data_original[ $bundle_key ][ 'override_description' ],
395
+ 'product_description' => '',
396
+ 'optional' => $bundle_data_original[ $bundle_key ][ 'optional' ],
397
+ 'bundle_quantity' => $bundle_data_original[ $bundle_key ][ 'bundle_quantity' ],
398
+ 'bundle_quantity_max' => $bundle_data_original[ $bundle_key ][ 'bundle_quantity_max' ],
399
+ 'bundle_discount' => $bundle_data_original[ $bundle_key ][ 'bundle_discount' ],
400
+ 'visibility' => $bundle_data_original[ $bundle_key ][ 'visibility' ],
401
+ );
402
+ }
403
+
404
+ $bundle_data[ $key_data->tr_key ][ 'product_'.$field ] = $value[ 'data' ];
405
+
406
+ }
407
+ }
408
+
409
+ update_post_meta( $post_id, '_bundle_data', $bundle_data );
410
+
411
+ }
412
+ }
compatibility/class-wcml-product-bundles.php CHANGED
@@ -1,10 +1,11 @@
1
  <?php
 
2
  class WCML_Product_Bundles{
3
 
4
  /**
5
  * @var WPML_Element_Translation_Package
6
  */
7
- var $tp;
8
 
9
  /**
10
  * @var SitePress
@@ -16,276 +17,460 @@ class WCML_Product_Bundles{
16
  */
17
  private $woocommerce_wpml;
18
 
 
 
 
 
 
19
  /**
20
  * WCML_Product_Bundles constructor.
21
  */
22
- function __construct( &$sitepress, &$woocommerce_wpml ){
 
23
  $this->sitepress = $sitepress;
24
  $this->woocommerce_wpml = $woocommerce_wpml;
 
25
 
26
- add_action( 'wcml_gui_additional_box_html', array( $this, 'custom_box_html' ), 10, 3 );
27
- add_filter( 'wcml_gui_additional_box_data', array( $this, 'custom_box_html_data' ), 10, 4 );
28
- add_action( 'wcml_after_duplicate_product_post_meta', array( $this, 'sync_bundled_ids' ), 10, 2 );
29
- add_action( 'wcml_update_extra_fields', array( $this, 'bundle_update' ), 10, 4 );
30
  add_action( 'woocommerce_get_cart_item_from_session', array( $this, 'resync_bundle' ), 5, 3 );
31
  add_filter( 'woocommerce_cart_loaded_from_session', array( $this, 'resync_bundle_clean' ), 10 );
32
 
33
- if( version_compare( WCML_VERSION, '3.7.2', '>' ) ){
34
- add_filter( 'option_wpml_config_files_arr', array( $this, 'make__bundle_data_not_translatable_by_default' ), 0 );
35
- }
36
-
37
  if( is_admin() ){
38
  $this->tp = new WPML_Element_Translation_Package();
39
 
40
  add_filter( 'wpml_tm_translation_job_data', array( $this, 'append_bundle_data_translation_package' ), 10, 2 );
41
  add_action( 'wpml_translation_job_saved', array( $this, 'save_bundle_data_translation' ), 10, 3 );
42
 
43
- }
 
44
 
 
 
 
 
 
45
 
46
  }
47
 
48
- function make__bundle_data_not_translatable_by_default( $wpml_config_array ){
 
49
 
50
- if( isset( $wpml_config_array->plugins[ 'WooCommerce Product Bundles' ] ) ){
51
- $wpml_config_array->plugins[ 'WooCommerce Product Bundles' ] =
52
- str_replace(
53
- '<custom-field action="translate">_bundle_data</custom-field>',
54
- '<custom-field action="nothing">_bundle_data</custom-field>',
55
- $wpml_config_array->plugins[ 'WooCommerce Product Bundles' ] );
56
- }
57
 
58
- return $wpml_config_array;
59
- }
60
 
61
- // Sync Bundled product '_bundle_data' with translated values when the product is duplicated
62
- function sync_bundled_ids( $original_product_id, $trnsl_product_id ){
63
-
64
- $bundle_data_array = maybe_unserialize( get_post_meta( $original_product_id, '_bundle_data', true ) );
65
- if( $bundle_data_array ){
66
- $lang = $this->sitepress->get_language_for_element( $trnsl_product_id, 'post_product' );
67
- $tr_bundle_meta = maybe_unserialize( get_post_meta( $trnsl_product_id, '_bundle_data', true ) );
68
-
69
- $i = 2;
70
- foreach( $bundle_data_array as $bundle_key => $bundle_data ){
71
-
72
- $key_data = $this->translate_bundle_key( $bundle_key, $lang );
73
- $tr_id = $key_data->tr_id;
74
- $tr_bundle_key = $key_data->tr_key;
75
-
76
- $tr_bundle[ $tr_bundle_key ] = $bundle_data;
77
- $tr_bundle[ $tr_bundle_key ][ 'product_id' ] = $tr_id;
78
- if( isset( $bundle_data[ 'product_title' ] ) ){
79
- if( $bundle_data[ 'override_title' ] == 'yes' ){
80
- $tr_bundle[ $tr_bundle_key ][ 'product_title' ] =
81
- isset( $tr_bundle_meta[ $tr_bundle_key ][ 'product_title' ] ) ?
82
- $tr_bundle_meta[ $tr_bundle_key ][ 'product_title' ] :
83
- '';
84
- }else{
85
- $tr_title= get_the_title( $tr_id );
86
- $tr_bundle[ $tr_bundle_key ][ 'product_title' ] = $tr_title;
87
- }
88
- }
89
- if( isset( $bundle_data[ 'product_description' ] ) ){
90
- if( $bundle_data[ 'override_description' ] == 'yes' ){
91
- $tr_bundle[ $tr_bundle_key ][ 'product_description' ] =
92
- isset( $tr_bundle_meta[ $tr_bundle_key ][ 'product_description' ] ) ?
93
- $tr_bundle_meta[ $tr_bundle_key ][ 'product_description' ] :
94
- '';
95
- }else{
96
- $tr_prod = get_post( $tr_id );
97
- $tr_desc = $tr_prod->post_excerpt;
98
- $tr_bundle[ $tr_bundle_key ][ 'product_description' ] = $tr_desc;
99
- }
100
- }
101
- if( isset( $bundle_data[ 'filter_variations' ] ) && $bundle_data[ 'filter_variations' ] == 'yes' ){
102
- $allowed_var = $bundle_data[ 'allowed_variations' ];
103
- foreach( $allowed_var as $key => $var_id ){
104
- $tr_var_id = apply_filters( 'translate_object_id', $var_id, get_post_type( $var_id ), true, $lang );
105
- $tr_bundle[ $tr_bundle_key ][ 'allowed_variations' ][ $key ] = $tr_var_id;
106
- }
107
- }
108
- if( isset( $bundle_data[ 'bundle_defaults' ] ) && !empty( $bundle_data[ 'bundle_defaults' ] ) ){
109
- foreach( $bundle_data[ 'bundle_defaults' ] as $tax => $term_slug ){
110
-
111
- $term_id = $this->woocommerce_wpml->terms->wcml_get_term_id_by_slug( $tax, $term_slug );
112
- if( $term_id ){
113
- // Global Attribute
114
- $tr_def_id = apply_filters( 'translate_object_id', $term_id, $tax, true, $lang );
115
- $tr_term = $this->woocommerce_wpml->terms->wcml_get_term_by_id( $tr_def_id, $tax );
116
- $tr_bundle[ $tr_bundle_key ][ 'bundle_defaults' ][ $tax ] = $tr_term->slug;
117
- }else{
118
- // Custom Attribute
119
- $args = array(
120
- 'post_type' => 'product_variation',
121
- 'meta_key' => 'attribute_'.$tax,
122
- 'meta_value' => $term_slug,
123
- 'meta_compare' => '='
124
- );
125
- $variationloop = new WP_Query( $args );
126
- while ( $variationloop->have_posts() ) : $variationloop->the_post();
127
- $tr_var_id = apply_filters( 'translate_object_id', get_the_ID(), 'product_variation', true, $lang );
128
- $tr_meta = get_post_meta( $tr_var_id, 'attribute_'.$tax , true );
129
- $tr_bundle[ $tr_bundle_key ][ 'bundle_defaults' ][ $tax ] = $tr_meta;
130
- endwhile;
131
- }
132
- }
133
- }
134
- }
135
- update_post_meta( $trnsl_product_id, '_bundle_data', $tr_bundle );
136
 
137
- return $tr_bundle;
138
- }
139
 
140
- }
141
 
 
142
 
143
- public function translate_bundle_key( $key, $lang, $return_original_if_missing = true ) {
144
- $key_parts = explode( '_', $key );
145
- $has_multiple_products = count( $key_parts ) > 1;
146
 
147
- $data = new stdClass;
148
- $data->id = $has_multiple_products ? $key_parts[ 0 ] : $key;
149
- $data->tr_id = apply_filters( 'translate_object_id', $data->id, get_post_type( $data->id ), $return_original_if_missing, $lang );
150
- $data->tr_key = $data->tr_id . ( $has_multiple_products ? '_' . $key_parts[ 1 ] : '' );
151
 
152
- return $data;
153
- }
154
 
155
- // Update Bundled products title and descritpion after saving the translation
156
- function bundle_update( $original_product_id, $tr_id, $data, $lang ){
157
 
158
- $tr_bundle_data = array();
159
- $tr_bundle_data = maybe_unserialize( get_post_meta($tr_id,'_bundle_data', true ) );
160
 
161
- $bundle_data = maybe_unserialize( get_post_meta( $original_product_id, '_bundle_data', true ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
 
163
- if( empty( $bundle_data ) ){
164
- return;
165
- }
166
 
167
- $product_bundles = array_keys( $bundle_data );
168
 
169
- foreach ( $product_bundles as $key => $bundle_key ) {
 
170
 
171
- $key_data = $this->translate_bundle_key( $bundle_key, $lang );
172
- $tr_bundle_key = $key_data->tr_key;
173
 
174
- if( isset( $tr_bundle_data[ $tr_bundle_key ] ) ){
175
- $tr_bundle_data[ $tr_bundle_key ][ 'product_title' ] = $data[ md5( 'bundle_'.$bundle_key.'_title' ) ];
176
- $tr_bundle_data[ $tr_bundle_key ][ 'product_description' ] = $data[ md5( 'bundle_'.$bundle_key.'_desc' ) ];
177
- }
178
- }
179
- update_post_meta( $tr_id, '_bundle_data', $tr_bundle_data );
180
 
181
- return $tr_bundle_data;
182
- }
183
 
184
- // Add Bundles Box to WCML Translation GUI
185
- function custom_box_html( $obj, $product_id, $data ){
186
 
187
- $product_bundles = maybe_unserialize( get_post_meta( $product_id, '_bundle_data', true ) );
188
 
189
- if( empty( $product_bundles ) || $product_bundles == false ){
190
- return false;
191
- }
192
 
193
- $bundles_section = new WPML_Editor_UI_Field_Section( __( 'Product Bundles', 'woocommerce-multilingual' ) );
194
- end( $product_bundles );
195
- $last_key = key( $product_bundles );
196
- $divider = true;
197
- $flag = false;
198
 
199
- foreach ( $product_bundles as $bundle_id => $product_bundle ) {
200
- $add_group = false;
201
- if( $bundle_id == $last_key ){
202
- $divider = false;
203
- }
204
 
205
- $group = new WPML_Editor_UI_Field_Group( get_the_title( $bundle_id ), $divider );
206
-
207
- if( $product_bundle[ 'override_title' ] == 'yes' ) {
208
- $bundle_field = new WPML_Editor_UI_Single_Line_Field(
209
- 'bundle_' . $bundle_id . '_title',
210
- __( 'Name', 'woocommerce-multilingual' ),
211
- $data,
212
- false
213
- );
214
- $group->add_field( $bundle_field );
215
- $add_group = true;
216
- }
217
 
218
- if( $product_bundle[ 'override_description' ] == 'yes' ){
219
- $bundle_field = new WPML_Editor_UI_Single_Line_Field(
220
- 'bundle_'.$bundle_id.'_desc' ,
221
- __( 'Description', 'woocommerce-multilingual' ),
222
- $data,
223
- false
224
- );
225
- $group->add_field( $bundle_field );
226
- $add_group = true;
227
- }
228
 
229
- if( $add_group ){
230
- $bundles_section->add_field( $group );
231
- $flag = true;
232
- }
233
- }
234
 
235
- if( $flag ){
236
- $obj->add_field( $bundles_section );
237
- }
238
- }
 
239
 
 
240
 
241
- function custom_box_html_data( $data, $product_id, $translation, $lang ){
242
- $bundle_data = maybe_unserialize( get_post_meta( $product_id, '_bundle_data', true ) );
243
 
244
- if( $translation ) {
245
- $tr_product_id = $translation->ID;
246
- $tr_bundle_data = maybe_unserialize( get_post_meta( $tr_product_id, '_bundle_data', true ) );
247
- }
 
248
 
249
- if( empty( $bundle_data ) || $bundle_data == false ){
250
- return $data;
251
- }
 
 
 
 
252
 
253
- $product_bundles = array_keys( $bundle_data );
254
 
255
- foreach ( $product_bundles as $bundle_key ) {
 
256
 
257
- $key_data = $this->translate_bundle_key( $bundle_key, $lang );
258
- $tr_bundle_key = $key_data->tr_key;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
 
260
- if( $bundle_data[ $bundle_key ][ 'override_title' ] == 'yes' ){
261
- $data[ 'bundle_'.$bundle_key.'_title' ] = array( 'original' => $bundle_data[ $bundle_key ][ 'product_title' ] );
262
- if( isset( $tr_bundle_data[ $tr_bundle_key ][ 'override_title' ] ) ){
263
- $data[ 'bundle_'.$bundle_key.'_title' ][ 'translation' ] = $tr_bundle_data[ $tr_bundle_key ][ 'product_title' ];
264
- }else{
265
- $data[ 'bundle_'.$bundle_key.'_title' ][ 'translation' ] = '';
266
- }
267
- }
268
 
269
- if( $bundle_data[ $bundle_key ][ 'override_description' ] == 'yes' ){
270
- $data[ 'bundle_'.$bundle_key.'_desc' ] = array( 'original' => $bundle_data[ $bundle_key ][ 'product_description' ] );
271
- if( isset( $tr_bundle_data[ $tr_bundle_key ][ 'override_description' ] ) ){
272
- $data[ 'bundle_'.$bundle_key.'_desc' ][ 'translation' ] = $tr_bundle_data[ $tr_bundle_key ][ 'product_description' ];
273
- }else{
274
- $data[ 'bundle_'.$bundle_key.'_desc' ][ 'translation' ] = '';
275
- }
276
  }
 
 
 
 
277
  }
278
 
279
- return $data;
280
  }
281
 
282
- function resync_bundle( $cart_item, $session_values, $cart_item_key ) {
 
283
  if ( isset( $cart_item[ 'bundled_items' ] ) && $cart_item[ 'data' ]->product_type === 'bundle' ) {
284
  $current_bundle_id = apply_filters( 'translate_object_id', $cart_item[ 'product_id' ], 'product', true );
285
  if ( $cart_item[ 'product_id' ] != $current_bundle_id ) {
286
  $old_bundled_item_ids = array_keys( $cart_item[ 'data' ]->bundle_data );
287
  $cart_item[ 'data' ] = wc_get_product( $current_bundle_id );
288
- if( is_array( $cart_item[ 'data' ]->bundle_data ) ){
289
  $new_bundled_item_ids = array_keys( $cart_item[ 'data' ]->bundle_data );
290
  $remapped_bundled_item_ids = array();
291
  foreach ( $old_bundled_item_ids as $old_item_id_index => $old_item_id ) {
@@ -325,7 +510,7 @@ class WCML_Product_Bundles{
325
  return $cart_item;
326
  }
327
 
328
- function resync_bundle_clean( $cart ) {
329
  foreach ( $cart->cart_contents as $cart_item_key => $cart_item ) {
330
  if ( isset( $cart_item[ 'bundled_items' ] ) && WooCommerce_Functions_Wrapper::get_product_type( $cart_item[ 'product_id' ] ) === 'bundle' ) {
331
  if ( isset( $cart_item[ 'remapped_bundled_item_ids' ] ) ) {
@@ -335,78 +520,81 @@ class WCML_Product_Bundles{
335
  }
336
  }
337
 
338
- function append_bundle_data_translation_package( $package, $post ){
339
-
340
- if( $post->post_type == 'product' ) {
341
-
342
- $bundle_data = get_post_meta( $post->ID, '_bundle_data', true );
343
-
344
- if( $bundle_data ){
345
-
346
- $fields = array( 'title', 'description' );
347
-
348
- foreach( $bundle_data as $bundle_key => $product ){
349
-
350
- foreach( $fields as $field ) {
351
- if ( $product[ 'override_' . $field ] == 'yes' && !empty( $product[ 'product_' . $field ] ) ) {
352
-
353
- $package[ 'contents' ][ 'product_bundles:' . $bundle_key . ':' . $field ] = array(
354
- 'translate' => 1,
355
- 'data' => $this->tp->encode_field_data( $product[ 'product_' . $field ], 'base64' ),
356
- 'format' => 'base64'
357
- );
358
-
359
- }
360
- }
361
- }
362
- }
363
- }
364
-
365
- return $package;
366
-
367
- }
368
-
369
- function save_bundle_data_translation( $post_id, $data, $job ){
370
 
371
  remove_action( 'wcml_after_duplicate_product_post_meta', array( $this, 'sync_bundled_ids' ), 10, 2 );
372
 
373
- $bundle_data = get_post_meta( $post_id, '_bundle_data', true );
374
 
375
- $bundle_data_original = get_post_meta( $job->original_doc_id , '_bundle_data', true );
376
 
377
- $translated_bundle_pieces = array();
378
 
379
  foreach( $data as $value){
380
 
381
  if( preg_match( '/product_bundles:([0-9]+):(.+)/', $value[ 'field_type' ], $matches ) ){
382
 
383
- $bundle_key = $matches[1];
384
  $field = $matches[2];
385
 
386
- $key_data = $this->translate_bundle_key( $bundle_key, $job->language_code );
 
 
 
 
 
 
387
 
388
- if( !isset( $bundle_data[ $key_data->tr_key ] ) ){
389
- $bundle_data[ $key_data->tr_key ] = array(
390
- 'product_id' => $key_data->tr_id,
391
- 'hide_thumbnail' => $bundle_data_original[ $bundle_key ][ 'hide_thumbnail' ],
392
- 'override_title' => $bundle_data_original[ $bundle_key ][ 'override_title' ],
393
  'product_title' => '',
394
- 'override_description' => $bundle_data_original[ $bundle_key ][ 'override_description' ],
395
  'product_description' => '',
396
- 'optional' => $bundle_data_original[ $bundle_key ][ 'optional' ],
397
- 'bundle_quantity' => $bundle_data_original[ $bundle_key ][ 'bundle_quantity' ],
398
- 'bundle_quantity_max' => $bundle_data_original[ $bundle_key ][ 'bundle_quantity_max' ],
399
- 'bundle_discount' => $bundle_data_original[ $bundle_key ][ 'bundle_discount' ],
400
- 'visibility' => $bundle_data_original[ $bundle_key ][ 'visibility' ],
 
 
 
 
 
 
 
 
 
 
 
401
  );
402
  }
403
 
404
- $bundle_data[ $key_data->tr_key ][ 'product_'.$field ] = $value[ 'data' ];
405
-
406
  }
 
407
  }
408
 
409
- update_post_meta( $post_id, '_bundle_data', $bundle_data );
 
410
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
411
  }
412
  }
1
  <?php
2
+
3
  class WCML_Product_Bundles{
4
 
5
  /**
6
  * @var WPML_Element_Translation_Package
7
  */
8
+ public $tp;
9
 
10
  /**
11
  * @var SitePress
17
  */
18
  private $woocommerce_wpml;
19
 
20
+ /**
21
+ * @var WCML_WC_Product_Bundles_Items
22
+ */
23
+ private $product_bundles_items;
24
+
25
  /**
26
  * WCML_Product_Bundles constructor.
27
  */
28
+ function __construct( &$sitepress, &$woocommerce_wpml, &$product_bundles_items ){
29
+
30
  $this->sitepress = $sitepress;
31
  $this->woocommerce_wpml = $woocommerce_wpml;
32
+ $this->product_bundles_items = $product_bundles_items;
33
 
 
 
 
 
34
  add_action( 'woocommerce_get_cart_item_from_session', array( $this, 'resync_bundle' ), 5, 3 );
35
  add_filter( 'woocommerce_cart_loaded_from_session', array( $this, 'resync_bundle_clean' ), 10 );
36
 
 
 
 
 
37
  if( is_admin() ){
38
  $this->tp = new WPML_Element_Translation_Package();
39
 
40
  add_filter( 'wpml_tm_translation_job_data', array( $this, 'append_bundle_data_translation_package' ), 10, 2 );
41
  add_action( 'wpml_translation_job_saved', array( $this, 'save_bundle_data_translation' ), 10, 3 );
42
 
43
+ add_action( 'wcml_gui_additional_box_html', array( $this, 'custom_box_html' ), 10, 3 );
44
+ add_filter( 'wcml_gui_additional_box_data', array( $this, 'custom_box_html_data' ), 10, 4 );
45
 
46
+ add_action( 'wcml_after_duplicate_product_post_meta', array( $this, 'sync_bundled_ids' ), 10, 2 );
47
+ add_action( 'wcml_update_extra_fields', array( $this, 'bundle_update' ), 10, 4 );
48
+
49
+ add_action( 'save_post', array( $this, 'sync_product_bundle_meta_with_translations' ) );
50
+ }
51
 
52
  }
53
 
54
+ private function get_product_bundle_data( $bundle_id ){
55
+ $product_bundle_data = array();
56
 
57
+ $bundle_items = $this->product_bundles_items->get_items( $bundle_id );
58
+ foreach( $bundle_items as $key => $bundle_item ){
59
+ $product_bundle_data[ $bundle_item->item_id ] = $this->product_bundles_items->get_item_data( $bundle_item );
60
+ }
 
 
 
61
 
62
+ return $product_bundle_data;
63
+ }
64
 
65
+ private function save_product_bundle_data( $bundle_id, $product_bundle_data ){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
67
+ $bundle_items = $this->product_bundles_items->get_items( $bundle_id );
 
68
 
69
+ foreach( $bundle_items as $item_id => $bundle_item ){
70
 
71
+ $bundled_item_data = $this->product_bundles_items->get_item_data_object( $item_id );
72
 
73
+ foreach( $product_bundle_data[ $item_id ] as $key => $value ){
74
+ $this->product_bundles_items->update_item_meta( $bundled_item_data, $key, $value );
75
+ }
76
 
77
+ $this->product_bundles_items->save_item_meta( $bundled_item_data );
 
 
 
78
 
79
+ }
 
80
 
81
+ }
 
82
 
83
+ private function sync_product_bundle_meta( $bundle_id, $translated_bundle_id ){
 
84
 
85
+ $bundle_items = $this->product_bundles_items->get_items( $bundle_id );
86
+ $fields_to_sync = array(
87
+ 'optional',
88
+ 'stock_status',
89
+ 'max_stock',
90
+ 'quantity_min',
91
+ 'quantity_max',
92
+ 'shipped_individually',
93
+ 'priced_individually',
94
+ 'single_product_visibility',
95
+ 'cart_visibility',
96
+ 'order_visibility',
97
+ 'single_product_price_visibility',
98
+ 'cart_price_visibility',
99
+ 'order_price_visibility'
100
+ );
101
 
102
+ $target_lang = $this->sitepress->get_language_for_element( $translated_bundle_id, 'post_product' );
 
 
103
 
104
+ foreach( $bundle_items as $item_id => $bundle_item ){
105
 
106
+ $item_meta = $this->product_bundles_items->get_item_data( $bundle_item );
107
+ $translated_product_id = apply_filters( 'translate_object_id', $item_meta['product_id'], get_post_type( $item_meta['product_id'] ), false, $target_lang );
108
 
109
+ if( $translated_product_id ){
110
+ $translated_item_id = $this->get_item_id_for_product_id( $translated_product_id, $translated_bundle_id );
111
 
112
+ $translated_item = $this->product_bundles_items->get_item_data_object( $translated_item_id );
113
+ foreach( $fields_to_sync as $key ){
114
+ $this->product_bundles_items->update_item_meta( $translated_item, $key, $item_meta[$key] );
115
+ }
116
+ $this->product_bundles_items->save_item_meta( $translated_item );
117
+ }
118
 
119
+ }
 
120
 
 
 
121
 
 
122
 
123
+ }
 
 
124
 
125
+ public function sync_product_bundle_meta_with_translations( $bundle_id ){
 
 
 
 
126
 
127
+ if ( WooCommerce_Functions_Wrapper::get_product_type( $bundle_id ) === 'bundle' ) {
 
 
 
 
128
 
129
+ $trid = $this->sitepress->get_element_trid( $bundle_id, 'post_product' );
130
+ $tranlations = $this->sitepress->get_element_translations( $trid, 'post_product' );
 
 
 
 
 
 
 
 
 
 
131
 
132
+ foreach ( $tranlations as $language => $translation ) {
133
+ if ( $translation->original ) {
134
+ $original_bundle_id = $translation->element_id;
135
+ break;
136
+ }
 
 
 
 
 
137
 
138
+ }
 
 
 
 
139
 
140
+ foreach ( $tranlations as $language => $translation ) {
141
+ if ( $translation->element_id !== $original_bundle_id ) {
142
+ $this->sync_product_bundle_meta( $original_bundle_id, $translation->element_id );
143
+ }
144
+ }
145
 
146
+ }
147
 
148
+ }
 
149
 
150
+ private function get_product_id_for_item_id( $item_id ){
151
+ global $wpdb;
152
+ return $wpdb->get_var( $wpdb->prepare(
153
+ "SELECT product_id FROM {$wpdb->prefix}woocommerce_bundled_items WHERE bundled_item_id=%d", $item_id) );
154
+ }
155
 
156
+ private function get_item_id_for_product_id( $product_id, $bundle_id ){
157
+ global $wpdb;
158
+ return $wpdb->get_var( $wpdb->prepare(
159
+ "SELECT bundled_item_id FROM {$wpdb->prefix}woocommerce_bundled_items WHERE product_id=%d AND bundle_id=%d",
160
+ $product_id, $bundle_id
161
+ ) );
162
+ }
163
 
 
164
 
165
+ // Add Bundles Box to WCML Translation GUI
166
+ public function custom_box_html( $obj, $bundle_id, $data ){
167
 
168
+ $bundle_items = $this->product_bundles_items->get_items( $bundle_id );
169
+
170
+ if( empty( $bundle_items ) ){
171
+ return false;
172
+ }
173
+
174
+ $bundles_section = new WPML_Editor_UI_Field_Section( __( 'Product Bundles', 'woocommerce-multilingual' ) );
175
+
176
+ end( $bundle_items );
177
+ $last_item_id = key( $bundle_items );
178
+ $divider = true;
179
+ $flag = false;
180
+
181
+ foreach ( $bundle_items as $item_id => $bundle_item ) {
182
+
183
+ $translated_product = apply_filters( 'translate_object_id', $bundle_item->product_id, get_post_type( $bundle_item->product_id ), false, $obj->get_target_language() );
184
+ if( !is_null($translated_product)) {
185
+
186
+ $add_group = false;
187
+ if( $item_id == $last_item_id ){
188
+ $divider = false;
189
+ }
190
+
191
+ $bundle_item_data = $this->product_bundles_items->get_item_data( $bundle_item );
192
+
193
+ $group = new WPML_Editor_UI_Field_Group( get_the_title( $bundle_item->product_id ), $divider );
194
+
195
+ if( $bundle_item_data[ 'override_title' ] == 'yes' ) {
196
+ $bundle_field = new WPML_Editor_UI_Single_Line_Field(
197
+ 'bundle_' . $bundle_item->product_id . '_title',
198
+ __( 'Name', 'woocommerce-multilingual' ),
199
+ $data,
200
+ false
201
+ );
202
+ $group->add_field( $bundle_field );
203
+ $add_group = true;
204
+ }
205
+
206
+ if( $bundle_item_data[ 'override_description' ] == 'yes' ){
207
+ $bundle_field = new WPML_Editor_UI_Single_Line_Field(
208
+ 'bundle_'. $bundle_item->product_id . '_desc' ,
209
+ __( 'Description', 'woocommerce-multilingual' ),
210
+ $data,
211
+ false
212
+ );
213
+ $group->add_field( $bundle_field );
214
+ $add_group = true;
215
+ }
216
+
217
+ if( $add_group ){
218
+ $bundles_section->add_field( $group );
219
+ $flag = true;
220
+ }
221
+
222
+ }
223
+
224
+ }
225
+
226
+ if( $flag ){
227
+ $obj->add_field( $bundles_section );
228
+ }
229
+
230
+ }
231
+
232
+ public function custom_box_html_data( $data, $bundle_id, $translation, $lang ){
233
+
234
+ $bundle_data = $this->get_product_bundle_data( $bundle_id );
235
+
236
+ if( $translation ) {
237
+ $translated_bundle_id = $translation->ID;
238
+ $translated_bundle_data = $this->get_product_bundle_data( $translated_bundle_id );
239
+ }
240
+
241
+ if( empty( $bundle_data ) || $bundle_data == false ){
242
+ return $data;
243
+ }
244
+
245
+ $product_bundles = array_keys( $bundle_data );
246
+
247
+ foreach ( $product_bundles as $item_id ) {
248
+
249
+ $product_id = $this->get_product_id_for_item_id( $item_id );
250
+
251
+ $translated_product_id = apply_filters( 'translate_object_id', $product_id, get_post_type( $product_id ), false, $lang );
252
+ if( $translation ){
253
+ $translated_item_id = $this->get_item_id_for_product_id( $translated_product_id, $translated_bundle_id );
254
+ }
255
+
256
+ if( $bundle_data[ $item_id ][ 'override_title' ] == 'yes' ){
257
+ $data[ 'bundle_'.$product_id.'_title' ] = array( 'original' => $bundle_data[ $item_id ][ 'title' ] );
258
+ if( $translation && isset( $translated_bundle_data[ $translated_item_id ][ 'override_title' ] ) ){
259
+ $data[ 'bundle_'.$product_id.'_title' ][ 'translation' ] = $translated_bundle_data[ $translated_item_id ][ 'title' ];
260
+ }else{
261
+ $data[ 'bundle_'.$product_id.'_title' ][ 'translation' ] = '';
262
+ }
263
+ }
264
+
265
+ if( $bundle_data[ $item_id ][ 'override_description' ] == 'yes' ){
266
+ $data[ 'bundle_'.$product_id.'_desc' ] = array( 'original' => $bundle_data[ $item_id ][ 'description' ] );
267
+ if( $translation && isset( $translated_bundle_data[ $translated_item_id ][ 'override_description' ] ) ){
268
+ $data[ 'bundle_'.$product_id.'_desc' ][ 'translation' ] = $translated_bundle_data[ $translated_item_id ][ 'description' ];
269
+ }else{
270
+ $data[ 'bundle_'.$product_id.'_desc' ][ 'translation' ] = '';
271
+ }
272
+ }
273
+ }
274
+ return $data;
275
+ }
276
+
277
+ public function append_bundle_data_translation_package( $package, $post ){
278
+
279
+ if( $post->post_type == 'product' ) {
280
+
281
+ $bundle_data = $this->get_product_bundle_data( $post->ID );
282
+
283
+ if( $bundle_data ){
284
+
285
+ $fields = array( 'title', 'description' );
286
+
287
+ foreach( $bundle_data as $item_id => $product_data ){
288
+
289
+ $product_id = $this->get_product_id_for_item_id( $item_id );
290
+ foreach( $fields as $field ) {
291
+ if ( $product_data[ 'override_' . $field ] == 'yes' && !empty( $product_data[ $field ] ) ) {
292
+ $package[ 'contents' ][ 'product_bundles:' . $product_id . ':' . $field ] = array(
293
+ 'translate' => 1,
294
+ 'data' => $this->tp->encode_field_data( $product_data[ $field ], 'base64' ),
295
+ 'format' => 'base64'
296
+ );
297
+ }
298
+ }
299
+ }
300
+ }
301
+ }
302
+
303
+ return $package;
304
+
305
+ }
306
+
307
+ // Update Bundled products title and descritpion after saving the translation
308
+ public function bundle_update( $bundle_id, $translated_bundle_id, $data, $lang ){
309
+ global $wpdb;
310
+
311
+ $bundle_data = $this->get_product_bundle_data( $bundle_id );
312
+ $translated_bundle_data = $this->get_product_bundle_data( $translated_bundle_id );
313
+
314
+ if( empty( $bundle_data ) ){
315
+ return;
316
+ }
317
+
318
+ $translate_bundled_item_ids = $wpdb->get_col( $wpdb->prepare(
319
+ "SELECT product_id FROM {$wpdb->prefix}woocommerce_bundled_items WHERE bundle_id = %d", $translated_bundle_id ));
320
+
321
+ foreach ( $bundle_data as $item_id => $bundle_item_data ) {
322
+
323
+ $product_id = $this->get_product_id_for_item_id( $item_id );
324
+ $translated_product_id = apply_filters( 'translate_object_id', $product_id, get_post_type( $product_id ), false, $lang );
325
+
326
+ if( $translated_product_id ) {
327
+
328
+ if ( ! in_array( $translated_product_id, $translate_bundled_item_ids ) ) {
329
+
330
+ $menu_order = $wpdb->get_var( $wpdb->prepare( "
331
+ SELECT menu_order FROM {$wpdb->prefix}woocommerce_bundled_items
332
+ WHERE bundle_id=%d AND product_id=%d
333
+ ", $bundle_id, $bundle_item_data['product_id'] ) );
334
+
335
+ $wpdb->insert( $wpdb->prefix . 'woocommerce_bundled_items',
336
+ array(
337
+ 'product_id' => $translated_product_id,
338
+ 'bundle_id' => $translated_bundle_id,
339
+ 'menu_order' => $menu_order,
340
+ )
341
+ );
342
+ }
343
+
344
+ $translated_item_id = $this->get_item_id_for_product_id( $translated_product_id, $translated_bundle_id );
345
+
346
+ //$this->product_bundles_items->copy_item_data( $item_id, $translated_item_id );
347
+
348
+ if ( isset( $data[ md5( 'bundle_' . $product_id . '_title' ) ] ) ) {
349
+ $translated_bundle_data[ $translated_item_id ]['title'] = $data[ md5( 'bundle_' . $product_id . '_title' ) ];
350
+ $translated_bundle_data[ $translated_item_id ]['override_title'] = $bundle_item_data['override_title'];
351
+ }
352
+
353
+ if ( isset( $data[ md5( 'bundle_' . $product_id . '_desc' ) ] ) ) {
354
+ $translated_bundle_data[ $translated_item_id ]['description'] = $data[ md5( 'bundle_' . $product_id . '_desc' ) ];
355
+ $translated_bundle_data[ $translated_item_id ]['override_description'] = $bundle_item_data['override_description'];
356
+ }
357
+
358
+ }
359
+
360
+ }
361
+
362
+ $this->save_product_bundle_data( $translated_bundle_id, $translated_bundle_data );
363
+ $this->sync_product_bundle_meta( $bundle_id, $translated_bundle_id );
364
+
365
+ $this->sitepress->copy_custom_fields ( $bundle_id, $translated_bundle_id );
366
+
367
+ return $translated_bundle_data;
368
+ }
369
+
370
+ // Sync product bundle data with translated values when the product is duplicated
371
+ public function sync_bundled_ids( $bundle_id, $translated_bundle_id ){
372
+ global $wpdb;
373
+
374
+ $bundle_data = $this->get_product_bundle_data( $bundle_id );
375
+ if( $bundle_data ){
376
+ $lang = $this->sitepress->get_language_for_element( $translated_bundle_id, 'post_product' );
377
+ $translated_bundle_data = $this->get_product_bundle_data( $translated_bundle_id );
378
+
379
+ foreach( $bundle_data as $item_id => $product_data ){
380
+
381
+ $product_id = $this->get_product_id_for_item_id( $item_id );
382
+ $translated_product_id = apply_filters( 'translate_object_id', $product_id, get_post_type( $product_id ), false, $lang );
383
+
384
+ if( $translated_product_id ){
385
+
386
+ $translated_item_id = $this->get_item_id_for_product_id( $translated_product_id, $translated_bundle_id );
387
+ if( !$translated_item_id ){
388
+ $menu_order = $wpdb->get_var( $wpdb->prepare( "
389
+ SELECT menu_order FROM {$wpdb->prefix}woocommerce_bundled_items
390
+ WHERE bundle_id=%d AND product_id=%d
391
+ ", $bundle_id, $product_id ) );
392
+
393
+ $wpdb->insert( $wpdb->prefix . 'woocommerce_bundled_items',
394
+ array(
395
+ 'product_id' => $translated_product_id,
396
+ 'bundle_id' => $translated_bundle_id,
397
+ 'menu_order' => $menu_order,
398
+ )
399
+ );
400
+ $translated_item_id = $wpdb->insert_id;
401
+ }
402
+
403
+ $translated_bundle_data[ $translated_item_id ] = $product_data;
404
+ $translated_bundle_data[ $translated_item_id ]['product_id'] = $translated_product_id;
405
+
406
+ if( isset( $bundle_data[ 'title' ] ) ){
407
+ if( $bundle_data[ 'override_title' ] != 'yes' ){
408
+ $translated_bundle_data[ $translated_item_id ][ 'title' ] = get_the_title( $translated_product_id );
409
+ }
410
+ }
411
+
412
+ if( isset( $bundle_data[ 'title' ] ) ){
413
+ if( $bundle_data[ 'override_description' ] != 'yes' ){
414
+ $translated_bundle_data[ $translated_item_id ][ 'description' ] = get_the_title( $translated_product_id );
415
+ }
416
+ }
417
+
418
+ if( isset( $bundle_data[ 'filter_variations' ] ) && $bundle_data[ 'filter_variations' ] == 'yes' ){
419
+ $allowed_var = $bundle_data[ 'allowed_variations' ];
420
+ foreach( $allowed_var as $key => $var_id ){
421
+ $translated_var_id = apply_filters( 'translate_object_id', $var_id, get_post_type( $var_id ), true, $lang );
422
+ $translated_bundle_data[ $translated_item_id ][ 'allowed_variations' ][ $key ] = $translated_var_id;
423
+ }
424
+ }
425
+
426
+
427
+ if( isset( $bundle_data[ 'bundle_defaults' ] ) && !empty( $bundle_data[ 'bundle_defaults' ] ) ){
428
+ foreach( $bundle_data[ 'bundle_defaults' ] as $tax => $term_slug ){
429
+
430
+ $term_id = $this->woocommerce_wpml->terms->wcml_get_term_id_by_slug( $tax, $term_slug );
431
+ if( $term_id ){
432
+ // Global Attribute
433
+ $tr_def_id = apply_filters( 'translate_object_id', $term_id, $tax, true, $lang );
434
+ $tr_term = $this->woocommerce_wpml->terms->wcml_get_term_by_id( $tr_def_id, $tax );
435
+ $translated_bundle_data[ $translated_item_id ][ 'bundle_defaults' ][ $tax ] = $tr_term->slug;
436
+ }else{
437
+ // Custom Attribute
438
+ $args = array(
439
+ 'post_type' => 'product_variation',
440
+ 'meta_key' => 'attribute_'.$tax,
441
+ 'meta_value' => $term_slug,
442
+ 'meta_compare' => '='
443
+ );
444
+ $variationloop = new WP_Query( $args );
445
+ while ( $variationloop->have_posts() ) : $variationloop->the_post();
446
+ $tr_var_id = apply_filters( 'translate_object_id', get_the_ID(), 'product_variation', true, $lang );
447
+ $tr_meta = get_post_meta( $tr_var_id, 'attribute_'.$tax , true );
448
+ $translated_bundle_data[ $translated_item_id ][ 'bundle_defaults' ][ $tax ] = $tr_meta;
449
+ endwhile;
450
+ }
451
+ }
452
+ }
453
+
454
+ }
455
 
 
 
 
 
 
 
 
 
456
 
 
 
 
 
 
 
 
457
  }
458
+
459
+ $this->save_product_bundle_data( $translated_bundle_id, $translated_bundle_data );
460
+
461
+ return $translated_bundle_data;
462
  }
463
 
 
464
  }
465
 
466
+ public function resync_bundle( $cart_item, $session_values, $cart_item_key ) {
467
+
468
  if ( isset( $cart_item[ 'bundled_items' ] ) && $cart_item[ 'data' ]->product_type === 'bundle' ) {
469
  $current_bundle_id = apply_filters( 'translate_object_id', $cart_item[ 'product_id' ], 'product', true );
470
  if ( $cart_item[ 'product_id' ] != $current_bundle_id ) {
471
  $old_bundled_item_ids = array_keys( $cart_item[ 'data' ]->bundle_data );
472
  $cart_item[ 'data' ] = wc_get_product( $current_bundle_id );
473
+ if( isset($cart_item[ 'data' ]->bundle_data) && is_array( $cart_item[ 'data' ]->bundle_data ) ){
474
  $new_bundled_item_ids = array_keys( $cart_item[ 'data' ]->bundle_data );
475
  $remapped_bundled_item_ids = array();
476
  foreach ( $old_bundled_item_ids as $old_item_id_index => $old_item_id ) {
510
  return $cart_item;
511
  }
512
 
513
+ public function resync_bundle_clean( $cart ) {
514
  foreach ( $cart->cart_contents as $cart_item_key => $cart_item ) {
515
  if ( isset( $cart_item[ 'bundled_items' ] ) && WooCommerce_Functions_Wrapper::get_product_type( $cart_item[ 'product_id' ] ) === 'bundle' ) {
516
  if ( isset( $cart_item[ 'remapped_bundled_item_ids' ] ) ) {
520
  }
521
  }
522
 
523
+ public function save_bundle_data_translation( $translated_bundle_id, $data, $job ){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
524
 
525
  remove_action( 'wcml_after_duplicate_product_post_meta', array( $this, 'sync_bundled_ids' ), 10, 2 );
526
 
527
+ $translated_bundle_data = $this->get_product_bundle_data( $translated_bundle_id );
528
 
529
+ $bundle_id =& $job->original_doc_id;
530
 
531
+ $bundle_data = $this->get_product_bundle_data( $bundle_id );
532
 
533
  foreach( $data as $value){
534
 
535
  if( preg_match( '/product_bundles:([0-9]+):(.+)/', $value[ 'field_type' ], $matches ) ){
536
 
537
+ $product_id = $matches[1];
538
  $field = $matches[2];
539
 
540
+ $translated_product_id = apply_filters( 'translate_object_id', $product_id, get_post_type( $product_id ), false, $job->language_code );
541
+ $translated_item_id = $this->get_item_id_for_product_id( $translated_product_id, $translated_bundle_id );
542
+ if( empty( $translated_item_id ) ){
543
+ $translated_item_id = $this->add_product_to_bundle( $translated_product_id, $translated_bundle_id, $bundle_id, $product_id );
544
+ }
545
+
546
+ $item_id = $this->get_item_id_for_product_id( $product_id, $bundle_id );
547
 
548
+ if( !isset( $translated_bundle_data[ $translated_item_id ] ) ){
549
+ $translated_bundle_data[ $translated_item_id ] = array(
550
+ 'product_id' => $translated_product_id,
551
+ 'hide_thumbnail' => $bundle_data[ $item_id ][ 'hide_thumbnail' ],
552
+ 'override_title' => $bundle_data[ $item_id ][ 'override_title' ],
553
  'product_title' => '',
554
+ 'override_description' => $bundle_data[ $item_id ][ 'override_description' ],
555
  'product_description' => '',
556
+ 'optional' => $bundle_data[ $item_id ][ 'optional' ],
557
+ 'bundle_quantity' => $bundle_data[ $item_id ][ 'bundle_quantity' ],
558
+ 'bundle_quantity_max' => $bundle_data[ $item_id ][ 'bundle_quantity_max' ],
559
+ 'bundle_discount' => $bundle_data[ $item_id ][ 'bundle_discount' ],
560
+ 'single_product_visibility' => $bundle_data[ $item_id ][ 'single_product_visibility' ],
561
+ 'cart_visibility' => $bundle_data[ $item_id ][ 'cart_visibility' ],
562
+ 'order_visibility' => $bundle_data[ $item_id ][ 'order_visibility' ],
563
+ 'stock_status' => $bundle_data[ $item_id ][ 'stock_status' ],
564
+ 'max_stock' => $bundle_data[ $item_id ][ 'max_stock' ],
565
+ 'quantity_min' => $bundle_data[ $item_id ][ 'quantity_min' ],
566
+ 'quantity_max' => $bundle_data[ $item_id ][ 'quantity_max' ],
567
+ 'shipped_individually' => $bundle_data[ $item_id ][ 'shipped_individually' ],
568
+ 'priced_individually' => $bundle_data[ $item_id ][ 'priced_individually' ],
569
+ 'single_product_price_visibility' => $bundle_data[ $item_id ][ 'single_product_price_visibility' ],
570
+ 'cart_price_visibility' => $bundle_data[ $item_id ][ 'cart_price_visibility' ],
571
+ 'order_price_visibility' => $bundle_data[ $item_id ][ 'order_price_visibility' ]
572
  );
573
  }
574
 
575
+ $translated_bundle_data[ $translated_item_id ][ $field ] = $value[ 'data' ];
 
576
  }
577
+
578
  }
579
 
580
+ $this->save_product_bundle_data( $translated_bundle_id, $translated_bundle_data );
581
+ }
582
 
583
+ private function add_product_to_bundle( $product_id, $bundle_id, $original_bundle_id, $original_product_id ){
584
+ global $wpdb;
585
+ $menu_order = $wpdb->get_var( $wpdb->prepare( "
586
+ SELECT menu_order FROM {$wpdb->prefix}woocommerce_bundled_items
587
+ WHERE bundle_id=%d AND product_id=%d
588
+ ", $original_bundle_id, $original_product_id ) );
589
+
590
+ $wpdb->insert( $wpdb->prefix . 'woocommerce_bundled_items',
591
+ array(
592
+ 'product_id' => $product_id,
593
+ 'bundle_id' => $bundle_id,
594
+ 'menu_order' => $menu_order,
595
+ )
596
+ );
597
+
598
+ return $wpdb->insert_id;
599
  }
600
  }
compatibility/class-wcml-sensei.php CHANGED
@@ -187,7 +187,8 @@ class WCML_sensei{
187
 
188
  function filter_bought_product_id( $product_id, $order ){
189
 
190
- $order_language = get_post_meta( $order->id, 'wpml_language', true );
 
191
 
192
  $tr_product_id = apply_filters( 'translate_object_id', $product_id, get_post_type( $product_id ), false, $order_language );
193
 
187
 
188
  function filter_bought_product_id( $product_id, $order ){
189
 
190
+ $order_id = method_exists( 'WC_Order', 'get_id' ) ? $order->get_id() : $order->id;
191
+ $order_language = get_post_meta( $order_id, 'wpml_language', true );
192
 
193
  $tr_product_id = apply_filters( 'translate_object_id', $product_id, get_post_type( $product_id ), false, $order_language );
194
 
compatibility/class-wcml-tab-manager.php CHANGED
@@ -336,7 +336,7 @@ class WCML_Tab_Manager {
336
  $group = new WPML_Editor_UI_Field_Group( ucfirst( str_replace( '-', ' ', $prod_tab['name'] ) ), $divider );
337
  $tab_field = new WPML_Editor_UI_Single_Line_Field( 'tab_'.$prod_tab['position'].'_title', __( 'Title', 'woocommerce-multilingual' ), $data, false );
338
  $group->add_field( $tab_field );
339
- $tab_field = new WPML_Editor_UI_WYSIWYG_Field( 'tab_'.$prod_tab['position'].'_heading' , null, $data, false );
340
  $group->add_field( $tab_field );
341
  $tabs_section->add_field( $group );
342
  }
336
  $group = new WPML_Editor_UI_Field_Group( ucfirst( str_replace( '-', ' ', $prod_tab['name'] ) ), $divider );
337
  $tab_field = new WPML_Editor_UI_Single_Line_Field( 'tab_'.$prod_tab['position'].'_title', __( 'Title', 'woocommerce-multilingual' ), $data, false );
338
  $group->add_field( $tab_field );
339
+ $tab_field = new WCML_Editor_UI_WYSIWYG_Field( 'tab_'.$prod_tab['position'].'_heading' , null, $data, false );
340
  $group->add_field( $tab_field );
341
  $tabs_section->add_field( $group );
342
  }
compatibility/class-wcml-table-rate-shipping.php CHANGED
@@ -57,7 +57,11 @@ class WCML_Table_Rate_Shipping {
57
  if( isset( $_POST[ 'shipping_label' ] ) &&
58
  isset( $_POST[ 'woocommerce_table_rate_title' ] ) ){
59
  do_action( 'wpml_register_single_string', 'woocommerce', sanitize_text_field( $_POST[ 'woocommerce_table_rate_title' ] ) . '_shipping_method_title', sanitize_text_field( $_POST[ 'woocommerce_table_rate_title' ] ) );
60
- $shipping_labels = array_map( 'woocommerce_clean', $_POST[ 'shipping_label' ] );
 
 
 
 
61
  foreach ( $shipping_labels as $key => $shipping_label ) {
62
  $rate_key = isset( $_GET[ 'instance_id' ] ) ? 'table_rate'.$_GET[ 'instance_id' ].$_POST[ 'rate_id' ][ $key ] : $shipping_label;
63
  do_action( 'wpml_register_single_string', 'woocommerce', $rate_key. '_shipping_method_title', $shipping_label );
@@ -146,7 +150,7 @@ class WCML_Table_Rate_Shipping {
146
  public function filter_product_base_price( $row_base_price, $_product, $qty ){
147
 
148
  if( get_option( 'woocommerce_currency') != $this->woocommerce_wpml->multi_currency->get_client_currency() ){
149
- $row_base_price = apply_filters( 'wcml_product_price_by_currency', $_product->id, get_option( 'woocommerce_currency') ) * $qty;
150
  }
151
 
152
  return $row_base_price;
57
  if( isset( $_POST[ 'shipping_label' ] ) &&
58
  isset( $_POST[ 'woocommerce_table_rate_title' ] ) ){
59
  do_action( 'wpml_register_single_string', 'woocommerce', sanitize_text_field( $_POST[ 'woocommerce_table_rate_title' ] ) . '_shipping_method_title', sanitize_text_field( $_POST[ 'woocommerce_table_rate_title' ] ) );
60
+ if( version_compare( WC()->version, '2.7', '<' ) ){
61
+ $shipping_labels = array_map( 'woocommerce_clean', $_POST[ 'shipping_label' ] );
62
+ } else{
63
+ $shipping_labels = array_map( 'wc_clean', $_POST[ 'shipping_label' ] );
64
+ }
65
  foreach ( $shipping_labels as $key => $shipping_label ) {
66
  $rate_key = isset( $_GET[ 'instance_id' ] ) ? 'table_rate'.$_GET[ 'instance_id' ].$_POST[ 'rate_id' ][ $key ] : $shipping_label;
67
  do_action( 'wpml_register_single_string', 'woocommerce', $rate_key. '_shipping_method_title', $shipping_label );
150
  public function filter_product_base_price( $row_base_price, $_product, $qty ){
151
 
152
  if( get_option( 'woocommerce_currency') != $this->woocommerce_wpml->multi_currency->get_client_currency() ){
153
+ $row_base_price = apply_filters( 'wcml_product_price_by_currency', WooCommerce_Functions_Wrapper::get_product_id( $_product ), get_option( 'woocommerce_currency') ) * $qty;
154
  }
155
 
156
  return $row_base_price;
compatibility/class-wcml-the-events-calendar.php ADDED
@@ -0,0 +1,492 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WCML_The_Events_Calendar{
4
+
5
+ /** @var SitePress */
6
+ private $sitepress;
7
+ /** @var woocommerce_wpml */
8
+ private $woocommerce_wpml;
9
+
10
+ /** @var WPML_Element_Translation_Package */
11
+ private $tp;
12
+
13
+ function __construct( $sitepress, $woocommerce_wpml ){
14
+
15
+ $this->sitepress =& $sitepress;
16
+ $this->woocommerce_wpml =& $woocommerce_wpml;
17
+
18
+ if( isset( $_POST['action'] ) && strpos( $_POST['action'], 'tribe-ticket-add-') === 0 ){
19
+ add_action( 'tribe_tickets_ticket_add', array( $this, 'unset_post_post_id' ) );
20
+ add_action( 'event_tickets_after_save_ticket', array( $this, 'restore_post_post_id' ) );
21
+
22
+ }
23
+
24
+ if( is_admin() ){
25
+ $this->tp = new WPML_Element_Translation_Package;
26
+
27
+ add_action( 'save_post', array( $this, 'synchronize_event_for_ticket' ), 20, 3 );
28
+
29
+ add_action( 'wpml_pb_shortcode_content_for_translation' , array( $this, 'maybe_mark_event_as_needs_update' ), 100, 2 );
30
+
31
+ add_filter( 'wpml_tm_translation_job_data', array( $this, 'append_RSVP_tickets_to_translation_job' ), 10, 2 );
32
+ add_action( 'wpml_pro_translation_completed', array( $this, 'save_RSVP_tickets_translations' ), 10, 3 );
33
+
34
+ add_filter( 'wpml_tm_translation_job_data', array( $this, 'append_woo_tickets_to_translation_job' ), 10, 2 );
35
+ add_action( 'wpml_pro_translation_completed', array( $this, 'save_woo_tickets_translations' ), 10, 3 );
36
+
37
+ add_action( 'save_post', array( $this, 'synchronize_venue_for_event' ), 20, 3 );
38
+ add_action( 'admin_footer', array( $this, 'pre_select_translated_venue' ), 1000 );
39
+ add_action( 'wpml_pro_translation_completed', array( $this, 'save_venue_for_translation' ), 10, 3 );
40
+
41
+ } else {
42
+ add_action( 'event_tickets_rsvp_tickets_generated', array( $this, 'sync_rsvp_fields_on_attendee_created' ), 10, 3 );
43
+ add_filter( 'tribe_get_organizer_ids', array( $this, 'get_translated_organizer_ids' ), 10, 2 );
44
+ }
45
+
46
+ }
47
+
48
+ public function unset_post_post_id(){
49
+ if( isset( $_POST['post_ID'] ) ){
50
+ $this->ticket_post_id_backup = $_POST['post_ID'];
51
+ unset( $_POST['post_ID'] );
52
+ }
53
+ }
54
+
55
+ public function restore_post_post_id(){
56
+ if( isset( $this->ticket_post_id_backup ) ){
57
+ $_POST['post_ID'] = $this->ticket_post_id_backup;
58
+ }
59
+ }
60
+
61
+ public function synchronize_event_for_ticket( $post_id, $post, $update ){
62
+
63
+ if( $post->post_type == 'product' ){
64
+
65
+ if( !$this->woocommerce_wpml->products->is_original_product( $post_id ) ){
66
+
67
+ $original_product_id = apply_filters( 'translate_object_id', $post_id, 'product', false, $this->sitepress->get_default_language() );
68
+ if( $original_product_id ){
69
+ $original_event_id = get_post_meta( $original_product_id, '_tribe_wooticket_for_event', true );
70
+ if( $original_event_id ){
71
+ $event_id = apply_filters( 'translate_object_id', $original_event_id, 'tribe_events', false );
72
+ if( $event_id ){
73
+ update_post_meta( $post_id, '_tribe_wooticket_for_event', $event_id );
74
+ }
75
+ }
76
+ }
77
+
78
+ }
79
+
80
+ }
81
+ }
82
+
83
+ public function maybe_mark_event_as_needs_update( $content, $post_id ){
84
+ $post = get_post( $post_id );
85
+
86
+ if( $post->post_type == 'tribe_events' ){
87
+
88
+ if( $post_id == $this->sitepress->get_original_element_id( $post_id, 'post_tribe_events' ) ){
89
+
90
+ $tickets = [];
91
+ $ticket_meta = [];
92
+
93
+ if( class_exists('Tribe__Tickets__RSVP') ){
94
+ $ticket_ids = Tribe__Tickets__RSVP::get_instance()->get_tickets_ids( $post_id );
95
+ foreach ( $ticket_ids as $ticket_id ) {
96
+ $ticket = Tribe__Tickets__RSVP::get_instance()->get_ticket( $post_id, $ticket_id );
97
+ $tickets[] = $ticket->name . "|#|" . $ticket->description;
98
+ $ticket_meta[] = get_post_meta( $ticket_id, '_tribe_tickets_meta', true );
99
+ }
100
+ }
101
+
102
+ if( class_exists('Tribe__Tickets_Plus__Commerce__WooCommerce__Main') ){
103
+ $ticket_ids = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance()->get_tickets_ids( $post->ID );
104
+ foreach ( $ticket_ids as $ticket_id ) {
105
+ $ticket = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance()->get_ticket( $post_id, $ticket_id );
106
+ $tickets[] = $ticket->name . "|#|" . $ticket->description;
107
+ $ticket_meta[] = get_post_meta( $ticket_id, '_tribe_tickets_meta', true );
108
+ }
109
+ }
110
+
111
+ $content .= md5( serialize( $tickets ) );
112
+ $content .= md5( serialize( $ticket_meta ) );
113
+ }
114
+
115
+
116
+ }
117
+
118
+ return $content;
119
+ }
120
+
121
+ public function append_RSVP_tickets_to_translation_job( $package, $post ){
122
+
123
+ if( $post->post_type == 'tribe_events' ){
124
+
125
+ $ticket_lang = $this->sitepress->get_language_for_element( $post->ID, 'post_tribe_events' );
126
+ $this->sitepress->switch_lang( $ticket_lang );
127
+ $ticket_ids = Tribe__Tickets__RSVP::get_instance()->get_tickets_ids( $post->ID );
128
+ $this->sitepress->switch_lang();
129
+
130
+ if( $ticket_ids ){
131
+ foreach( $ticket_ids as $ticket_id ){
132
+
133
+ $ticket_post = get_post( $ticket_id );
134
+ $original_ticket_id = $this->sitepress->get_original_element_id( $ticket_id, 'post_tribe_rsvp_tickets' );
135
+
136
+ if( !empty( $ticket_post->post_title ) ) {
137
+ $package['contents'][ 'rsvp_tickets_' . $original_ticket_id . '_title' ] = array(
138
+ 'translate' => 1,
139
+ 'data' => $this->tp->encode_field_data( $ticket_post->post_title, 'base64' ),
140
+ 'format' => 'base64',
141
+ );
142
+ }
143
+ if( !empty( $ticket_post->post_excerpt ) ) {
144
+ $package['contents'][ 'rsvp_tickets_' . $original_ticket_id . '_excerpt' ] = array(
145
+ 'translate' => 1,
146
+ 'data' => $this->tp->encode_field_data( $ticket_post->post_excerpt, 'base64' ),
147
+ 'format' => 'base64',
148
+ );
149
+ }
150
+
151
+ // fieldsets
152
+ $package = $this->append_tickets_meta( $package, $ticket_id, $original_ticket_id );
153
+
154
+ }
155
+ }
156
+
157
+
158
+ }
159
+
160
+ return $package;
161
+ }
162
+
163
+ public function save_RSVP_tickets_translations( $post_id, $data, $job ){
164
+
165
+ $translations = array();
166
+
167
+ foreach ( $data as $key => $value ) {
168
+
169
+ if ( preg_match( '/rsvp_tickets_([0-9]+)_title/', $key, $matches ) ) {
170
+ $rsvp_post_id = $matches[1];
171
+ if( $value['finished'] == 'on' ){
172
+ $translations[ $rsvp_post_id ]['post_title'] = $value['data'];
173
+ }
174
+ } elseif ( preg_match( '/rsvp_tickets_([0-9]+)_excerpt/', $key, $matches ) ) {
175
+ $rsvp_post_id = $matches[1];
176
+ if( $value['finished'] == 'on' ){
177
+ $translations[ $rsvp_post_id ]['post_excerpt'] = $value['data'];
178
+ }
179
+ }
180
+
181
+ }
182
+
183
+ foreach ( $translations as $rsvp_post_id => $translation ){
184
+
185
+ $translated_rsvp_post_id = apply_filters( 'translate_object_id', $rsvp_post_id, 'tribe_rsvp_tickets', false, $job->language_code );
186
+
187
+ $postarr = array(
188
+ 'post_type' => 'tribe_rsvp_tickets',
189
+ 'post_status' => 'publish',
190
+ 'post_title' => $translation['post_title'],
191
+ 'post_excerpt' => $translation['post_excerpt'],
192
+ 'post_name' => sanitize_title_with_dashes( $translation['post_title'] )
193
+ );
194
+
195
+ if( $translated_rsvp_post_id && $translated_rsvp_post_id != $rsvp_post_id ){
196
+ global $wpml_post_translations;
197
+ $postarr['ID'] = $translated_rsvp_post_id;
198
+ remove_action( 'save_post', array( $wpml_post_translations, 'save_post_actions' ), 100 );
199
+ wp_update_post( $postarr );
200
+ add_action( 'save_post', array( $wpml_post_translations, 'save_post_actions' ), 100 );
201
+
202
+ } else{
203
+ $translated_rsvp_post_id = wp_insert_post( $postarr );
204
+ $trid = $this->sitepress->get_element_trid( $rsvp_post_id, 'post_tribe_rsvp_tickets' );
205
+ $this->sitepress->set_element_language_details( $translated_rsvp_post_id, 'post_tribe_rsvp_tickets', $trid, $job->language_code );
206
+ }
207
+
208
+ $event_id = get_post_meta( $rsvp_post_id, '_tribe_rsvp_for_event', true);
209
+
210
+ $translated_event_id = apply_filters( 'translate_object_id', $event_id, 'tribe_events', false, $job->language_code);
211
+ update_post_meta( $translated_rsvp_post_id, '_tribe_rsvp_for_event', $translated_event_id);
212
+
213
+ $this->sync_custom_fields( $rsvp_post_id, $translated_rsvp_post_id );
214
+
215
+ $this->save_ticket_meta_translations( $rsvp_post_id, $translated_rsvp_post_id );
216
+
217
+ }
218
+ }
219
+
220
+ public function append_woo_tickets_to_translation_job( $package, $post ){
221
+
222
+ if( $post->post_type == 'tribe_events' ){
223
+
224
+ $ticket_lang = $this->sitepress->get_language_for_element( $post->ID, 'post_tribe_events' );
225
+ $this->sitepress->switch_lang( $ticket_lang );
226
+ $ticket_ids = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance()->get_tickets_ids( $post->ID );
227
+ $this->sitepress->switch_lang();
228
+
229
+ if( $ticket_ids ){
230
+ foreach( $ticket_ids as $ticket_id ){
231
+
232
+ $ticket_post = get_post( $ticket_id );
233
+ $original_ticket_id = $this->sitepress->get_original_element_id( $ticket_id, 'post_product' );
234
+
235
+ if( !empty( $ticket_post->post_title ) ) {
236
+ $package['contents'][ 'woo_tickets_' . $original_ticket_id . '_title' ] = array(
237
+ 'translate' => 1,
238
+ 'data' => $this->tp->encode_field_data( $ticket_post->post_title, 'base64' ),
239
+ 'format' => 'base64',
240
+ );
241
+ }
242
+ if( !empty( $ticket_post->post_excerpt ) ) {
243
+ $package['contents'][ 'woo_tickets_' . $original_ticket_id . '_excerpt' ] = array(
244
+ 'translate' => 1,
245
+ 'data' => $this->tp->encode_field_data( $ticket_post->post_excerpt, 'base64' ),
246
+ 'format' => 'base64',
247
+ );
248
+ }
249
+
250
+ // fieldsets
251
+ $package = $this->append_tickets_meta( $package, $ticket_id, $original_ticket_id );
252
+
253
+ }
254
+ }
255
+
256
+ }
257
+
258
+ return $package;
259
+ }
260
+
261
+ public function save_woo_tickets_translations( $post_id, $data, $job ){
262
+ global $wpml_post_translations;
263
+
264
+ $translations = array();
265
+
266
+ foreach ( $data as $key => $value ) {
267
+
268
+ if ( preg_match( '/woo_tickets_([0-9]+)_title/', $key, $matches ) ) {
269
+ $ticket_post_id = $matches[1];
270
+ if( $value['finished'] == 'on' ){
271
+ $translations[ $ticket_post_id ]['post_title'] = $value['data'];
272
+ }
273
+ } elseif ( preg_match( '/woo_tickets_([0-9]+)_excerpt/', $key, $matches ) ) {
274
+ $ticket_post_id = $matches[1];
275
+ if( $value['finished'] == 'on' ){
276
+ $translations[ $ticket_post_id ]['post_excerpt'] = $value['data'];
277
+ }
278
+ }
279
+
280
+ }
281
+
282
+ foreach ( $translations as $ticket_post_id => $translation ){
283
+
284
+ $translated_ticket_post_id = apply_filters( 'translate_object_id', $ticket_post_id, 'product', false, $job->language_code );
285
+
286
+ $postarr = array(
287
+ 'post_type' => 'product',
288
+ 'post_status' => 'publish',
289
+ 'post_title' => $translation['post_title'],
290
+ 'post_excerpt' => $translation['post_excerpt'],
291
+ 'post_name' => sanitize_title_with_dashes( $translation['post_title'] )
292
+ );
293
+
294
+ remove_action( 'save_post', array( $wpml_post_translations, 'save_post_actions' ), 100, 2 );
295
+ if( $translated_ticket_post_id && $translated_ticket_post_id != $ticket_post_id ){
296
+ $postarr['ID'] = $translated_ticket_post_id;
297
+ wp_update_post( $postarr );
298
+ } else{
299
+ $translated_ticket_post_id = wp_insert_post( $postarr );
300
+ $trid = $this->sitepress->get_element_trid( $ticket_post_id, 'post_product' );
301
+ $this->sitepress->set_element_language_details( $translated_ticket_post_id, 'post_product', $trid, $job->language_code );
302
+ }
303
+ add_action( 'save_post', array( $wpml_post_translations, 'save_post_actions' ), 100, 2 );
304
+
305
+ $event_id = get_post_meta( $ticket_post_id, '_tribe_wooticket_for_event', true);
306
+
307
+ $translated_event_id = apply_filters( 'translate_object_id', $event_id, 'tribe_events', false, $job->language_code);
308
+ update_post_meta( $translated_ticket_post_id, '_tribe_wooticket_for_event', $translated_event_id);
309
+
310
+ $this->sync_custom_fields( $ticket_post_id, $translated_ticket_post_id );
311
+
312
+ $this->save_ticket_meta_translations( $ticket_post_id, $translated_ticket_post_id );
313
+
314
+ }
315
+ }
316
+
317
+ private function append_tickets_meta( $package, $ticket_id, $original_ticket_id ){
318
+
319
+ $ticket_meta = get_post_meta( $ticket_id, '_tribe_tickets_meta', true );
320
+ if( is_array( $ticket_meta ) ) {
321
+ foreach ( $ticket_meta as $k => $meta ) {
322
+ $package['contents'][ 'rsvp_tickets_' . $original_ticket_id . '_meta_' . $k . '_label' ] = array(
323
+ 'translate' => 1,
324
+ 'data' => $this->tp->encode_field_data( $meta['label'], 'base64' ),
325
+ 'format' => 'base64',
326
+ );
327
+ $package['contents'][ 'rsvp_tickets_' . $original_ticket_id . '_meta_' . $k . '_slug' ] = array(
328
+ 'translate' => 1,
329
+ 'data' => $this->tp->encode_field_data( $meta['slug'], 'base64' ),
330
+ 'format' => 'base64',
331
+ );
332
+ if ( isset( $meta['extra']['options'] ) ) {
333
+ foreach ( $meta['extra']['options'] as $option_id => $option_name ) {
334
+
335
+ $package['contents'][ 'rsvp_tickets_' . $original_ticket_id . '_meta_' . $k . '_option_' . $option_id ] = array(
336
+ 'translate' => 1,
337
+ 'data' => $this->tp->encode_field_data( $option_name, 'base64' ),
338
+ 'format' => 'base64',
339
+ );
340
+
341
+ }
342
+
343
+ }
344
+ }
345
+ }
346
+
347
+ return $package;
348
+ }
349
+
350
+ private function save_ticket_meta_translations( $ticket_id, $translated_ticket_id ){
351
+
352
+ $ticket_meta = get_post_meta( $ticket_id, '_tribe_tickets_meta', true );
353
+ $translated_ticket_meta = $ticket_meta;
354
+ if( is_array( $ticket_meta ) ){
355
+
356
+ foreach ( $ticket_meta as $k => $meta ) {
357
+
358
+ $key = 'rsvp_tickets_' . $ticket_id . '_meta_' . $k . '_label';
359
+ if( isset( $data[$key] ) && $data[$key]['finished'] == 'on' ){
360
+ $translated_ticket_meta[$k]['label'] = $data[$key]['data'];
361
+ }
362
+
363
+ $key = 'rsvp_tickets_' . $ticket_id . '_meta_' . $k . '_slug';
364
+ if( isset( $data[$key] ) && $data[$key]['finished'] == 'on' ){
365
+ $translated_ticket_meta[$k]['slug'] = $data[$key]['data'];
366
+ }
367
+
368
+ if ( isset( $meta['extra']['options'] ) ) {
369
+ foreach ( $meta['extra']['options'] as $option_id => $option_name ) {
370
+ $key = 'rsvp_tickets_' . $ticket_id . '_meta_' . $k . '_option_' . $option_id;
371
+ if( isset( $data[$key] ) && $data[$key]['finished'] == 'on' ){
372
+ $translated_ticket_meta[$k]['extra']['options'][$option_id] = $data[$key]['data'];
373
+ }
374
+ }
375
+ }
376
+
377
+ }
378
+
379
+ }
380
+
381
+ update_post_meta( $translated_ticket_id, '_tribe_tickets_meta', $translated_ticket_meta );
382
+
383
+ update_post_meta( $translated_ticket_id, '_tribe_tickets_meta_enabled',
384
+ get_post_meta( $ticket_id, '_tribe_tickets_meta_enabled', true )
385
+ );
386
+
387
+
388
+ }
389
+
390
+ private function sync_custom_fields( $original_ticket_id, $translated_ticket_id ){
391
+ // sync custom fields
392
+ $custom_fields_sync = array( '_stock', '_manage_stock', 'total_sales', '_price' );
393
+ foreach( $custom_fields_sync as $custom_field ){
394
+ $value = get_post_meta( $original_ticket_id, $custom_field, true );
395
+ if( $value !== false ){
396
+ update_post_meta( $translated_ticket_id, $custom_field, $value);
397
+ }
398
+ }
399
+ }
400
+
401
+ public function synchronize_venue_for_event( $post_id, $post, $update ){
402
+
403
+ if( $post->post_type == 'tribe_event' ){
404
+
405
+ $venue_id = get_post_meta( $post_id, '_EventVenueID', true );
406
+
407
+ $original_event_id = $this->sitepress->get_original_element_id( $post_id, 'post_tribe_event' );
408
+
409
+ if( $original_event_id == $post_id ) {
410
+ $event_trid = $this->sitepress->get_element_trid( $post_id, 'post_tribe_venue' );
411
+ $event_translations = $this->sitepress->get_element_translations( $event_trid, 'post_tribe_venue' );
412
+
413
+ if ( $venue_id ) {
414
+ foreach ( $event_translations as $language_code => $event_translation ) {
415
+ if ( $event_translation->element_id != $original_event_id ) {
416
+ $translated_venue_id = apply_filters( 'translate_object_id', $venue_id, 'tribe_venue', false, $language_code );
417
+ if ( $translated_venue_id ) {
418
+ update_post_meta( $event_translation->element_id, '_EventVenueID', $translated_venue_id );
419
+ }
420
+ }
421
+ }
422
+ } else { // delete venue from translations
423
+ foreach ( $event_translations as $language_code => $event_translation ) {
424
+ if ( $event_translation->element_id != $original_event_id ) {
425
+ delete_post_meta( $event_translation->element_id, '_EventVenueID' );
426
+ }
427
+ }
428
+ }
429
+
430
+ }
431
+
432
+ }
433
+
434
+ }
435
+
436
+ public function pre_select_translated_venue(){
437
+ $current_screen = get_current_screen();
438
+ if( $current_screen->base === 'post' && $current_screen->action === 'add' && $current_screen->id === 'tribe_events' ){
439
+ if( isset( $_GET['trid'] ) && isset( $_GET['lang'] ) && isset( $_GET['source_lang'] ) ){
440
+ $event_translations = $this->sitepress->get_element_translations( $_GET['trid'], 'post_tribe_events' );
441
+ $original_event_id = $event_translations[ $_GET['source_lang'] ]->element_id;
442
+ $original_venue_id = get_post_meta( $original_event_id, '_EventVenueID', true );
443
+ if( $original_venue_id ){
444
+ $translated_venue_id = apply_filters( 'translate_object_id', $original_venue_id, 'tribe_venue', false, $_GET['lang'] );
445
+ if( $translated_venue_id ){
446
+ echo "<script type=\"text/javascript\">
447
+ jQuery('#saved_tribe_venue').val($translated_venue_id);
448
+ </script>";
449
+ }
450
+ }
451
+ }
452
+ }
453
+ }
454
+
455
+ public function save_venue_for_translation( $post_id, $data, $job ){
456
+
457
+ $original_event_id = $this->sitepress->get_original_element_id( $post_id, 'post_tribe_event' );
458
+ $original_venue_id = get_post_meta( $original_event_id, '_EventVenueID', true );
459
+
460
+ if( $original_venue_id ){
461
+ $translated_venue_id = apply_filters( 'translate_object_id', $original_venue_id, 'tribe_venue', false, $job->language_code );
462
+ if( $translated_venue_id ){
463
+ update_post_meta( $post_id, '_EventVenueID', $translated_venue_id );
464
+ }
465
+
466
+ }
467
+
468
+ }
469
+
470
+ public function sync_rsvp_fields_on_attendee_created( $order_id, $post_id, $attendee_order_status ){
471
+
472
+ $rsvp_post_id = isset( $_POST['product_id'][0] ) ? $_POST['product_id'][0] : false;
473
+ if( $rsvp_post_id ) {
474
+ $rsvp_trid = $this->sitepress->get_element_trid( $rsvp_post_id, 'post_tribe_rsvp_tickets' );
475
+ $rsvp_translations = $this->sitepress->get_element_translations( $rsvp_trid, 'post_tribe_rsvp_tickets' );
476
+
477
+ foreach ( $rsvp_translations as $translation ) {
478
+ if ( $translation->element_id != $rsvp_post_id ) {
479
+ $this->sync_custom_fields( $rsvp_post_id, $translation->element_id );
480
+ }
481
+ }
482
+ }
483
+ }
484
+
485
+ public function get_translated_organizer_ids( $organizer_ids, $event_id ){
486
+ foreach( $organizer_ids as $key => $organizer_id ){
487
+ $organizer_ids[$key] = apply_filters( 'translate_object_id', $organizer_id, 'tribe_organizer', true );
488
+ }
489
+ return $organizer_ids;
490
+ }
491
+ }
492
+
compatibility/includes/class-wcml-wc-product-bundles-items.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WCML_WC_Product_Bundles_Items{
4
+
5
+ /**
6
+ * @param int
7
+ *
8
+ * @return array
9
+ */
10
+ public function get_items( $product_id ){
11
+
12
+ $items = array();
13
+ $product_bundle = new WC_Product_Bundle( $product_id );
14
+ if( $product_bundle ){
15
+ $items = $product_bundle->get_bundled_items();
16
+ }
17
+ return $items;
18
+
19
+ }
20
+
21
+ /**
22
+ * @param WC_Bundled_Item
23
+ *
24
+ * @return array
25
+ */
26
+ function get_item_data( $bundled_item ){
27
+ return $bundled_item->get_data();
28
+ }
29
+
30
+ function copy_item_data( $item_id_1, $item_id_2 ){
31
+
32
+ $item_1_data = $this->get_item_data_object( $item_id_1 );
33
+ $item_2_data = $this->get_item_data_object( $item_id_2 );
34
+
35
+ $meta_data = $item_1_data->get_meta_data();
36
+
37
+ foreach( $meta_data as $key => $value ){
38
+ $item_2_data->update_meta( $key, $value );
39
+ }
40
+
41
+ $item_2_data->save();
42
+ }
43
+
44
+ /**
45
+ * @param int
46
+ *
47
+ * @return WC_Bundled_Item_Data
48
+ */
49
+ function get_item_data_object( $item_id ){
50
+ return new WC_Bundled_Item_Data( $item_id );
51
+ }
52
+
53
+ /**
54
+ * @param WC_Bundled_Item_Data
55
+ * @param string
56
+ * @param mixed
57
+ *
58
+ */
59
+ public function update_item_meta( $bundled_item_data, $key, $value ){
60
+ $bundled_item_data->update_meta($key, $value );
61
+ }
62
+
63
+ /**
64
+ * @param WC_Bundled_Item_Data
65
+ *
66
+ */
67
+ public function save_item_meta( $bundled_item_data ){
68
+ $bundled_item_data->save();
69
+ }
70
+
71
+
72
+ }
73
+
74
+
compatibility/res/css/wcml-bookings.css CHANGED
@@ -59,3 +59,7 @@ input.wcml_bookings_custom_price,
59
  #bookings_pricing .table_grid table td input.wcml_bookings_custom_price{
60
  background-color: #F5F2E1;
61
  }
 
 
 
 
59
  #bookings_pricing .table_grid table td input.wcml_bookings_custom_price{
60
  background-color: #F5F2E1;
61
  }
62
+ #bookings_pricing #wcml_custom_costs_manually{
63
+ clear: both;
64
+ margin-bottom: 20px;
65
+ }
inc/admin-menus/class-wcml-setup.php CHANGED
@@ -118,7 +118,7 @@ class WCML_Setup {
118
  }
119
 
120
  if ( ! current_user_can( 'manage_options' ) ) {
121
- wp_die( __( 'Cheatin&#8217; huh?', 'woocommerce' ) );
122
  }
123
 
124
  $this->complete_setup();
118
  }
119
 
120
  if ( ! current_user_can( 'manage_options' ) ) {
121
+ wp_die( esc_html__( "Cheatin' huh?", 'woocommerce' ) );
122
  }
123
 
124
  $this->complete_setup();
inc/class-wcml-attributes.php CHANGED
@@ -15,11 +15,20 @@ class WCML_Attributes{
15
 
16
  add_action( 'woocommerce_attribute_added', array( $this, 'set_attribute_readonly_config' ), 100, 2 );
17
  add_filter( 'wpml_translation_job_post_meta_value_translated', array($this, 'filter_product_attributes_for_translation'), 10, 2 );
 
18
 
19
  if( isset( $_POST['icl_ajx_action'] ) && $_POST['icl_ajx_action'] == 'icl_custom_tax_sync_options' ){
20
  $this->icl_custom_tax_sync_options();
21
  }
22
 
 
 
 
 
 
 
 
 
23
  }
24
 
25
  public function init(){
@@ -37,6 +46,19 @@ class WCML_Attributes{
37
 
38
  }
39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  public function not_translatable_html(){
41
  $attr_id = isset( $_GET[ 'edit' ] ) ? absint( $_GET[ 'edit' ] ) : false;
42
 
@@ -244,12 +266,17 @@ class WCML_Attributes{
244
  return $attributes;
245
  }
246
 
247
- public function get_attr_label_translations( $product_id ){
248
  $trnsl_labels = get_post_meta( $product_id, 'attr_label_translations', true );
 
249
  if( !is_array( $trnsl_labels ) ){
250
  $trnsl_labels = array();
251
  }
252
 
 
 
 
 
253
  return $trnsl_labels;
254
  }
255
 
@@ -460,4 +487,49 @@ class WCML_Attributes{
460
  );
461
  }
462
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
463
  }
15
 
16
  add_action( 'woocommerce_attribute_added', array( $this, 'set_attribute_readonly_config' ), 100, 2 );
17
  add_filter( 'wpml_translation_job_post_meta_value_translated', array($this, 'filter_product_attributes_for_translation'), 10, 2 );
18
+ add_filter( 'woocommerce_dropdown_variation_attribute_options_args', array($this, 'filter_dropdown_variation_attribute_options_args') );
19
 
20
  if( isset( $_POST['icl_ajx_action'] ) && $_POST['icl_ajx_action'] == 'icl_custom_tax_sync_options' ){
21
  $this->icl_custom_tax_sync_options();
22
  }
23
 
24
+ add_action( 'woocommerce_before_attribute_delete', array( $this, 'refresh_taxonomy_translations_cache' ), 10, 3 );
25
+
26
+ if( ( defined('WC_VERSION') && version_compare( WC_VERSION , '2.7', '<' ) ) ){
27
+ add_filter( 'woocommerce_get_product_attributes', array( $this, 'filter_adding_to_cart_product_attributes_names' ) );
28
+ }else{
29
+ add_filter( 'woocommerce_product_get_attributes', array( $this, 'filter_adding_to_cart_product_attributes_names' ) );
30
+ }
31
+
32
  }
33
 
34
  public function init(){
46
 
47
  }
48
 
49
+ /*
50
+ * This creates the terms translation cache so the translations can be deleted via the 'delete_term' hook
51
+ * after the original term was deleted and getting the translations directly from the db is not possible
52
+ */
53
+ public function refresh_taxonomy_translations_cache( $attribute_id, $attribute_name, $taxonomy ){
54
+
55
+ $terms = get_terms( $taxonomy, 'orderby=name&hide_empty=0' );
56
+ foreach ( $terms as $term ) {
57
+ $trid = $this->sitepress->get_element_trid( $term->term_taxonomy_id, 'tax_' . $taxonomy );
58
+ }
59
+
60
+ }
61
+
62
  public function not_translatable_html(){
63
  $attr_id = isset( $_GET[ 'edit' ] ) ? absint( $_GET[ 'edit' ] ) : false;
64
 
266
  return $attributes;
267
  }
268
 
269
+ public function get_attr_label_translations( $product_id, $lang = false ){
270
  $trnsl_labels = get_post_meta( $product_id, 'attr_label_translations', true );
271
+
272
  if( !is_array( $trnsl_labels ) ){
273
  $trnsl_labels = array();
274
  }
275
 
276
+ if( isset( $trnsl_labels[ $lang ] ) ){
277
+ return $trnsl_labels[ $lang ];
278
+ }
279
+
280
  return $trnsl_labels;
281
  }
282
 
487
  );
488
  }
489
 
490
+ function filter_dropdown_variation_attribute_options_args( $args ){
491
+
492
+ if( isset( $args['attribute'] ) && isset( $args['product'] ) ){
493
+ $args['attribute'] = $this->filter_attribute_name( $args['attribute'], WooCommerce_Functions_Wrapper::get_product_id( $args['product'] ) );
494
+ }
495
+
496
+ return $args;
497
+ }
498
+
499
+ /*
500
+ * special case when original attribute language is German or Danish,
501
+ * needs handle special chars accordingly
502
+ * https://onthegosystems.myjetbrains.com/youtrack/issue/wcml-1785
503
+ */
504
+ function filter_attribute_name( $attribute_name, $product_id, $return_sanitized = false ){
505
+
506
+ if( !is_admin() && $product_id ) {
507
+ $orig_lang = $this->woocommerce_wpml->products->get_original_product_language( $product_id );
508
+ if ( in_array( $orig_lang, array('de', 'da' ) ) ) {
509
+ $attribute_name = $this->sitepress->locale_utils->filter_sanitize_title( remove_accents( $attribute_name ), $attribute_name );
510
+ remove_filter( 'sanitize_title', array( $this->sitepress->locale_utils, 'filter_sanitize_title' ), 10 );
511
+ return $attribute_name;
512
+ }
513
+ }
514
+
515
+ if( $return_sanitized ){
516
+ $attribute_name = sanitize_title( $attribute_name );
517
+ }
518
+
519
+ return $attribute_name;
520
+ }
521
+
522
+ function filter_adding_to_cart_product_attributes_names( $attributes ){
523
+
524
+ if( !is_admin() && isset( $_REQUEST['add-to-cart'] ) ){
525
+
526
+ foreach( $attributes as $key => $attribute ){
527
+ $attributes[ $key ]['name'] = $this->filter_attribute_name( $attributes[ $key ]['name'], $_REQUEST['add-to-cart'] );
528
+ }
529
+
530
+ }
531
+
532
+ return $attributes;
533
+ }
534
+
535
  }
inc/class-wcml-cart.php CHANGED
@@ -341,13 +341,18 @@ class WCML_Cart
341
  }
342
 
343
  public function translate_cart_contents( $item ) {
 
344
  // translate the product id and product data
345
  $item[ 'product_id' ] = apply_filters( 'translate_object_id', $item[ 'product_id' ], 'product', true );
346
  if ($item[ 'variation_id' ]) {
347
  $item[ 'variation_id' ] = apply_filters( 'translate_object_id',$item[ 'variation_id' ], 'product_variation', true );
348
  }
349
- $product_id = $item[ 'variation_id' ] ? $item[ 'variation_id' ] : $item[ 'product_id' ];
350
- $item[ 'data' ]->post->post_title = get_the_title( $product_id );
 
 
 
 
351
 
352
  return $item;
353
  }
@@ -432,7 +437,7 @@ class WCML_Cart
432
  foreach( WC()->cart->cart_contents as $cart_item ){
433
  $cart_element_trid = $this->sitepress->get_element_trid( $cart_item[ 'product_id' ], 'post_product' );
434
  if( apply_filters( 'wcml_add_to_cart_sold_individually', true, $cart_item_data, $product_id, $quantity ) && $current_product_trid == $cart_element_trid && $cart_item[ 'quantity' ] > 0 ){
435
- throw new Exception( sprintf( '<a href="%s" class="button wc-forward">%s</a> %s', wc_get_cart_url(), __( 'View cart', 'woocommerce' ), sprintf( __( 'You cannot add another "%s" to your cart.', 'woocommerce' ), get_the_title( $product_id ) ) ) );
436
  }
437
  }
438
 
341
  }
342
 
343
  public function translate_cart_contents( $item ) {
344
+
345
  // translate the product id and product data
346
  $item[ 'product_id' ] = apply_filters( 'translate_object_id', $item[ 'product_id' ], 'product', true );
347
  if ($item[ 'variation_id' ]) {
348
  $item[ 'variation_id' ] = apply_filters( 'translate_object_id',$item[ 'variation_id' ], 'product_variation', true );
349
  }
350
+
351
+ if( version_compare( WC()->version, '2.7', '>=' ) ){
352
+ $item[ 'data' ]->set_name( get_the_title( $item[ 'product_id' ] ) );
353
+ } else {
354
+ $item[ 'data' ]->post->post_title = get_the_title( $item[ 'product_id' ] );
355
+ }
356
 
357
  return $item;
358
  }
437
  foreach( WC()->cart->cart_contents as $cart_item ){
438
  $cart_element_trid = $this->sitepress->get_element_trid( $cart_item[ 'product_id' ], 'post_product' );
439
  if( apply_filters( 'wcml_add_to_cart_sold_individually', true, $cart_item_data, $product_id, $quantity ) && $current_product_trid == $cart_element_trid && $cart_item[ 'quantity' ] > 0 ){
440
+ throw new Exception( sprintf( '<a href="%s" class="button wc-forward">%s</a> %s', esc_url( wc_get_cart_url() ), __( 'View Cart', 'woocommerce' ), sprintf( __( 'You cannot add another &quot;%s&quot; to your cart.', 'woocommerce' ), get_the_title( $product_id ) ) ) );
441
  }
442
  }
443
 
inc/class-wcml-compatibility.php CHANGED
@@ -51,7 +51,12 @@ class WCML_Compatibility {
51
 
52
  //Product Bundle
53
  if(class_exists('WC_Product_Bundle')){
54
- $this->product_bundles = new WCML_Product_Bundles( $this->sitepress, $this->woocommerce_wpml );
 
 
 
 
 
55
  }
56
 
57
  // WooCommerce Variation Swatches and Photos
@@ -170,6 +175,11 @@ class WCML_Compatibility {
170
  $this->pip = new WCML_Pip();
171
  }
172
 
 
 
 
 
 
173
 
174
  }
175
 
51
 
52
  //Product Bundle
53
  if(class_exists('WC_Product_Bundle')){
54
+ if( version_compare( WC_PB()->version, '5.0.0', '<' ) ){
55
+ $this->product_bundles = new WCML_Product_Bundles_Legacy( $this->sitepress, $this->woocommerce_wpml );
56
+ }else{
57
+ $product_bundle_items = new WCML_WC_Product_Bundles_Items();
58
+ $this->product_bundles = new WCML_Product_Bundles( $this->sitepress, $this->woocommerce_wpml, $product_bundle_items );
59
+ }
60
  }
61
 
62
  // WooCommerce Variation Swatches and Photos
175
  $this->pip = new WCML_Pip();
176
  }
177
 
178
+ // The Events Calendar
179
+ if( class_exists( 'Tribe__Events__Main' ) ){
180
+ new WCML_The_Events_Calendar( $this->sitepress, $this->woocommerce_wpml );
181
+ }
182
+
183
 
184
  }
185
 
inc/class-wcml-emails.php CHANGED
@@ -43,7 +43,6 @@ class WCML_Emails{
43
  add_action('woocommerce_order_partially_refunded_notification', array($this,'email_heading_refund'), 9);
44
  add_action('woocommerce_order_partially_refunded_notification', array($this,'refresh_email_lang'), 9);
45
 
46
-
47
  //new order admins email
48
  add_action( 'woocommerce_order_status_pending_to_processing_notification', array( $this, 'new_order_admin_email' ), 9 );
49
  add_action( 'woocommerce_order_status_pending_to_completed_notification', array( $this, 'new_order_admin_email' ), 9 );
@@ -56,7 +55,7 @@ class WCML_Emails{
56
  add_filter( 'icl_st_admin_string_return_cached', array( $this, 'admin_string_return_cached' ), 10, 2 );
57
 
58
  add_filter( 'plugin_locale', array( $this, 'set_locale_for_emails' ), 10, 2 );
59
-
60
 
61
  if( is_admin() && $pagenow == 'admin.php' && isset($_GET['page']) && $_GET['page'] == 'wc-settings' && isset($_GET['tab']) && $_GET['tab'] == 'email' ){
62
  add_action('admin_footer', array($this, 'show_language_links_for_wc_emails'));
@@ -105,7 +104,7 @@ class WCML_Emails{
105
  if( is_array( $order ) ) {
106
  $order = $order[ 'order_id' ];
107
  } elseif( is_object( $order ) ) {
108
- $order = $order->id;
109
  }
110
 
111
  $this->refresh_email_lang( $order );
@@ -486,4 +485,14 @@ class WCML_Emails{
486
  }
487
  }
488
 
 
 
 
 
 
 
 
 
 
 
489
  }
43
  add_action('woocommerce_order_partially_refunded_notification', array($this,'email_heading_refund'), 9);
44
  add_action('woocommerce_order_partially_refunded_notification', array($this,'refresh_email_lang'), 9);
45
 
 
46
  //new order admins email
47
  add_action( 'woocommerce_order_status_pending_to_processing_notification', array( $this, 'new_order_admin_email' ), 9 );
48
  add_action( 'woocommerce_order_status_pending_to_completed_notification', array( $this, 'new_order_admin_email' ), 9 );
55
  add_filter( 'icl_st_admin_string_return_cached', array( $this, 'admin_string_return_cached' ), 10, 2 );
56
 
57
  add_filter( 'plugin_locale', array( $this, 'set_locale_for_emails' ), 10, 2 );
58
+ add_filter( 'woocommerce_countries', array( $this, 'translate_woocommerce_countries' ) );
59
 
60
  if( is_admin() && $pagenow == 'admin.php' && isset($_GET['page']) && $_GET['page'] == 'wc-settings' && isset($_GET['tab']) && $_GET['tab'] == 'email' ){
61
  add_action('admin_footer', array($this, 'show_language_links_for_wc_emails'));
104
  if( is_array( $order ) ) {
105
  $order = $order[ 'order_id' ];
106
  } elseif( is_object( $order ) ) {
107
+ $order = method_exists( 'WC_Order', 'get_id' ) ? $order->get_id() : $order->id;
108
  }
109
 
110
  $this->refresh_email_lang( $order );
485
  }
486
  }
487
 
488
+ function translate_woocommerce_countries( $countries ){
489
+
490
+ if( isset( $_POST[ 'wc_order_action' ] ) && $_POST[ 'wc_order_action' ] !== 'send_email_new_order' && isset( $_POST[ 'post_ID' ] ) ){
491
+ $this->refresh_email_lang( $_POST[ 'post_ID' ] );
492
+ $countries = include( WC()->plugin_path() . '/i18n/countries.php' );
493
+ }
494
+
495
+ return $countries;
496
+ }
497
+
498
  }
inc/class-wcml-endpoints.php CHANGED
@@ -2,10 +2,13 @@
2
 
3
  class WCML_Endpoints{
4
 
 
 
5
  var $endpoints_strings = array();
6
 
7
- function __construct(){
8
 
 
9
  add_action( 'icl_ajx_custom_call', array( $this, 'rewrite_rule_endpoints' ), 11, 2 );
10
  add_action( 'woocommerce_update_options', array( $this, 'add_endpoints' ) );
11
  add_filter( 'pre_update_option_rewrite_rules', array( $this, 'update_rewrite_rules' ), 100, 2 );
@@ -16,8 +19,6 @@ class WCML_Endpoints{
16
  //endpoints hooks
17
  $this->maybe_flush_rules();
18
  $this->register_endpoints_translations();
19
-
20
-
21
  add_filter('pre_get_posts', array($this, 'check_if_endpoint_exists'));
22
  }
23
 
@@ -107,9 +108,12 @@ class WCML_Endpoints{
107
 
108
  function maybe_flush_rules(){
109
  if( get_option( 'flush_rules_for_endpoints_translations' ) ){
 
110
  WC()->query->init_query_vars();
111
  WC()->query->add_endpoints();
112
- flush_rewrite_rules();
 
 
113
  delete_option( 'flush_rules_for_endpoints_translations' );
114
  }
115
  }
2
 
3
  class WCML_Endpoints{
4
 
5
+ /** @var woocommerce_wpml */
6
+ private $woocommerce_wpml;
7
  var $endpoints_strings = array();
8
 
9
+ function __construct( $woocommerce_wpml ){
10
 
11
+ $this->woocommerce_wpml =& $woocommerce_wpml;
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 );
19
  //endpoints hooks
20
  $this->maybe_flush_rules();
21
  $this->register_endpoints_translations();
 
 
22
  add_filter('pre_get_posts', array($this, 'check_if_endpoint_exists'));
23
  }
24
 
108
 
109
  function maybe_flush_rules(){
110
  if( get_option( 'flush_rules_for_endpoints_translations' ) ){
111
+ delete_option( 'flush_rules_for_endpoints_translations' );
112
  WC()->query->init_query_vars();
113
  WC()->query->add_endpoints();
114
+ remove_filter( 'gettext_with_context', array( $this->woocommerce_wpml->strings, 'category_base_in_strings_language' ), 99, 3 );
115
+ flush_rewrite_rules( false );
116
+ add_filter( 'gettext_with_context', array( $this->woocommerce_wpml->strings, 'category_base_in_strings_language' ), 99, 3 );
117
  delete_option( 'flush_rules_for_endpoints_translations' );
118
  }
119
  }
inc/class-wcml-install.php CHANGED
@@ -221,10 +221,12 @@ class WCML_Install{
221
  ?>
222
  <div id="message" class="updated message fade otgs-is-dismissible">
223
  <p>
224
- <?php printf(__("You've successfully installed %sWooCommerce Multilingual%s. Would you like to see a quick overview?", 'woocommerce-multilingual'), '<strong>', '</strong>'); ?>
 
225
  </p>
226
  <p>
227
- <a class="button-primary align-right" href="<?php echo WCML_Links::generate_tracking_link('https://wpml.org/documentation/related-projects/woocommerce-multilingual/','woocommerce-multilingual','documentation'); ?>" target="_blank">
 
228
  <?php _e('Learn how to turn your e-commerce site multilingual', 'woocommerce-multilingual') ?>
229
  </a>
230
  </p>
221
  ?>
222
  <div id="message" class="updated message fade otgs-is-dismissible">
223
  <p>
224
+ <?php printf( esc_html__( "You've successfully installed %sWooCommerce Multilingual%s. Would you like to see a quick overview?", 'woocommerce-multilingual' ),
225
+ '<strong>', '</strong>' ); ?>
226
  </p>
227
  <p>
228
+ <a class="button-primary align-right" href="<?php echo esc_url( WCML_Links::generate_tracking_link(
229
+ 'https://wpml.org/documentation/related-projects/woocommerce-multilingual/','woocommerce-multilingual','documentation') ); ?>" target="_blank">
230
  <?php _e('Learn how to turn your e-commerce site multilingual', 'woocommerce-multilingual') ?>
231
  </a>
232
  </p>
inc/class-wcml-languages-upgrader.php CHANGED
@@ -292,7 +292,7 @@ class WCML_Languages_Upgrader{
292
 
293
  wp_localize_script( 'wcml-lang-notice', 'wcml_settings',
294
  array(
295
- 'warn' => __( "Downloading translations... Please don't close this page.", 'woocommerce-multilingual' )
296
  )
297
  );
298
 
292
 
293
  wp_localize_script( 'wcml-lang-notice', 'wcml_settings',
294
  array(
295
+ 'warn' => esc_html__( "Downloading translations... Please don't close this page.", 'woocommerce-multilingual' )
296
  )
297
  );
298
 
inc/class-wcml-orders.php CHANGED
@@ -245,7 +245,6 @@ class WCML_Orders{
245
  $taxonomy = substr( $key, 0, 3 ) != 'pa_' ? wc_attribute_taxonomy_name( $key ) : $key;
246
  $term_id = $woocommerce_wpml->terms->wcml_get_term_id_by_slug( $taxonomy, $value );
247
  $translated_term = $woocommerce_wpml->terms->wcml_get_translated_term( $term_id, $taxonomy, $languge );
248
- $translated_term = $woocommerce_wpml->terms->wcml_get_translated_term( $term_id, $taxonomy, $languge );
249
 
250
  if( $translated_term ){
251
  $value = $translated_term->slug;
245
  $taxonomy = substr( $key, 0, 3 ) != 'pa_' ? wc_attribute_taxonomy_name( $key ) : $key;
246
  $term_id = $woocommerce_wpml->terms->wcml_get_term_id_by_slug( $taxonomy, $value );
247
  $translated_term = $woocommerce_wpml->terms->wcml_get_translated_term( $term_id, $taxonomy, $languge );
 
248
 
249
  if( $translated_term ){
250
  $value = $translated_term->slug;
inc/class-wcml-products.php CHANGED
@@ -63,8 +63,8 @@ class WCML_Products{
63
  $this->wpdb->prepare(
64
  "SELECT source_language_code IS NULL
65
  FROM {$this->wpdb->prefix}icl_translations
66
- WHERE element_id=%d AND element_type='post_product'",
67
- $product_id )
68
  );
69
 
70
  wp_cache_set( $cache_key, $is_original, $cache_group );
63
  $this->wpdb->prepare(
64
  "SELECT source_language_code IS NULL
65
  FROM {$this->wpdb->prefix}icl_translations
66
+ WHERE element_id=%d AND element_type=%s",
67
+ $product_id, 'post_'.get_post_type( $product_id ) )
68
  );
69
 
70
  wp_cache_set( $cache_key, $is_original, $cache_group );
inc/class-wcml-resources.php CHANGED
@@ -44,15 +44,17 @@ class WCML_Resources {
44
  wp_register_style( 'wcml-dialogs', WCML_PLUGIN_URL . '/res/css/dialogs.css', array('wpml-dialog'), WCML_VERSION );
45
  wp_enqueue_style( 'wcml-dialogs' );
46
  }
 
 
 
 
 
47
  }
48
 
49
  if ( self::$pagenow == 'options-permalink.php' ) {
50
  wp_register_style( 'wcml_op', WCML_PLUGIN_URL . '/res/css/options-permalink.css', null, WCML_VERSION );
51
  wp_enqueue_style( 'wcml_op' );
52
  }
53
-
54
- wp_register_style( 'wcml_admin', WCML_PLUGIN_URL . '/res/css/admin.css', array( 'wp-pointer' ), WCML_VERSION );
55
- wp_enqueue_style( 'wcml_admin' );
56
  }
57
 
58
  public static function load_management_css() {
@@ -62,31 +64,27 @@ class WCML_Resources {
62
 
63
  private static function load_js() {
64
 
65
- wp_register_script( 'wcml-scripts', WCML_PLUGIN_URL . '/res/js/scripts' . WCML_JS_MIN . '.js', array(
66
- 'jquery',
67
- 'jquery-ui-core',
68
- 'jquery-ui-resizable'
69
- ), WCML_VERSION );
70
-
71
- wp_enqueue_script(
72
- 'wcml-pointer',
73
- WCML_PLUGIN_URL . '/res/js/pointer' . WCML_JS_MIN . '.js',
74
- array( 'wp-pointer' ),
75
- WCML_VERSION,
76
- true
77
- );
78
-
79
- wp_register_script( 'wcml-front-scripts', WCML_PLUGIN_URL . '/res/js/front-scripts' . WCML_JS_MIN . '.js', array(
80
- 'jquery'
81
- ), WCML_VERSION );
82
- wp_enqueue_script( 'wcml-front-scripts' );
83
-
84
  if ( self::$is_wpml_wcml_page ) {
85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  wp_register_script( 'jquery-cookie', WCML_PLUGIN_URL . '/res/js/jquery.cookie' . WCML_JS_MIN . '.js', array('jquery'), WCML_VERSION );
87
  wp_register_script( 'wcml-dialogs', WCML_PLUGIN_URL . '/res/js/dialogs' . WCML_JS_MIN . '.js', array('jquery', 'jquery-ui-core', 'jquery-ui-dialog'), WCML_VERSION );
88
  wp_register_script( 'wcml-troubleshooting', WCML_PLUGIN_URL . '/res/js/troubleshooting' . WCML_JS_MIN . '.js', array('jquery'), WCML_VERSION );
89
 
 
90
  wp_enqueue_script( 'wcml-dialogs' );
91
  wp_enqueue_script( 'wcml-scripts' );
92
  wp_enqueue_script( 'jquery-cookie' );
@@ -106,9 +104,21 @@ class WCML_Resources {
106
  wp_enqueue_script( 'wpml_tm' );
107
  }
108
 
 
 
 
 
 
109
  if ( self::$page == 'wpml-wcml' && self::$tab == 'multi-currency' ) {
110
  wp_register_script( 'multi-currency', WCML_PLUGIN_URL . '/res/js/multi-currency' . WCML_JS_MIN . '.js', array('jquery', 'jquery-ui-sortable'), WCML_VERSION, true );
111
  wp_enqueue_script( 'multi-currency' );
 
 
 
 
 
 
 
112
  wp_register_script( 'exchange-rates', WCML_PLUGIN_URL . '/res/js/exchange-rates' . WCML_JS_MIN . '.js', array('jquery'), WCML_VERSION, true );
113
  wp_enqueue_script( 'exchange-rates' );
114
  }
@@ -123,7 +133,13 @@ class WCML_Resources {
123
  wp_enqueue_script( 'custom-taxonomies' );
124
  }
125
 
126
- if ( !is_admin() ) {
 
 
 
 
 
 
127
  $referer = isset( $_SERVER[ 'HTTP_REFERER' ] ) ? $_SERVER[ 'HTTP_REFERER' ] : '';
128
 
129
  wp_register_script( 'cart-widget', WCML_PLUGIN_URL . '/res/js/cart_widget' . WCML_JS_MIN . '.js', array('jquery'), WCML_VERSION );
@@ -132,7 +148,7 @@ class WCML_Resources {
132
  'is_lang_switched' => self::$sitepress->get_language_from_url( $referer ) != self::$sitepress->get_current_language() ? 1 : 0,
133
  'is_currency_switched' => isset( $_GET[ 'wcmlc' ] ) ? 1 : 0
134
  ) );
135
- } else {
136
  wp_register_script( 'wcml-messages', WCML_PLUGIN_URL . '/res/js/wcml-messages' . WCML_JS_MIN . '.js', array('jquery'), WCML_VERSION );
137
  wp_enqueue_script( 'wcml-messages' );
138
  }
@@ -182,14 +198,23 @@ class WCML_Resources {
182
  }
183
 
184
  public static function load_lock_fields_js() {
 
185
 
186
  wp_register_script( 'wcml-lock-script', WCML_PLUGIN_URL . '/res/js/lock_fields' . WCML_JS_MIN . '.js', array('jquery'), WCML_VERSION );
187
  wp_enqueue_script( 'wcml-lock-script' );
188
 
189
  $file_path_sync = self::$woocommerce_wpml->settings['file_path_sync'];
190
- if( isset( $_GET[ 'post' ] ) ){
191
- $original_language = self::$woocommerce_wpml->products->get_original_product_language( $_GET[ 'post' ] );
192
- $original_id = apply_filters( 'translate_object_id', $_GET[ 'post' ], 'product', true, $original_language );
 
 
 
 
 
 
 
 
193
  $custom_product_sync = get_post_meta( $original_id, 'wcml_sync_files', true );
194
  if( $custom_product_sync && $custom_product_sync == 'self' ) {
195
  $file_path_sync = false;
44
  wp_register_style( 'wcml-dialogs', WCML_PLUGIN_URL . '/res/css/dialogs.css', array('wpml-dialog'), WCML_VERSION );
45
  wp_enqueue_style( 'wcml-dialogs' );
46
  }
47
+
48
+ wp_register_style( 'wcml_admin', WCML_PLUGIN_URL . '/res/css/admin.css', array( 'wp-pointer' ), WCML_VERSION );
49
+ wp_enqueue_style( 'wcml_admin' );
50
+
51
+ wp_enqueue_style( 'wp-color-picker' );
52
  }
53
 
54
  if ( self::$pagenow == 'options-permalink.php' ) {
55
  wp_register_style( 'wcml_op', WCML_PLUGIN_URL . '/res/css/options-permalink.css', null, WCML_VERSION );
56
  wp_enqueue_style( 'wcml_op' );
57
  }
 
 
 
58
  }
59
 
60
  public static function load_management_css() {
64
 
65
  private static function load_js() {
66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  if ( self::$is_wpml_wcml_page ) {
68
 
69
+ wp_register_script( 'wcml-scripts', WCML_PLUGIN_URL . '/res/js/scripts' . WCML_JS_MIN . '.js', array(
70
+ 'jquery',
71
+ 'jquery-ui-core',
72
+ 'jquery-ui-resizable'
73
+ ), WCML_VERSION );
74
+
75
+ wp_enqueue_script(
76
+ 'wcml-pointer',
77
+ WCML_PLUGIN_URL . '/res/js/pointer' . WCML_JS_MIN . '.js',
78
+ array( 'wp-pointer' ),
79
+ WCML_VERSION,
80
+ true
81
+ );
82
+
83
  wp_register_script( 'jquery-cookie', WCML_PLUGIN_URL . '/res/js/jquery.cookie' . WCML_JS_MIN . '.js', array('jquery'), WCML_VERSION );
84
  wp_register_script( 'wcml-dialogs', WCML_PLUGIN_URL . '/res/js/dialogs' . WCML_JS_MIN . '.js', array('jquery', 'jquery-ui-core', 'jquery-ui-dialog'), WCML_VERSION );
85
  wp_register_script( 'wcml-troubleshooting', WCML_PLUGIN_URL . '/res/js/troubleshooting' . WCML_JS_MIN . '.js', array('jquery'), WCML_VERSION );
86
 
87
+ wp_enqueue_script( 'wp-color-picker');
88
  wp_enqueue_script( 'wcml-dialogs' );
89
  wp_enqueue_script( 'wcml-scripts' );
90
  wp_enqueue_script( 'jquery-cookie' );
104
  wp_enqueue_script( 'wpml_tm' );
105
  }
106
 
107
+ if ( self::$pagenow == 'widgets.php' ) {
108
+ wp_register_script( 'wcml_widgets', WCML_PLUGIN_URL . '/res/js/widgets' . WCML_JS_MIN . '.js', array('jquery'), WCML_VERSION );
109
+ wp_enqueue_script( 'wcml_widgets' );
110
+ }
111
+
112
  if ( self::$page == 'wpml-wcml' && self::$tab == 'multi-currency' ) {
113
  wp_register_script( 'multi-currency', WCML_PLUGIN_URL . '/res/js/multi-currency' . WCML_JS_MIN . '.js', array('jquery', 'jquery-ui-sortable'), WCML_VERSION, true );
114
  wp_enqueue_script( 'multi-currency' );
115
+
116
+ wp_register_script( 'currency-switcher-settings', WCML_PLUGIN_URL . '/res/js/currency-switcher-settings' . WCML_JS_MIN . '.js', array('jquery', 'jquery-ui-sortable'), WCML_VERSION, true );
117
+ wp_enqueue_script( 'currency-switcher-settings' );
118
+ wp_localize_script( 'currency-switcher-settings', 'settings', array(
119
+ 'pre_selected_colors' => WCML_Currency_Switcher_Options_Dialog::currency_switcher_pre_selected_colors()
120
+ ) );
121
+
122
  wp_register_script( 'exchange-rates', WCML_PLUGIN_URL . '/res/js/exchange-rates' . WCML_JS_MIN . '.js', array('jquery'), WCML_VERSION, true );
123
  wp_enqueue_script( 'exchange-rates' );
124
  }
133
  wp_enqueue_script( 'custom-taxonomies' );
134
  }
135
 
136
+ if ( !is_admin() && self::$pagenow != 'wp-login.php' ) {
137
+
138
+ wp_register_script( 'wcml-front-scripts', WCML_PLUGIN_URL . '/res/js/front-scripts' . WCML_JS_MIN . '.js', array(
139
+ 'jquery'
140
+ ), WCML_VERSION );
141
+ wp_enqueue_script( 'wcml-front-scripts' );
142
+
143
  $referer = isset( $_SERVER[ 'HTTP_REFERER' ] ) ? $_SERVER[ 'HTTP_REFERER' ] : '';
144
 
145
  wp_register_script( 'cart-widget', WCML_PLUGIN_URL . '/res/js/cart_widget' . WCML_JS_MIN . '.js', array('jquery'), WCML_VERSION );
148
  'is_lang_switched' => self::$sitepress->get_language_from_url( $referer ) != self::$sitepress->get_current_language() ? 1 : 0,
149
  'is_currency_switched' => isset( $_GET[ 'wcmlc' ] ) ? 1 : 0
150
  ) );
151
+ } elseif( is_admin() ) {
152
  wp_register_script( 'wcml-messages', WCML_PLUGIN_URL . '/res/js/wcml-messages' . WCML_JS_MIN . '.js', array('jquery'), WCML_VERSION );
153
  wp_enqueue_script( 'wcml-messages' );
154
  }
198
  }
199
 
200
  public static function load_lock_fields_js() {
201
+ global $pagenow;
202
 
203
  wp_register_script( 'wcml-lock-script', WCML_PLUGIN_URL . '/res/js/lock_fields' . WCML_JS_MIN . '.js', array('jquery'), WCML_VERSION );
204
  wp_enqueue_script( 'wcml-lock-script' );
205
 
206
  $file_path_sync = self::$woocommerce_wpml->settings['file_path_sync'];
207
+
208
+ $product_id = false;
209
+ if( $pagenow === 'post.php' && isset( $_GET['post'] ) ){
210
+ $product_id = $_GET['post'];
211
+ }elseif( isset( $_POST['product_id'] ) ){
212
+ $product_id = $_POST['product_id'];
213
+ }
214
+
215
+ if( $product_id ){
216
+ $original_language = self::$woocommerce_wpml->products->get_original_product_language( $product_id );
217
+ $original_id = apply_filters( 'translate_object_id', $product_id, 'product', true, $original_language );
218
  $custom_product_sync = get_post_meta( $original_id, 'wcml_sync_files', true );
219
  if( $custom_product_sync && $custom_product_sync == 'self' ) {
220
  $file_path_sync = false;
inc/class-wcml-terms.php CHANGED
@@ -45,6 +45,8 @@ class WCML_Terms{
45
 
46
  add_filter( 'woocommerce_get_product_terms', array( $this, 'get_product_terms_filter' ), 10, 4 );
47
  add_action( 'created_term_translation', array( $this, 'set_flag_to_sync'), 10, 3 );
 
 
48
  }
49
 
50
  function admin_menu_setup(){
@@ -965,4 +967,24 @@ class WCML_Terms{
965
  return $this->wcml_get_term_by_id( $term_id, $taxonomy );
966
  }
967
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
968
  }
45
 
46
  add_filter( 'woocommerce_get_product_terms', array( $this, 'get_product_terms_filter' ), 10, 4 );
47
  add_action( 'created_term_translation', array( $this, 'set_flag_to_sync'), 10, 3 );
48
+
49
+ add_action( 'updated_term_meta', array( $this, 'update_product_count_term'), 10, 4 );
50
  }
51
 
52
  function admin_menu_setup(){
967
  return $this->wcml_get_term_by_id( $term_id, $taxonomy );
968
  }
969
 
970
+ public function update_product_count_term( $meta_id, $object_id, $meta_key, $meta_value ){
971
+
972
+ remove_action( 'updated_term_meta', array( $this, 'update_product_count_term'), 10, 4 );
973
+
974
+ if( $meta_key === 'product_count_product_cat' ){
975
+
976
+ $trid = $this->sitepress->get_element_trid( $object_id, 'tax_product_cat' );
977
+ $translations = $this->sitepress->get_element_translations( $trid, 'tax_product_cat' );
978
+
979
+ if ($translations) foreach ( $translations as $translation ) {
980
+ if ( $translation->element_id != $object_id ) {
981
+ update_term_meta( $translation->element_id, $meta_key, $meta_value );
982
+ }
983
+ }
984
+
985
+ }
986
+
987
+ add_action( 'updated_term_meta', array( $this, 'update_product_count_term'), 10, 4 );
988
+ }
989
+
990
  }
inc/class-wcml-troubleshooting.php CHANGED
@@ -19,7 +19,7 @@ class WCML_Troubleshooting{
19
  }
20
 
21
  function wcml_count_products_with_variations(){
22
- return count(get_option('wcml_products_to_sync'));
23
  }
24
 
25
  function trbl_update_count(){
@@ -53,24 +53,15 @@ class WCML_Troubleshooting{
53
  }
54
 
55
  function wcml_count_products_for_gallery_sync(){
56
- global $wpdb;
57
- $all_products = $wpdb->get_results("SELECT p.ID FROM $wpdb->posts AS p LEFT JOIN {$wpdb->prefix}icl_translations AS tr ON tr.element_id = p.ID WHERE p.post_status = 'publish' AND p.post_type = 'product' AND tr.source_language_code is NULL");
58
- foreach($all_products as $key=>$product){
59
- if(get_post_meta($product->ID,'gallery_sync',true)){
60
- unset($all_products[$key]);
61
- }
62
- }
63
  return count($all_products);
64
  }
65
 
66
  function wcml_count_product_categories(){
67
- global $wpdb;
68
- $get_product_categories = $wpdb->get_results("SELECT t.term_taxonomy_id FROM $wpdb->term_taxonomy AS t LEFT JOIN {$wpdb->prefix}icl_translations AS tr ON tr.element_id = t.term_taxonomy_id WHERE t.taxonomy = 'product_cat' AND tr.element_type = 'tax_product_cat' AND tr.source_language_code is NULL");
69
- foreach($get_product_categories as $key=>$get_product_category){
70
- if(get_option('wcml_sync_category_'.$get_product_category->term_taxonomy_id)){
71
- unset($get_product_categories[$key]);
72
- }
73
- }
74
  return count($get_product_categories);
75
  }
76
 
@@ -129,17 +120,13 @@ class WCML_Troubleshooting{
129
  die('Invalid nonce');
130
  }
131
 
132
- $page = isset($_POST['page'])? intval( $_POST['page'] ) :0;
133
-
134
- global $woocommerce_wpml,$wpdb;
135
 
136
- $all_products = $wpdb->get_results($wpdb->prepare("SELECT p.* FROM $wpdb->posts AS p LEFT JOIN {$wpdb->prefix}icl_translations AS tr ON tr.element_id = p.ID WHERE p.post_status = 'publish' AND p.post_type = 'product' AND tr.source_language_code is NULL ORDER BY p.ID LIMIT %d,5",$page*5));
137
 
138
- foreach($all_products as $product){
139
- if(!get_post_meta($product->ID,'gallery_sync',true)){
140
- $woocommerce_wpml->media->sync_product_gallery($product->ID);
141
- add_post_meta($product->ID,'gallery_sync',true);
142
- }
143
  }
144
 
145
  echo 1;
@@ -148,33 +135,46 @@ class WCML_Troubleshooting{
148
 
149
  }
150
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  function trbl_sync_categories(){
152
  $nonce = filter_input( INPUT_POST, 'wcml_nonce', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
153
  if(!$nonce || !wp_verify_nonce($nonce, 'trbl_sync_categories')){
154
  die('Invalid nonce');
155
  }
156
 
157
- $page = isset($_POST['page'])? intval( $_POST['page'] ):0;
158
-
159
- global $wpdb,$sitepress;
160
 
161
- $all_categories = $wpdb->get_results($wpdb->prepare("SELECT t.term_taxonomy_id,t.term_id,tr.language_code FROM $wpdb->term_taxonomy AS t LEFT JOIN {$wpdb->prefix}icl_translations AS tr ON tr.element_id = t.term_taxonomy_id WHERE t.taxonomy = 'product_cat' AND tr.element_type = 'tax_product_cat' AND tr.source_language_code is NULL ORDER BY t.term_taxonomy_id LIMIT %d,5",$page*5));
162
 
163
  foreach($all_categories as $category){
164
- if(!get_option('wcml_sync_category_'.$category->term_taxonomy_id)){
165
- add_option('wcml_sync_category_'.$category->term_taxonomy_id,true);
166
- $trid = $sitepress->get_element_trid($category->term_taxonomy_id,'tax_product_cat');
167
- $translations = $sitepress->get_element_translations($trid,'tax_product_cat');
168
- $type = get_woocommerce_term_meta( $category->term_id, 'display_type',true);
169
- $thumbnail_id = get_woocommerce_term_meta( $category->term_id, 'thumbnail_id',true);
170
- foreach($translations as $translation){
171
- if($translation->language_code != $category->language_code ){
172
- update_woocommerce_term_meta( $translation->term_id, 'display_type', $type );
173
- update_woocommerce_term_meta( $translation->term_id, 'thumbnail_id', apply_filters( 'translate_object_id',$thumbnail_id,'attachment',true,$translation->language_code) );
174
- }
175
  }
176
  }
177
-
178
  }
179
 
180
  echo 1;
@@ -184,6 +184,25 @@ class WCML_Troubleshooting{
184
  }
185
 
186
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  function trbl_duplicate_terms(){
188
  $nonce = filter_input( INPUT_POST, 'wcml_nonce', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
189
  if(!$nonce || !wp_verify_nonce($nonce, 'trbl_duplicate_terms')){
19
  }
20
 
21
  function wcml_count_products_with_variations(){
22
+ return count(get_option('wcml_products_to_sync'));
23
  }
24
 
25
  function trbl_update_count(){
53
  }
54
 
55
  function wcml_count_products_for_gallery_sync(){
56
+ $all_products = $this->get_products_needs_gallery_sync( false );
57
+
 
 
 
 
 
58
  return count($all_products);
59
  }
60
 
61
  function wcml_count_product_categories(){
62
+
63
+ $get_product_categories = $this->get_product_categories_needs_sync( );
64
+
 
 
 
 
65
  return count($get_product_categories);
66
  }
67
 
120
  die('Invalid nonce');
121
  }
122
 
123
+ global $woocommerce_wpml;
 
 
124
 
125
+ $all_products = $this->get_products_needs_gallery_sync( true );
126
 
127
+ foreach( $all_products as $product ){
128
+ $woocommerce_wpml->media->sync_product_gallery($product->ID);
129
+ add_post_meta($product->ID,'gallery_sync',true);
 
 
130
  }
131
 
132
  echo 1;
135
 
136
  }
137
 
138
+ function get_products_needs_gallery_sync( $limit = false ){
139
+ global $wpdb;
140
+
141
+ $sql = "SELECT p.ID FROM $wpdb->posts AS p
142
+ LEFT JOIN {$wpdb->prefix}icl_translations AS tr
143
+ ON tr.element_id = p.ID
144
+ WHERE p.post_status = 'publish' AND p.post_type = 'product' AND tr.source_language_code is NULL
145
+ AND ( SELECT COUNT( pm.meta_key ) FROM $wpdb->postmeta AS pm WHERE pm.post_id = p.ID AND pm.meta_key = 'gallery_sync' ) = 0 ";
146
+
147
+ if( $limit ){
148
+ $sql .= "ORDER BY p.ID LIMIT 5";
149
+ }
150
+
151
+ $all_products = $wpdb->get_results( $sql );
152
+
153
+ return $all_products;
154
+ }
155
+
156
  function trbl_sync_categories(){
157
  $nonce = filter_input( INPUT_POST, 'wcml_nonce', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
158
  if(!$nonce || !wp_verify_nonce($nonce, 'trbl_sync_categories')){
159
  die('Invalid nonce');
160
  }
161
 
162
+ global $sitepress;
 
 
163
 
164
+ $all_categories = $this->get_product_categories_needs_sync( true );
165
 
166
  foreach($all_categories as $category){
167
+ add_option('wcml_sync_category_'.$category->term_taxonomy_id,true);
168
+ $trid = $sitepress->get_element_trid($category->term_taxonomy_id,'tax_product_cat');
169
+ $translations = $sitepress->get_element_translations($trid,'tax_product_cat');
170
+ $type = get_woocommerce_term_meta( $category->term_id, 'display_type',true);
171
+ $thumbnail_id = get_woocommerce_term_meta( $category->term_id, 'thumbnail_id',true);
172
+ foreach($translations as $translation){
173
+ if($translation->language_code != $category->language_code ){
174
+ update_woocommerce_term_meta( $translation->term_id, 'display_type', $type );
175
+ update_woocommerce_term_meta( $translation->term_id, 'thumbnail_id', apply_filters( 'translate_object_id',$thumbnail_id,'attachment',true,$translation->language_code) );
 
 
176
  }
177
  }
 
178
  }
179
 
180
  echo 1;
184
  }
185
 
186
 
187
+ function get_product_categories_needs_sync( $limit = false ){
188
+ global $wpdb;
189
+
190
+ $sql = "SELECT t.term_taxonomy_id,t.term_id,tr.language_code FROM $wpdb->term_taxonomy AS t
191
+ LEFT JOIN {$wpdb->prefix}icl_translations AS tr
192
+ ON tr.element_id = t.term_taxonomy_id
193
+ WHERE t.taxonomy = 'product_cat' AND tr.element_type = 'tax_product_cat' AND tr.source_language_code is NULL
194
+ AND ( SELECT COUNT( option_id ) FROM $wpdb->options WHERE option_name = CONCAT( 'wcml_sync_category_',t.term_taxonomy_id ) ) = 0 ";
195
+
196
+ if( $limit ){
197
+ $sql .= "ORDER BY t.term_taxonomy_id LIMIT 5";
198
+ }
199
+
200
+ $all_categories = $wpdb->get_results( $sql );
201
+
202
+ return $all_categories;
203
+ }
204
+
205
+
206
  function trbl_duplicate_terms(){
207
  $nonce = filter_input( INPUT_POST, 'wcml_nonce', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
208
  if(!$nonce || !wp_verify_nonce($nonce, 'trbl_duplicate_terms')){
inc/class-wcml-upgrade.php CHANGED
@@ -17,7 +17,8 @@ class WCML_Upgrade{
17
  '3.8',
18
  '3.9',
19
  '3.9.1',
20
- '4.0'
 
21
  );
22
 
23
  function __construct(){
@@ -528,5 +529,58 @@ class WCML_Upgrade{
528
 
529
  }
530
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
531
 
532
  }
17
  '3.8',
18
  '3.9',
19
  '3.9.1',
20
+ '4.0',
21
+ '4.1.0'
22
  );
23
 
24
  function __construct(){
529
 
530
  }
531
 
532
+ function upgrade_4_1_0(){
533
+ global $wpdb;
534
+
535
+ $results = $wpdb->get_results("
536
+ SELECT *
537
+ FROM {$wpdb->postmeta}
538
+ WHERE meta_key LIKE '_price_%' OR meta_key LIKE '_regular_price_%' OR ( meta_key LIKE '_sale_price_%' AND meta_key NOT LIKE '_sale_price_dates%' )
539
+ ");
540
+
541
+ foreach( $results as $price ){
542
+ $formatted_price = wc_format_decimal( $price->meta_value );
543
+ update_post_meta( $price->post_id, $price->meta_key, $formatted_price );
544
+
545
+ if( get_post_type( $price->post_id ) == 'product_variation' ){
546
+ delete_transient( 'wc_var_prices_'.wp_get_post_parent_id( $price->post_id ) );
547
+ }
548
+
549
+ }
550
+
551
+ $wcml_settings = get_option( '_wcml_settings' );
552
+
553
+ if( $wcml_settings[ 'currency_switcher_style' ] == 'list' ){
554
+ if( $wcml_settings[ 'wcml_curr_sel_orientation' ] == 'horizontal' ){
555
+ $switcher_style = 'wcml-horizontal-list';
556
+ }else{
557
+ $switcher_style = 'wcml-vertical-list';
558
+ }
559
+ }else{
560
+ $switcher_style = 'wcml-dropdown';
561
+ }
562
+
563
+ $wcml_settings[ 'currency_switchers' ][ 'product' ] = array(
564
+ 'switcher_style' => $switcher_style,
565
+ 'template' => $wcml_settings[ 'wcml_curr_template' ],
566
+ 'widget_title' => '',
567
+ 'color_scheme' => array(
568
+ 'font_current_normal' => '',
569
+ 'font_current_hover' => '',
570
+ 'background_current_normal' => '',
571
+ 'background_current_hover' => '',
572
+ 'font_other_normal' => '',
573
+ 'font_other_hover' => '',
574
+ 'background_other_normal' => '',
575
+ 'background_other_hover' => '',
576
+ 'border_normal' => ''
577
+ )
578
+ );
579
+
580
+
581
+ $wcml_settings[ 'currency_switcher_additional_css' ] = '';
582
+ update_option('_wcml_settings', $wcml_settings );
583
+ }
584
+
585
 
586
  }
inc/class-wcml-url-translation.php CHANGED
@@ -752,12 +752,13 @@ class WCML_Url_Translation {
752
 
753
  if( is_tax() ){
754
  $original = @parse_url( $requested_url );
755
- parse_str( $original['query'], $query_args ) ;
756
- if( ( isset( $query_args[ 'product_cat' ] ) || isset( $query_args[ 'product_tag' ] ) ) && isset ( $query_args[ 'lang' ] ) ){
757
- $obj = $wp_query->get_queried_object();
758
- $tax_url = get_term_link( (int)$obj->term_id, $obj->taxonomy ) ;
759
-
760
- return $tax_url;
 
761
  }
762
  }
763
 
752
 
753
  if( is_tax() ){
754
  $original = @parse_url( $requested_url );
755
+ if( isset($original['query']) ) {
756
+ parse_str( $original['query'], $query_args );
757
+ if ( ( isset( $query_args['product_cat'] ) || isset( $query_args['product_tag'] ) ) && isset ( $query_args['lang'] ) ) {
758
+ $obj = $wp_query->get_queried_object();
759
+ $tax_url = get_term_link( (int) $obj->term_id, $obj->taxonomy );
760
+ return $tax_url;
761
+ }
762
  }
763
  }
764
 
inc/class-wcml-wc-strings.php CHANGED
@@ -40,36 +40,43 @@ class WCML_WC_Strings{
40
  }
41
 
42
  function translated_attribute_label($label, $name, $product_obj = false){
43
- global $sitepress, $product, $sitepress_settings;
44
 
45
  $product_id = false;
46
  $lang = $sitepress->get_current_language();
47
- $name = sanitize_title($name);
48
 
49
  if( isset( $_GET[ 'post' ] ) && get_post_type( $_GET[ 'post' ] ) == 'shop_order' ){
50
  $lang = $sitepress->get_user_admin_language( get_current_user_id(), true );
51
  }
52
 
53
- if( isset($product->id) ){
54
- $product_id = $product->id;
55
  }elseif( is_numeric( $product_obj ) ){
56
  $product_id = $product_obj;
57
- }elseif( isset($product_obj->id) ){
58
- $product_id = $product_obj->id;
59
  }
60
 
 
 
61
  if( $product_id ){
62
 
63
- $custom_attr_translation = get_post_meta( $product_id, 'attr_label_translations', true ) ;
64
 
65
  if( $custom_attr_translation ){
66
- if( isset( $custom_attr_translation[$lang][$name] ) ){
67
- return $custom_attr_translation[$lang][$name];
68
  }
69
  }
70
 
71
  }
72
 
 
 
 
 
 
 
73
  if(is_admin() && !wpml_is_ajax()){
74
 
75
  $string_language = $this->get_string_language( 'taxonomy singular name: '.$label, 'WordPress' );
@@ -86,12 +93,6 @@ class WCML_WC_Strings{
86
 
87
  }
88
 
89
- $trnsl_label = apply_filters( 'wpml_translate_single_string', $label, 'WordPress', 'taxonomy singular name: '.$label, $lang );
90
-
91
- if( $label != $trnsl_label ){
92
- return $trnsl_label;
93
- }
94
-
95
  // backward compatibility for WCML < 3.6.1
96
  $trnsl_labels = get_option('wcml_custom_attr_translations');
97
 
@@ -127,10 +128,10 @@ class WCML_WC_Strings{
127
  return $title;
128
  }
129
 
130
- function translated_checkout_product_title($title,$product){
131
 
132
- if(isset($product->id)){
133
- $tr_product_id = apply_filters( 'translate_object_id', $product->id, 'product', true, $this->current_language );
134
  $title = get_the_title($tr_product_id);
135
  }
136
 
40
  }
41
 
42
  function translated_attribute_label($label, $name, $product_obj = false){
43
+ global $sitepress, $product, $sitepress_settings, $woocommerce_wpml;
44
 
45
  $product_id = false;
46
  $lang = $sitepress->get_current_language();
 
47
 
48
  if( isset( $_GET[ 'post' ] ) && get_post_type( $_GET[ 'post' ] ) == 'shop_order' ){
49
  $lang = $sitepress->get_user_admin_language( get_current_user_id(), true );
50
  }
51
 
52
+ if( $product ){
53
+ $product_id = WooCommerce_Functions_Wrapper::get_product_id( $product );
54
  }elseif( is_numeric( $product_obj ) ){
55
  $product_id = $product_obj;
56
+ }elseif( $product_obj ){
57
+ $product_id = WooCommerce_Functions_Wrapper::get_product_id( $product_obj );
58
  }
59
 
60
+ $name = $woocommerce_wpml->attributes->filter_attribute_name( $name, $product_id, true );
61
+
62
  if( $product_id ){
63
 
64
+ $custom_attr_translation = $woocommerce_wpml->attributes->get_attr_label_translations( $product_id, $lang ) ;
65
 
66
  if( $custom_attr_translation ){
67
+ if( isset( $custom_attr_translation[$name] ) ){
68
+ return $custom_attr_translation[$name];
69
  }
70
  }
71
 
72
  }
73
 
74
+ $trnsl_label = apply_filters( 'wpml_translate_single_string', $label, 'WordPress', 'taxonomy singular name: '.$label, $lang );
75
+
76
+ if( $label != $trnsl_label ){
77
+ return $trnsl_label;
78
+ }
79
+
80
  if(is_admin() && !wpml_is_ajax()){
81
 
82
  $string_language = $this->get_string_language( 'taxonomy singular name: '.$label, 'WordPress' );
93
 
94
  }
95
 
 
 
 
 
 
 
96
  // backward compatibility for WCML < 3.6.1
97
  $trnsl_labels = get_option('wcml_custom_attr_translations');
98
 
128
  return $title;
129
  }
130
 
131
+ function translated_checkout_product_title( $title, $product ){
132
 
133
+ if( $product ){
134
+ $tr_product_id = apply_filters( 'translate_object_id', WooCommerce_Functions_Wrapper::get_product_id( $product ), 'product', true, $this->current_language );
135
  $title = get_the_title($tr_product_id);
136
  }
137
 
inc/class-wcml-woocommerce-rest-api-support.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
-
3
  class WCML_WooCommerce_Rest_API_Support{
4
 
5
  private $woocommerce_wpml;
@@ -48,7 +48,8 @@ class WCML_WooCommerce_Rest_API_Support{
48
 
49
  if(!empty($wp->query_vars['wc-api-version'])) {
50
  global $wpml_url_filters;
51
- remove_filter('home_url', array($wpml_url_filters, 'home_url_filter'), -10, 2);
 
52
 
53
  }
54
 
1
  <?php
2
+ // Should only be used for WooCommerce versions prior 2.6
3
  class WCML_WooCommerce_Rest_API_Support{
4
 
5
  private $woocommerce_wpml;
48
 
49
  if(!empty($wp->query_vars['wc-api-version'])) {
50
  global $wpml_url_filters;
51
+ $wpml_url_filters->remove_global_hooks();
52
+ remove_filter('home_url', array($wpml_url_filters, 'home_url_filter'), -10, 4);
53
 
54
  }
55
 
inc/class-woocommerce-wpml.php CHANGED
@@ -47,6 +47,8 @@ class woocommerce_wpml {
47
  public $shipping;
48
  /** @var WCML_WC_Gateways */
49
  public $gateways;
 
 
50
 
51
  /** @var WCML_Reports */
52
  private $reports;
@@ -58,9 +60,6 @@ class woocommerce_wpml {
58
  /** @var WCML_xDomain_Data */
59
  private $xdomain_data;
60
 
61
- /** @var WCML_WooCommerce_Rest_API_Support */
62
- private $wc_rest_api;
63
-
64
  /**
65
  * @var WCML_Screen_Options
66
  */
@@ -77,8 +76,21 @@ class woocommerce_wpml {
77
 
78
  new WCML_Widgets( $this );
79
 
 
 
 
 
 
 
 
 
 
80
  add_action('init', array($this, 'init'),2);
81
 
 
 
 
 
82
  }
83
 
84
  /**
@@ -129,7 +141,10 @@ class woocommerce_wpml {
129
  'wcml_update_currency_lang',
130
  'wcml_update_default_currency',
131
  'wcml_price_preview',
132
- 'wcml_currencies_switcher_preview'
 
 
 
133
  );
134
  if($this->settings['enable_multi_currency'] == WCML_MULTI_CURRENCIES_INDEPENDENT
135
  || ( isset($_GET['page']) && $_GET['page'] == 'wpml-wcml' && isset($_GET['tab']) && $_GET['tab'] == 'multi-currency' )
@@ -152,7 +167,6 @@ class woocommerce_wpml {
152
  }
153
 
154
  $this->sync_product_data = new WCML_Synchronize_Product_Data( $this, $sitepress, $wpdb );
155
- $this->endpoints = new WCML_Endpoints;
156
  $this->products = new WCML_Products( $this, $sitepress, $wpdb );
157
  $this->store = new WCML_Store_Pages ($this, $sitepress ) ;
158
  $this->emails = new WCML_Emails( $this, $sitepress );
@@ -164,6 +178,7 @@ class woocommerce_wpml {
164
  $this->gateways = new WCML_WC_Gateways( $this, $sitepress );
165
  $this->currencies = new WCML_Currencies( $this );
166
  $this->url_translation = new WCML_Url_Translation ( $this, $sitepress );
 
167
  $this->requests = new WCML_Requests;
168
  $this->cart = new WCML_Cart( $this, $sitepress, $woocommerce );
169
  $this->coupons = new WCML_Coupons( $this, $sitepress );
@@ -177,10 +192,6 @@ class woocommerce_wpml {
177
  new WCML_Ajax_Setup( $sitepress );
178
  new WCML_Fix_Copied_Custom_Fields_WPML353();
179
 
180
- if ( 'yes' == get_option( 'woocommerce_api_enabled' ) ){
181
- $this->wc_rest_api = new WCML_WooCommerce_Rest_API_Support( $this, $sitepress );
182
- }
183
-
184
  WCML_Install::initialize( $this, $sitepress );
185
 
186
  WCML_Resources::set_up_resources( $this, $sitepress );
47
  public $shipping;
48
  /** @var WCML_WC_Gateways */
49
  public $gateways;
50
+ /** @var WCML_CS_Templates */
51
+ public $cs_templates;
52
 
53
  /** @var WCML_Reports */
54
  private $reports;
60
  /** @var WCML_xDomain_Data */
61
  private $xdomain_data;
62
 
 
 
 
63
  /**
64
  * @var WCML_Screen_Options
65
  */
76
 
77
  new WCML_Widgets( $this );
78
 
79
+ if ( 'yes' == get_option( 'woocommerce_api_enabled' ) ){
80
+ global $sitepress;
81
+ if( version_compare( WC()->version, '2.6') ){
82
+ new WCML_REST_API_Support( $this, $sitepress );
83
+ }else{
84
+ new WCML_WooCommerce_Rest_API_Support( $this, $sitepress );
85
+ }
86
+ }
87
+
88
  add_action('init', array($this, 'init'),2);
89
 
90
+ if( defined( 'ICL_SITEPRESS_VERSION' ) && !ICL_PLUGIN_INACTIVE && class_exists( 'SitePress' ) ){
91
+ $this->cs_templates = new WCML_Currency_Switcher_Templates( $this );
92
+ $this->cs_templates->init_hooks();
93
+ }
94
  }
95
 
96
  /**
141
  'wcml_update_currency_lang',
142
  'wcml_update_default_currency',
143
  'wcml_price_preview',
144
+ 'wcml_currencies_switcher_preview',
145
+ 'wcml_currencies_switcher_save_settings',
146
+ 'wcml_delete_currency_switcher',
147
+ 'wcml_currencies_order'
148
  );
149
  if($this->settings['enable_multi_currency'] == WCML_MULTI_CURRENCIES_INDEPENDENT
150
  || ( isset($_GET['page']) && $_GET['page'] == 'wpml-wcml' && isset($_GET['tab']) && $_GET['tab'] == 'multi-currency' )
167
  }
168
 
169
  $this->sync_product_data = new WCML_Synchronize_Product_Data( $this, $sitepress, $wpdb );
 
170
  $this->products = new WCML_Products( $this, $sitepress, $wpdb );
171
  $this->store = new WCML_Store_Pages ($this, $sitepress ) ;
172
  $this->emails = new WCML_Emails( $this, $sitepress );
178
  $this->gateways = new WCML_WC_Gateways( $this, $sitepress );
179
  $this->currencies = new WCML_Currencies( $this );
180
  $this->url_translation = new WCML_Url_Translation ( $this, $sitepress );
181
+ $this->endpoints = new WCML_Endpoints( $this );
182
  $this->requests = new WCML_Requests;
183
  $this->cart = new WCML_Cart( $this, $sitepress, $woocommerce );
184
  $this->coupons = new WCML_Coupons( $this, $sitepress );
192
  new WCML_Ajax_Setup( $sitepress );
193
  new WCML_Fix_Copied_Custom_Fields_WPML353();
194
 
 
 
 
 
195
  WCML_Install::initialize( $this, $sitepress );
196
 
197
  WCML_Resources::set_up_resources( $this, $sitepress );
inc/currencies/class-wcml-admin-currency-selector.php CHANGED
@@ -45,7 +45,7 @@ class WCML_Admin_Currency_Selector{
45
  $order_currencies = $this->woocommerce_wpml->multi_currency->orders->get_orders_currencies();
46
  ?>
47
  <select id="dropdown_dashboard_currency" style="display: none; margin : 10px; ">
48
- <?php if(empty($orders_currencies)): ?>
49
  <option value=""><?php _e('Currency - no orders found', 'woocommerce-multilingual') ?></option>
50
  <?php else: ?>
51
  <?php foreach($order_currencies as $currency => $count ): ?>
@@ -120,10 +120,9 @@ class WCML_Admin_Currency_Selector{
120
  break;
121
  }
122
  }
123
- }
124
-
125
- setcookie('_wcml_dashboard_currency', $currency_code , time() + 86400, COOKIEPATH, COOKIE_DOMAIN);
126
 
 
 
127
  }
128
 
129
  /*
45
  $order_currencies = $this->woocommerce_wpml->multi_currency->orders->get_orders_currencies();
46
  ?>
47
  <select id="dropdown_dashboard_currency" style="display: none; margin : 10px; ">
48
+ <?php if(empty($order_currencies)): ?>
49
  <option value=""><?php _e('Currency - no orders found', 'woocommerce-multilingual') ?></option>
50
  <?php else: ?>
51
  <?php foreach($order_currencies as $currency => $count ): ?>
120
  break;
121
  }
122
  }
 
 
 
123
 
124
+ setcookie('_wcml_dashboard_currency', $currency_code , time() + 86400, COOKIEPATH, COOKIE_DOMAIN);
125
+ }
126
  }
127
 
128
  /*
inc/currencies/class-wcml-currencies.php CHANGED
@@ -7,7 +7,7 @@ class WCML_Currencies{
7
  public function __construct( &$woocommerce_wpml ) {
8
  $this->woocommerce_wpml =& $woocommerce_wpml;
9
 
10
- if( is_admin() ){
11
  add_action( 'update_option_woocommerce_currency', array( $this, 'update_default_currency' ), 10, 2 );
12
  }
13
 
7
  public function __construct( &$woocommerce_wpml ) {
8
  $this->woocommerce_wpml =& $woocommerce_wpml;
9
 
10
+ if( is_admin() && wcml_is_multi_currency_on() ){
11
  add_action( 'update_option_woocommerce_currency', array( $this, 'update_default_currency' ), 10, 2 );
12
  }
13
 
inc/currencies/class-wcml-custom-prices.php CHANGED
@@ -19,11 +19,8 @@ class WCML_Custom_Prices{
19
 
20
  }
21
 
22
- if( version_compare( WC_VERSION , '2.7', '<' ) ){
23
- add_action( 'woocommerce_get_children', array( $this, 'filter_product_variations_with_custom_prices' ), 10 );
24
- }else{
25
- add_action( 'woocommerce_product_get_children', array( $this, 'filter_product_variations_with_custom_prices' ), 10 );
26
- }
27
 
28
  add_filter( 'loop_shop_post_in', array( $this, 'filter_products_with_custom_prices' ), 100 );
29
 
@@ -290,25 +287,22 @@ class WCML_Custom_Prices{
290
 
291
  }
292
 
293
- //display variations with custom prices when "Show only products with custom prices in secondary currencies" enabled
294
- public function filter_product_variations_with_custom_prices( $children ){
295
 
296
  if( is_product() && $this->woocommerce_wpml->settings['enable_multi_currency'] == WCML_MULTI_CURRENCIES_INDEPENDENT &&
297
  isset($this->woocommerce_wpml->settings['display_custom_prices']) &&
298
  $this->woocommerce_wpml->settings['display_custom_prices'] ){
299
 
300
- foreach( $children as $key => $child ){
301
- $orig_lang = $this->woocommerce_wpml->products->get_original_product_language( $child );
302
- $orig_child_id = apply_filters( 'translate_object_id', $child, get_post_type( $child ), true, $orig_lang );
303
 
304
- if( !get_post_meta( $orig_child_id, '_wcml_custom_prices_status', true ) ){
305
- unset( $children[ $key ] );
306
- }
307
  }
308
  }
309
 
310
- return $children;
311
-
312
  }
313
 
314
  // display products with custom prices only if enabled "Show only products with custom prices in secondary currencies" option on settings page
@@ -449,8 +443,8 @@ class WCML_Custom_Prices{
449
 
450
  if( $_POST[ '_wcml_custom_prices' ][ $product_id ] == 1 ){
451
  foreach( $currencies as $code => $currency ){
452
- $sale_price = $_POST[ '_custom_variation_sale_price' ][ $code ][ $product_id ];
453
- $regular_price = $_POST[ '_custom_variation_regular_price' ][ $code ][ $product_id ];
454
  $date_from = strtotime( $_POST[ '_custom_variation_sale_price_dates_from' ][ $code ][ $product_id ] );
455
  $date_to = strtotime( $_POST[ '_custom_variation_sale_price_dates_to' ][ $code ][ $product_id ] );
456
  $schedule = $_POST[ '_wcml_schedule' ][ $code ][ $product_id ];
19
 
20
  }
21
 
22
+ add_action( 'woocommerce_variation_is_visible', array( $this, 'filter_product_variations_with_custom_prices' ), 10, 2 );
23
+
 
 
 
24
 
25
  add_filter( 'loop_shop_post_in', array( $this, 'filter_products_with_custom_prices' ), 100 );
26
 
287
 
288
  }
289
 
290
+ //set variations without custom prices to not visible when "Show only products with custom prices in secondary currencies" is enabled
291
+ public function filter_product_variations_with_custom_prices( $is_visible, $variation_id ){
292
 
293
  if( is_product() && $this->woocommerce_wpml->settings['enable_multi_currency'] == WCML_MULTI_CURRENCIES_INDEPENDENT &&
294
  isset($this->woocommerce_wpml->settings['display_custom_prices']) &&
295
  $this->woocommerce_wpml->settings['display_custom_prices'] ){
296
 
297
+ $orig_lang = $this->woocommerce_wpml->products->get_original_product_language( $variation_id );
298
+ $orig_child_id = apply_filters( 'translate_object_id', $variation_id, 'product_variation', true, $orig_lang );
 
299
 
300
+ if( !get_post_meta( $orig_child_id, '_wcml_custom_prices_status', true ) ){
301
+ return false;
 
302
  }
303
  }
304
 
305
+ return $is_visible;
 
306
  }
307
 
308
  // display products with custom prices only if enabled "Show only products with custom prices in secondary currencies" option on settings page
443
 
444
  if( $_POST[ '_wcml_custom_prices' ][ $product_id ] == 1 ){
445
  foreach( $currencies as $code => $currency ){
446
+ $sale_price = wc_format_decimal( $_POST[ '_custom_variation_sale_price' ][ $code ][ $product_id ] );
447
+ $regular_price = wc_format_decimal( $_POST[ '_custom_variation_regular_price' ][ $code ][ $product_id ] );
448
  $date_from = strtotime( $_POST[ '_custom_variation_sale_price_dates_from' ][ $code ][ $product_id ] );
449
  $date_to = strtotime( $_POST[ '_custom_variation_sale_price_dates_to' ][ $code ][ $product_id ] );
450
  $schedule = $_POST[ '_wcml_schedule' ][ $code ][ $product_id ];
inc/currencies/class-wcml-multi-currency-configuration.php CHANGED
@@ -58,16 +58,8 @@ class WCML_Multi_Currency_Configuration{
58
  }
59
  }
60
 
61
- // Allow some HTML in the currency switcher
62
- $currency_switcher_format = strip_tags( stripslashes_deep( $_POST['wcml_curr_template'] ), '<img><span><u><strong><em>');
63
- $currency_switcher_format = htmlentities( $currency_switcher_format );
64
- $currency_switcher_format = sanitize_text_field( $currency_switcher_format );
65
- $currency_switcher_format = html_entity_decode( $currency_switcher_format );
66
-
67
- $wcml_settings['currency_switcher_style'] = sanitize_text_field( $_POST['currency_switcher_style'] );
68
- $wcml_settings['wcml_curr_sel_orientation'] = sanitize_text_field( $_POST['wcml_curr_sel_orientation'] );
69
- $wcml_settings['wcml_curr_template'] = $currency_switcher_format;
70
  $wcml_settings['currency_switcher_product_visibility'] = isset($_POST['currency_switcher_product_visibility']) ? intval( $_POST['currency_switcher_product_visibility'] ) : 0;
 
71
 
72
  self::$woocommerce_wpml->update_settings( $wcml_settings );
73
 
58
  }
59
  }
60
 
 
 
 
 
 
 
 
 
 
61
  $wcml_settings['currency_switcher_product_visibility'] = isset($_POST['currency_switcher_product_visibility']) ? intval( $_POST['currency_switcher_product_visibility'] ) : 0;
62
+ $wcml_settings['currency_switcher_additional_css'] = isset($_POST['currency_switcher_additional_css']) ? sanitize_text_field( $_POST['currency_switcher_additional_css'] ) : '';
63
 
64
  self::$woocommerce_wpml->update_settings( $wcml_settings );
65
 
inc/currencies/class-wcml-multi-currency-orders.php CHANGED
@@ -46,6 +46,10 @@ class WCML_Multi_Currency_Orders{
46
  add_action( 'woocommerce_email_before_order_table', array($this, 'fix_currency_before_order_email') );
47
  add_action( 'woocommerce_email_after_order_table', array($this, 'fix_currency_after_order_email') );
48
 
 
 
 
 
49
  }
50
 
51
  public function get_orders_currencies(){
@@ -130,7 +134,20 @@ class WCML_Multi_Currency_Orders{
130
  $currency = get_woocommerce_currency_symbol( $order_currency );
131
  }
132
 
133
- }elseif( ( isset( $_POST['action'] ) && in_array( $_POST['action'], array( 'woocommerce_add_order_item', 'woocommerce_calc_line_taxes', 'woocommerce_save_order_items' ) ) ) || ( isset( $_GET[ 'action' ] ) && $_GET[ 'action' ] == 'woocommerce_json_search_products_and_variations' )){
 
 
 
 
 
 
 
 
 
 
 
 
 
134
 
135
  if( isset( $_COOKIE[ '_wcml_order_currency' ] ) ){
136
  $currency = get_woocommerce_currency_symbol($_COOKIE[ '_wcml_order_currency' ]);
@@ -251,6 +268,7 @@ class WCML_Multi_Currency_Orders{
251
  $item['line_tax'] = $this->multi_currency->prices->convert_price_amount( $item['line_tax'], $order_currency );
252
  wc_update_order_item_meta( $item_id, '_line_tax', $item['line_tax'] );
253
 
 
254
  return $item;
255
  }
256
 
@@ -340,4 +358,17 @@ class WCML_Multi_Currency_Orders{
340
  $this->client_currency = $currency_code;
341
  }
342
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
  }
46
  add_action( 'woocommerce_email_before_order_table', array($this, 'fix_currency_before_order_email') );
47
  add_action( 'woocommerce_email_after_order_table', array($this, 'fix_currency_after_order_email') );
48
 
49
+ if( is_admin() ){
50
+ add_filter( 'woocommerce_order_get_currency', array( $this, 'get_currency_for_new_order' ), 10, 2 );
51
+ }
52
+
53
  }
54
 
55
  public function get_orders_currencies(){
134
  $currency = get_woocommerce_currency_symbol( $order_currency );
135
  }
136
 
137
+ }elseif(
138
+ (
139
+ isset( $_POST['action'] ) &&
140
+ in_array( $_POST['action'], array(
141
+ 'woocommerce_add_order_item',
142
+ 'woocommerce_calc_line_taxes',
143
+ 'woocommerce_save_order_items' )
144
+ ) )
145
+ || (
146
+ isset( $_GET[ 'action' ] ) &&
147
+ $_GET[ 'action' ] == 'woocommerce_json_search_products_and_variations'
148
+ )
149
+ ){
150
+
151
 
152
  if( isset( $_COOKIE[ '_wcml_order_currency' ] ) ){
153
  $currency = get_woocommerce_currency_symbol($_COOKIE[ '_wcml_order_currency' ]);
268
  $item['line_tax'] = $this->multi_currency->prices->convert_price_amount( $item['line_tax'], $order_currency );
269
  wc_update_order_item_meta( $item_id, '_line_tax', $item['line_tax'] );
270
 
271
+ $item->save_meta_data();
272
  return $item;
273
  }
274
 
358
  $this->client_currency = $currency_code;
359
  }
360
 
361
+ public function get_currency_for_new_order( $value, $order ){
362
+ $current_screen = get_current_screen();
363
+ if( !empty($current_screen) && $current_screen->id == 'shop_order' ){
364
+ $order_id = method_exists( $order, 'get_id' ) ? $order->get_id() : $order->id;
365
+ $order_currency = get_post_meta( $order_id, 'order_currency', true );
366
+ if( empty( $order_currency ) ){
367
+ $value = $this->get_order_currency_cookie();
368
+ }
369
+ }
370
+ return $value;
371
+ }
372
+
373
+
374
  }
inc/currencies/class-wcml-multi-currency-prices.php CHANGED
@@ -24,9 +24,9 @@ class WCML_Multi_Currency_Prices{
24
  // Currency and Amount filters
25
  add_filter('woocommerce_currency', array($this, 'currency_filter'));
26
 
27
- add_filter( 'wcml_price_currency', array($this, 'price_currency_filter') ); // WCML filters
28
- add_filter( 'wcml_raw_price_amount', array($this, 'raw_price_filter'), 10, 2 ); // WCML filters
29
- add_filter( 'wcml_product_price_by_currency', array($this, 'get_product_price_in_currency'), 10, 2 ); // WCML filters
30
 
31
  add_filter('get_post_metadata', array($this, 'product_price_filter'), 10, 4);
32
  add_filter('get_post_metadata', array($this, 'variation_prices_filter'), 12, 4); // second
@@ -185,7 +185,6 @@ class WCML_Multi_Currency_Prices{
185
 
186
  }
187
 
188
-
189
  return !empty($price) ? $price : $null;
190
  }
191
 
24
  // Currency and Amount filters
25
  add_filter('woocommerce_currency', array($this, 'currency_filter'));
26
 
27
+ add_filter( 'wcml_price_currency', array($this, 'price_currency_filter') ); // WCML filters
28
+ add_filter( 'wcml_raw_price_amount', array($this, 'raw_price_filter'), 10, 2 ); // WCML filters
29
+ add_filter( 'wcml_product_price_by_currency', array($this, 'get_product_price_in_currency'), 10, 2 ); // WCML filters
30
 
31
  add_filter('get_post_metadata', array($this, 'product_price_filter'), 10, 4);
32
  add_filter('get_post_metadata', array($this, 'variation_prices_filter'), 12, 4); // second
185
 
186
  }
187
 
 
188
  return !empty($price) ? $price : $null;
189
  }
190
 
inc/currencies/class-wcml-multi-currency-resources.php CHANGED
@@ -3,22 +3,18 @@
3
  class WCML_Multi_Currency_Resources{
4
 
5
  static $multi_currency;
 
6
 
7
- public static function set_up( &$multi_currency ){
 
8
 
9
  self::$multi_currency =& $multi_currency;
 
10
 
11
- if(!is_admin()){
12
  self::load_inline_js();
13
  }
14
 
15
- $is_multi_currency = is_admin() && isset ($_GET['page'] ) && $_GET['page'] == 'wpml-wcml'
16
- && isset( $_GET['tab'] ) && $_GET['tab'] == 'multi-currency';
17
-
18
- if( !is_admin() || $is_multi_currency ){
19
- self::register_css();
20
- }
21
-
22
  }
23
 
24
  private static function load_inline_js(){
@@ -35,18 +31,12 @@ class WCML_Multi_Currency_Resources{
35
  'symbol'=> get_woocommerce_currency_symbol( self::$multi_currency->get_client_currency() )
36
  );
37
 
38
- if( !empty(self::$multi_currency->W3TC) ){
39
- $script_vars['w3tc'] = 1;
40
- }
41
 
42
  wp_localize_script('wcml-mc-scripts', 'wcml_mc_settings', $script_vars );
43
 
44
  }
45
 
46
- private static function register_css(){
47
- wp_register_style( 'currency-switcher', WCML_PLUGIN_URL . '/res/css/currency-switcher.css', null, WCML_VERSION );
48
- wp_enqueue_style('currency-switcher');
49
- }
50
-
51
-
52
  }
3
  class WCML_Multi_Currency_Resources{
4
 
5
  static $multi_currency;
6
+ static $woocommerce_wpml;
7
 
8
+ public static function set_up( &$multi_currency, &$woocommerce_wpml ){
9
+ global $pagenow;
10
 
11
  self::$multi_currency =& $multi_currency;
12
+ self::$woocommerce_wpml =& $woocommerce_wpml;
13
 
14
+ if(!is_admin() && $pagenow != 'wp-login.php' ){
15
  self::load_inline_js();
16
  }
17
 
 
 
 
 
 
 
 
18
  }
19
 
20
  private static function load_inline_js(){
31
  'symbol'=> get_woocommerce_currency_symbol( self::$multi_currency->get_client_currency() )
32
  );
33
 
34
+ if( !empty(self::$multi_currency->W3TC) || function_exists('wp_cache_is_enabled') && wp_cache_is_enabled() ){
35
+ $script_vars['w3tc'] = 1;
36
+ }
37
 
38
  wp_localize_script('wcml-mc-scripts', 'wcml_mc_settings', $script_vars );
39
 
40
  }
41
 
 
 
 
 
 
 
42
  }
inc/currencies/class-wcml-multi-currency.php CHANGED
@@ -54,6 +54,10 @@ class WCML_Multi_Currency{
54
  * @var WCML_Currency_Switcher
55
  */
56
  public $currency_switcher;
 
 
 
 
57
  /**
58
  * @var WCML_Multi_Currency_Install
59
  */
@@ -76,7 +80,7 @@ class WCML_Multi_Currency{
76
  * WCML_Multi_Currency constructor.
77
  */
78
  public function __construct(){
79
- global $woocommerce_wpml;
80
 
81
  $this->woocommerce_wpml =& $woocommerce_wpml;
82
 
@@ -94,7 +98,8 @@ class WCML_Multi_Currency{
94
  $this->orders = new WCML_Multi_Currency_Orders( $this );
95
  $this->admin_currency_selector = new WCML_Admin_Currency_Selector();
96
  $this->custom_prices = new WCML_Custom_Prices( $woocommerce_wpml );
97
- $this->currency_switcher = new WCML_Currency_Switcher;
 
98
 
99
  $this->exchange_rate_services = new WCML_Exchange_Rates( $this->woocommerce_wpml );
100
 
@@ -102,7 +107,7 @@ class WCML_Multi_Currency{
102
  $this->W3TC = new WCML_W3TC_Multi_Currency();
103
  }
104
 
105
- WCML_Multi_Currency_Resources::set_up( $this );
106
  WCML_Multi_Currency_Configuration::set_up( $this, $woocommerce_wpml );
107
 
108
  add_filter('init', array($this, 'init'), 5);
@@ -336,7 +341,7 @@ class WCML_Multi_Currency{
336
  $current_language = $sitepress->get_current_language();
337
  $current_language = ( $current_language != 'all' && !is_null( $current_language ) ) ? $current_language : $sitepress->get_default_language();
338
 
339
- if( is_product() &&
340
  isset($this->woocommerce_wpml->settings['display_custom_prices']) &&
341
  $this->woocommerce_wpml->settings['display_custom_prices'] ){
342
 
54
  * @var WCML_Currency_Switcher
55
  */
56
  public $currency_switcher;
57
+ /**
58
+ * @var WCML_Currency_Switcher_Ajax
59
+ */
60
+ public $currency_switcher_ajax;
61
  /**
62
  * @var WCML_Multi_Currency_Install
63
  */
80
  * WCML_Multi_Currency constructor.
81
  */
82
  public function __construct(){
83
+ global $woocommerce_wpml, $sitepress;
84
 
85
  $this->woocommerce_wpml =& $woocommerce_wpml;
86
 
98
  $this->orders = new WCML_Multi_Currency_Orders( $this );
99
  $this->admin_currency_selector = new WCML_Admin_Currency_Selector();
100
  $this->custom_prices = new WCML_Custom_Prices( $woocommerce_wpml );
101
+ $this->currency_switcher = new WCML_Currency_Switcher( $woocommerce_wpml, $sitepress );
102
+ $this->currency_switcher_ajax = new WCML_Currency_Switcher_Ajax( $woocommerce_wpml );
103
 
104
  $this->exchange_rate_services = new WCML_Exchange_Rates( $this->woocommerce_wpml );
105
 
107
  $this->W3TC = new WCML_W3TC_Multi_Currency();
108
  }
109
 
110
+ WCML_Multi_Currency_Resources::set_up( $this, $this->woocommerce_wpml );
111
  WCML_Multi_Currency_Configuration::set_up( $this, $woocommerce_wpml );
112
 
113
  add_filter('init', array($this, 'init'), 5);
341
  $current_language = $sitepress->get_current_language();
342
  $current_language = ( $current_language != 'all' && !is_null( $current_language ) ) ? $current_language : $sitepress->get_default_language();
343
 
344
+ if( is_product() && empty( $this->client_currency ) &&
345
  isset($this->woocommerce_wpml->settings['display_custom_prices']) &&
346
  $this->woocommerce_wpml->settings['display_custom_prices'] ){
347
 
inc/currencies/currency-switcher/class-wcml-currency-switcher-ajax.php ADDED
@@ -0,0 +1,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class WCML_Currency_Switcher_Ajax
5
+ *
6
+ */
7
+ class WCML_Currency_Switcher_Ajax{
8
+
9
+ private $woocommerce_wpml;
10
+
11
+ public function __construct( &$woocommerce_wpml ) {
12
+
13
+ $this->woocommerce_wpml = $woocommerce_wpml;
14
+
15
+ add_action( 'wp_ajax_wcml_currencies_order', array($this, 'wcml_currencies_order') );
16
+ add_action( 'wp_ajax_wcml_currencies_switcher_preview', array($this, 'wcml_currencies_switcher_preview') );
17
+ add_action( 'wp_ajax_wcml_currencies_switcher_save_settings', array($this, 'wcml_currencies_switcher_save_settings') );
18
+ add_action( 'wp_ajax_wcml_delete_currency_switcher', array($this, 'wcml_delete_currency_switcher') );
19
+
20
+ }
21
+
22
+ public function wcml_currencies_order() {
23
+ $nonce = array_key_exists( 'wcml_nonce', $_POST ) ? sanitize_text_field( $_POST['wcml_nonce'] ) : false;
24
+ if ( !$nonce || !wp_verify_nonce( $nonce, 'set_currencies_order_nonce' ) ) {
25
+ wp_send_json_error('Invalid nonce');
26
+ }
27
+
28
+ $this->woocommerce_wpml->settings['currencies_order'] = explode( ';', $_POST['order'] );
29
+ $this->woocommerce_wpml->update_settings( $this->woocommerce_wpml->settings );
30
+ wp_send_json_success( array( 'message' => esc_html__( 'Currencies order updated', 'woocommerce-multilingual' ) ) );
31
+ }
32
+
33
+ public function wcml_currencies_switcher_save_settings() {
34
+ $nonce = array_key_exists( 'wcml_nonce', $_POST ) ? sanitize_text_field( $_POST['wcml_nonce'] ) : false;
35
+ if ( !$nonce || !wp_verify_nonce( $nonce, 'wcml_currencies_switcher_save_settings' ) ) {
36
+ wp_send_json_error('Invalid nonce');
37
+ }
38
+ $wcml_settings =& $this->woocommerce_wpml->settings;
39
+ $switcher_settings = array();
40
+
41
+ // Allow some HTML in the currency switcher
42
+ $currency_switcher_format = strip_tags( stripslashes_deep( $_POST[ 'template' ] ), '<img><span><u><strong><em>');
43
+ $currency_switcher_format = htmlentities( $currency_switcher_format );
44
+ $currency_switcher_format = sanitize_text_field( $currency_switcher_format );
45
+ $currency_switcher_format = html_entity_decode( $currency_switcher_format );
46
+
47
+ $switcher_id = sanitize_text_field( $_POST[ 'switcher_id' ] );
48
+ if( $switcher_id == 'new_widget' ){
49
+ $switcher_id = sanitize_text_field( $_POST[ 'widget_id' ] );
50
+
51
+ }
52
+
53
+ $switcher_settings[ 'widget_title' ] = isset( $_POST[ 'widget_title' ] ) ? sanitize_text_field( $_POST[ 'widget_title' ] ) : '';
54
+ $switcher_settings[ 'switcher_style' ] = sanitize_text_field( $_POST[ 'switcher_style' ] );
55
+ $switcher_settings[ 'template' ] = $currency_switcher_format;
56
+
57
+ foreach( $_POST[ 'color_scheme' ] as $color_id => $color ){
58
+ $switcher_settings[ 'color_scheme' ][ sanitize_text_field( $color_id ) ] = sanitize_hex_color( $color );
59
+ }
60
+
61
+ $wcml_settings[ 'currency_switchers' ][ $switcher_id ] = $switcher_settings;
62
+
63
+ //update widget settings
64
+ if( $switcher_id != 'product' ){
65
+ $widget_settings = get_option('widget_currency_sel_widget');
66
+ $setting_match = false;
67
+ foreach( $widget_settings as $key => $widget_setting ){
68
+ if( isset( $widget_setting['id'] ) && $switcher_id == $widget_setting['id'] ){
69
+ $setting_match = true;
70
+ $widget_settings[ $key ][ 'settings' ] = $switcher_settings;
71
+ }
72
+ }
73
+
74
+ if( !$setting_match ){
75
+ $widget_settings[] = array(
76
+ 'id' => $switcher_id,
77
+ 'settings' => $switcher_settings
78
+ );
79
+ }
80
+
81
+ update_option( 'widget_currency_sel_widget', $widget_settings );
82
+
83
+ $this->synchronize_widget_instances( $widget_settings );
84
+ }
85
+
86
+ $this->woocommerce_wpml->update_settings( $wcml_settings );
87
+
88
+ wp_send_json_success();
89
+ }
90
+
91
+ private function synchronize_widget_instances( $widget_settings ) {
92
+
93
+ $sidebars_widgets = $this->get_sidebars_widgets();
94
+
95
+ foreach ( $sidebars_widgets as $sidebar => $widgets ) {
96
+ if ( 'wp_inactive_widgets' === $sidebar ) {
97
+ continue;
98
+ }
99
+
100
+ $found = false;
101
+ if ( is_array( $widgets ) ) {
102
+ foreach ( $widgets as $key => $widget_id ) {
103
+ if ( strpos( $widget_id, WCML_Currency_Switcher_Widget::SLUG ) === 0 ) {
104
+
105
+ if ( $found ) { // Only synchronize the first CS widget instance per sidebar
106
+ unset( $sidebars_widgets[ $sidebar ][ $key ] );
107
+ continue;
108
+ }
109
+
110
+ $found = true;
111
+
112
+ }
113
+ }
114
+ }
115
+
116
+ if ( ! $found ) {
117
+
118
+ foreach( $widget_settings as $key => $widget_setting ){
119
+ if( $widget_setting['id'] == $sidebar ){
120
+ array_unshift( $sidebars_widgets[ $sidebar ], WCML_Currency_Switcher_Widget::SLUG.'-'.$key );
121
+ }
122
+ }
123
+
124
+ }
125
+ }
126
+
127
+ $this->update_sidebars_widgets( $sidebars_widgets );
128
+
129
+ }
130
+
131
+ public function wcml_delete_currency_switcher(){
132
+ $nonce = array_key_exists( 'wcml_nonce', $_POST ) ? sanitize_text_field( $_POST['wcml_nonce'] ) : false;
133
+ if ( !$nonce || !wp_verify_nonce( $nonce, 'delete_currency_switcher' ) ) {
134
+ wp_send_json_error();
135
+ }
136
+
137
+ $switcher_id = sanitize_text_field( $_POST[ 'switcher_id' ] );
138
+
139
+ $wcml_settings = $this->woocommerce_wpml->get_settings();
140
+
141
+ unset( $wcml_settings[ 'currency_switchers' ][ $switcher_id ] );
142
+
143
+ $this->woocommerce_wpml->update_settings( $wcml_settings );
144
+
145
+ $sidebars_widgets = $this->get_sidebars_widgets();
146
+
147
+ foreach ($sidebars_widgets as $sidebar => $widgets) {
148
+ if ($sidebar != $switcher_id) {
149
+ continue;
150
+ }
151
+
152
+ if (is_array($widgets)) {
153
+ foreach ($widgets as $key => $widget_id) {
154
+ if (strpos($widget_id, WCML_Currency_Switcher_Widget::SLUG) === 0) {
155
+ unset($sidebars_widgets[$sidebar][$key]);
156
+ }
157
+ }
158
+ }
159
+ }
160
+
161
+ $this->update_sidebars_widgets( $sidebars_widgets );
162
+
163
+ wp_send_json_success();
164
+ }
165
+
166
+ public function wcml_currencies_switcher_preview() {
167
+ $nonce = array_key_exists( 'wcml_nonce', $_POST ) ? sanitize_text_field( $_POST['wcml_nonce'] ) : false;
168
+ if ( !$nonce || !wp_verify_nonce( $nonce, 'wcml_currencies_switcher_preview' ) ) {
169
+ wp_send_json_error( 'Invalid nonce' );
170
+ }
171
+ $return= array();
172
+
173
+ $inline_css = $this->woocommerce_wpml->cs_templates->get_color_picket_css( $_POST['switcher_id'], array( 'switcher_style' => $_POST['switcher_style'], 'color_scheme' => $_POST['color_scheme'] ) );
174
+
175
+ $template = $this->woocommerce_wpml->cs_templates->get_template( $_POST['switcher_style'] );
176
+
177
+ if ( $template->has_styles() ) {
178
+ $return['inline_styles_id'] = $template->get_inline_style_handler().'-inline-css';
179
+ }else{
180
+ $return['inline_styles_id'] = 'wcml-cs-inline-styles-' . $_POST['switcher_id'].'-'.$_POST['switcher_style'];
181
+ }
182
+
183
+ $return['inline_css'] = $inline_css;
184
+
185
+ ob_start();
186
+ $this->woocommerce_wpml->multi_currency->currency_switcher->wcml_currency_switcher(
187
+ array(
188
+ 'switcher_id' => $_POST['switcher_id'],
189
+ 'format' => isset( $_POST['template'] ) ? stripslashes_deep( $_POST['template'] ) : '%name% (%symbol%) - %code%',
190
+ 'switcher_style' => $_POST['switcher_style'],
191
+ 'color_scheme' => $_POST['color_scheme']
192
+ )
193
+ );
194
+ $switcher_preview = ob_get_contents();
195
+ ob_end_clean();
196
+
197
+ $return['preview'] = $switcher_preview;
198
+
199
+ wp_send_json_success( $return );
200
+ }
201
+
202
+ public function get_sidebars_widgets() {
203
+ if ( ! function_exists( 'wp_get_sidebars_widgets' ) ) {
204
+ require_once( ABSPATH . '/wp-admin/includes/widgets.php' );
205
+ }
206
+ $sidebars_widgets = wp_get_sidebars_widgets();
207
+
208
+ return is_array( $sidebars_widgets ) ? $sidebars_widgets : array();
209
+ }
210
+ public function update_sidebars_widgets( $sidebars_widgets ){
211
+ remove_action( 'pre_update_option_sidebars_widgets', array( $this->woocommerce_wpml->multi_currency->currency_switcher, 'update_option_sidebars_widgets' ), 10, 2 );
212
+
213
+ wp_set_sidebars_widgets( $sidebars_widgets );
214
+
215
+ add_action( 'pre_update_option_sidebars_widgets', array( $this->woocommerce_wpml->multi_currency->currency_switcher, 'update_option_sidebars_widgets' ), 10, 2 );
216
+ }
217
+ }
inc/currencies/currency-switcher/class-wcml-currency-switcher-templates.php ADDED
@@ -0,0 +1,414 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WCML_Currency_Switcher_Templates {
4
+
5
+ const CONFIG_FILE = 'config.json';
6
+
7
+ /*
8
+ * @var woocommerce_wpml
9
+ */
10
+ private $woocommerce_wpml;
11
+
12
+ /** @var string $uploads_path */
13
+ private $uploads_path;
14
+
15
+ /**
16
+ * @var WPML_File
17
+ */
18
+ private $wpml_file;
19
+
20
+ /* @var array $templates Collection of WCML_CS_Template */
21
+ private $templates = false;
22
+
23
+ /* @var string $ds */
24
+ private $ds = DIRECTORY_SEPARATOR;
25
+
26
+ public function __construct( &$woocommerce_wpml, WPML_File $wpml_file = null ) {
27
+
28
+ $this->woocommerce_wpml = $woocommerce_wpml;
29
+
30
+ if ( ! $wpml_file ) {
31
+ $wpml_file = new WPML_File();
32
+ }
33
+
34
+ $this->wpml_file = $wpml_file;
35
+ }
36
+
37
+ public function init_hooks() {
38
+ add_action( 'after_setup_theme', array( $this, 'after_setup_theme_action' ) );
39
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_template_resources' ) );
40
+ add_action( 'admin_head', array( $this, 'admin_enqueue_template_resources' ) );
41
+ }
42
+
43
+ public function after_setup_theme_action() {
44
+ $this->init_available_templates();
45
+ }
46
+
47
+ /**
48
+ * @param string $template_slug
49
+ *
50
+ * @return WCML_CS_Template
51
+ */
52
+ public function get_template( $template_slug ) {
53
+ $ret = false;
54
+ if ( array_key_exists( $template_slug, $this->templates ) ) {
55
+ $ret = $this->templates[ $template_slug ];
56
+ }
57
+
58
+ return $ret;
59
+ }
60
+
61
+ /**
62
+ * @return array of active WCML_CS_Templates
63
+ */
64
+ public function get_active_templates() {
65
+
66
+ $templates = array();
67
+ $wcml_settings = $this->woocommerce_wpml->get_settings();
68
+
69
+ if( isset( $wcml_settings[ 'currency_switchers' ] ) ){
70
+ foreach( $wcml_settings[ 'currency_switchers' ] as $switcher ){
71
+ foreach( $this->templates as $key => $template ){
72
+ if( $switcher['switcher_style'] == $key && !isset( $templates[$key] ) ){
73
+ $templates[$key] = $template;
74
+ }
75
+ }
76
+ }
77
+ }else{
78
+ //set default template to active
79
+ $templates['wcml-dropdown'] = $this->templates['wcml-dropdown'];
80
+ }
81
+
82
+ return $templates;
83
+ }
84
+
85
+ /**
86
+ * @return array of template data
87
+ */
88
+ public function get_templates() {
89
+
90
+ $templates = array();
91
+
92
+ foreach( $this->templates as $key => $template ){
93
+
94
+ $template_data = $template->get_template_data();
95
+
96
+ if( isset( $template_data['is_core'] ) && $template_data['is_core'] ){
97
+ $templates[ 'core' ][ $key ] = $template_data;
98
+ }else{
99
+ $templates[ 'custom' ][ $key ] = $template_data;
100
+ }
101
+ }
102
+
103
+ return $templates;
104
+ }
105
+
106
+ /**
107
+ * @return null|string
108
+ */
109
+ private function get_uploads_path() {
110
+ if ( ! $this->uploads_path ) {
111
+ $uploads = wp_get_upload_dir();
112
+
113
+ if ( isset( $uploads['basedir'] ) ) {
114
+ $this->uploads_path = $uploads['basedir'];
115
+ }
116
+ }
117
+
118
+ return $this->uploads_path;
119
+ }
120
+
121
+ /**
122
+ * @param string $template_path
123
+ *
124
+ * @return array
125
+ */
126
+ private function parse_template_config( $template_path ) {
127
+ $config = array();
128
+ $configuration_file = $template_path . $this->ds . self::CONFIG_FILE;
129
+ if ( file_exists( $configuration_file ) ) {
130
+ $json_content = file_get_contents( $configuration_file );
131
+ $config = json_decode( $json_content, true );
132
+ }
133
+
134
+ return $config;
135
+ }
136
+
137
+ private function init_available_templates() {
138
+
139
+ $templates = array();
140
+ $dirs_to_scan = array();
141
+
142
+ /**
143
+ * Filter the directories to scan
144
+ *
145
+ * @param array $dirs_to_scan
146
+ */
147
+ $dirs_to_scan = apply_filters( 'wcml_cs_directories_to_scan', $dirs_to_scan );
148
+
149
+ $sub_dir = $this->ds . 'templates' . $this->ds . 'currency-switchers';
150
+
151
+ $wcml_core_path = WCML_PLUGIN_PATH . $sub_dir;
152
+ $theme_path = get_template_directory() . $this->ds . 'wpml' . $sub_dir;
153
+ $child_theme_path = get_stylesheet_directory() . $this->ds . 'wpml' . $sub_dir;
154
+ $uploads_path = $this->get_uploads_path() . $this->ds . 'wpml' . $sub_dir;
155
+
156
+ array_unshift( $dirs_to_scan, $wcml_core_path, $theme_path, $child_theme_path, $uploads_path );
157
+
158
+ $templates_paths = $this->scan_template_paths( $dirs_to_scan );
159
+
160
+ foreach ( $templates_paths as $template_path ) {
161
+ $template_path = $this->wpml_file->fix_dir_separator( $template_path );
162
+ if ( file_exists( $template_path . $this->ds . WCML_Currency_Switcher_Template::FILENAME ) ) {
163
+ $tpl = array();
164
+ $config = $this->parse_template_config( $template_path );
165
+
166
+ $tpl['path'] = $template_path;
167
+ $tpl['name'] = isset( $config['name'] ) ? $config['name'] : null;
168
+ $tpl['name'] = $this->get_unique_name( $tpl['name'], $template_path );
169
+ $tpl['slug'] = sanitize_title_with_dashes( $tpl['name'] );
170
+ $tpl['css'] = $this->get_files( 'css', $template_path, $config );
171
+ $tpl['js'] = $this->get_files( 'js', $template_path, $config );
172
+
173
+ if ( $this->is_core_template( $template_path ) ) {
174
+ $tpl['is_core'] = true;
175
+ $tpl['slug'] = isset( $config['slug'] ) ? $config['slug'] : $tpl['slug'];
176
+ }
177
+
178
+ $templates[ $tpl['slug'] ] = new WCML_Currency_Switcher_Template( $this->woocommerce_wpml, $tpl );
179
+ }
180
+ }
181
+
182
+ $this->set_templates( $templates );
183
+ }
184
+
185
+ /**
186
+ * @param array $dirs_to_scan
187
+ *
188
+ * @return array
189
+ */
190
+ private function scan_template_paths( $dirs_to_scan ) {
191
+ $templates_paths = array();
192
+
193
+ foreach ( $dirs_to_scan as $dir ) {
194
+ if ( !is_dir( $dir ) ) {
195
+ continue;
196
+ }
197
+ $files = scandir( $dir );
198
+ $files = array_diff( $files, array( '..', '.' ) );
199
+ if ( count( $files ) > 0 ) {
200
+ foreach ( $files as $file ) {
201
+ $template_path = $dir . '/' . $file;
202
+ if ( is_dir( $template_path )
203
+ && file_exists( $template_path . $this->ds . WCML_Currency_Switcher_Template::FILENAME )
204
+ && file_exists( $template_path . $this->ds . self::CONFIG_FILE )
205
+ ) {
206
+ $templates_paths[] = $template_path;
207
+ }
208
+ }
209
+ }
210
+ }
211
+
212
+ return $templates_paths;
213
+ }
214
+
215
+
216
+ /**
217
+ * @param string $ext
218
+ * @param string $template_path
219
+ * @param array $config
220
+ *
221
+ * @return array|null
222
+ */
223
+ private function get_files( $ext, $template_path, $config ) {
224
+ $resources = array();
225
+
226
+ if( isset( $config[ $ext ] ) ) {
227
+ $config[ $ext ] = is_array( $config[ $ext ] ) ? $config[ $ext ] : array( $config[ $ext ] );
228
+ foreach ( $config[ $ext ] as $file ) {
229
+ $file = untrailingslashit( $template_path ) .$this->ds . $file;
230
+ $resources[] = $this->wpml_file->get_uri_from_path( $file );
231
+ }
232
+ } else {
233
+ $search_path = $template_path . $this->ds . '*.' . $ext;
234
+ if ( glob( $search_path ) ) {
235
+ foreach ( glob( $search_path ) as $file ) {
236
+ $resources[] = $this->wpml_file->get_uri_from_path( $file );
237
+ }
238
+ }
239
+ }
240
+
241
+ return $resources;
242
+ }
243
+
244
+ /**
245
+ * @param string $path
246
+ *
247
+ * @return bool
248
+ */
249
+ private function is_core_template( $path ) {
250
+ return strpos( $path, WCML_PLUGIN_PATH ) === 0;
251
+ }
252
+
253
+ /**
254
+ * @param mixed|string|null $name
255
+ * @param string $path
256
+ *
257
+ * @return string
258
+ */
259
+ private function get_unique_name( $name, $path ) {
260
+ if ( is_null( $name ) ) {
261
+ $name = basename( $path );
262
+ }
263
+
264
+ if ( strpos( $path, $this->wpml_file->fix_dir_separator( get_template_directory() ) ) === 0 ) {
265
+ $theme = wp_get_theme();
266
+ $name = $theme . ' - ' . $name;
267
+ } elseif ( strpos( $path, $this->wpml_file->fix_dir_separator( $this->get_uploads_path() ) ) === 0 ) {
268
+ $name = __( 'Uploads', 'woocommerce-multilingual' ) . ' - ' . $name;
269
+ } elseif (
270
+ strpos( $path, $this->wpml_file->fix_dir_separator( WP_PLUGIN_DIR ) ) === 0
271
+ && ! $this->is_core_template( $path )
272
+ ) {
273
+ $plugin_dir = $this->wpml_file->fix_dir_separator( WP_PLUGIN_DIR );
274
+ $plugin_dir = preg_replace( '#' . preg_quote( $plugin_dir ) . '#' , '', $path, 1 );
275
+ $plugin_dir = ltrim( $plugin_dir, $this->ds );
276
+ $plugin_dir = explode( $this->ds, $plugin_dir );
277
+
278
+ if ( isset( $plugin_dir[0] ) ) {
279
+ $require = ABSPATH . 'wp-admin' . $this->ds . 'includes' . $this->ds . 'plugin.php';
280
+ require_once( $require );
281
+ foreach ( get_plugins() as $slug => $plugin ) {
282
+ if ( strpos( $slug, $plugin_dir[0] ) === 0 ) {
283
+ $name = $plugin['Name'] . ' - ' . $name;
284
+ break;
285
+ }
286
+ }
287
+ } else {
288
+ $name = substr( md5( $path ), 0, 8 ) . ' - ' . $name;
289
+ }
290
+ }
291
+
292
+ return $name;
293
+ }
294
+
295
+ public function enqueue_template_resources( $templates = false ) {
296
+
297
+ if( !$templates ){
298
+ $templates = $this->get_active_templates();
299
+ }
300
+
301
+ $wcml_settings = $this->woocommerce_wpml->get_settings();
302
+
303
+ foreach( $templates as $slug => $template ) {
304
+
305
+ foreach ( $template->get_scripts() as $k => $url ) {
306
+ wp_enqueue_script( $template->get_resource_handler( $k ), $url, array(), WCML_VERSION );
307
+ }
308
+
309
+ foreach ( $template->get_styles() as $k => $url ) {
310
+ wp_enqueue_style( $template->get_resource_handler( $k ), $url, array(), WCML_VERSION );
311
+
312
+ }
313
+
314
+ if ( $template->has_styles() ) {
315
+ $style_handler = $template->get_inline_style_handler();
316
+ }
317
+ }
318
+
319
+ if( isset( $wcml_settings[ 'currency_switchers' ] ) ){
320
+ foreach( $wcml_settings[ 'currency_switchers' ] as $key => $switcher_data ){
321
+
322
+ $switcher_template = $switcher_data['switcher_style'];
323
+ $css = $this->get_color_picket_css( $key, $switcher_data );
324
+ $template = $templates[ $switcher_template ];
325
+
326
+ if ( $template->has_styles() ) {
327
+ wp_add_inline_style( $template->get_inline_style_handler(), $css );
328
+ }else{
329
+ echo $this->get_inline_style( $key, $switcher_template, $css );
330
+ }
331
+ }
332
+ }
333
+
334
+ if ( ! empty( $wcml_settings['currency_switcher_additional_css'] ) ) {
335
+ $additional_css = $this->sanitize_css( $wcml_settings['currency_switcher_additional_css'] );
336
+
337
+ if( $style_handler ){
338
+ wp_add_inline_style( $style_handler, $additional_css );
339
+ }else{
340
+ echo $this->get_inline_style( 'currency_switcher', 'additional_css', $additional_css );
341
+ }
342
+ }
343
+
344
+ }
345
+
346
+ /**
347
+ * @param string $css
348
+ *
349
+ * @return string
350
+ */
351
+ private function sanitize_css( $css ) {
352
+ $css = wp_strip_all_tags( $css );
353
+ $css = preg_replace('/\s+/S', " ", trim( $css ) );
354
+ return $css;
355
+ }
356
+
357
+ public function admin_enqueue_template_resources(){
358
+ if( isset( $_GET['page'] ) && $_GET['page'] == 'wpml-wcml' && isset( $_GET['tab'] ) && $_GET['tab'] == 'multi-currency' ){
359
+ $this->enqueue_template_resources( $this->templates );
360
+ }
361
+ }
362
+
363
+ public function get_color_picket_css( $switcher_id, $switcher_data ){
364
+
365
+ $css = '';
366
+ $wrapper_class = '.'.$switcher_id.'.'.$switcher_data[ 'switcher_style' ];
367
+
368
+ if ( $switcher_data[ 'color_scheme' ][ 'border_normal' ] ) {
369
+ $css .= "$wrapper_class, $wrapper_class li, $wrapper_class li li{";
370
+ $css .= "border-color:". $switcher_data[ 'color_scheme' ][ 'border_normal' ] ." ;";
371
+ $css .= "}";
372
+ }
373
+
374
+ if ( $switcher_data[ 'color_scheme' ][ 'font_other_normal' ] || $switcher_data[ 'color_scheme' ][ 'background_other_normal' ] ) {
375
+ $css .= "$wrapper_class li>a {";
376
+ $css .= $switcher_data[ 'color_scheme' ][ 'font_other_normal' ] ? "color:". $switcher_data[ 'color_scheme' ][ 'font_other_normal' ] .";" : '';
377
+ $css .= $switcher_data[ 'color_scheme' ][ 'background_other_normal' ] ? "background-color:". $switcher_data[ 'color_scheme' ][ 'background_other_normal' ] .";" : '';
378
+ $css .= "}";
379
+ }
380
+
381
+ if ( $switcher_data[ 'color_scheme' ][ 'font_other_hover' ] || $switcher_data[ 'color_scheme' ][ 'background_other_hover' ] ) {
382
+ $css .= "$wrapper_class li:hover>a, $wrapper_class li:focus>a {";
383
+ $css .= $switcher_data[ 'color_scheme' ][ 'font_other_hover' ] ? "color:". $switcher_data[ 'color_scheme' ][ 'font_other_hover' ] .";" : '';
384
+ $css .= $switcher_data[ 'color_scheme' ][ 'background_other_hover' ] ? "background-color:". $switcher_data[ 'color_scheme' ][ 'background_other_hover' ] .";" : '';
385
+ $css .= "}";
386
+ }
387
+
388
+ if ( $switcher_data[ 'color_scheme' ][ 'font_current_normal' ] || $switcher_data[ 'color_scheme' ][ 'background_current_normal' ] ) {
389
+ $css .= "$wrapper_class .wcml-cs-active-currency>a {";
390
+ $css .= $switcher_data[ 'color_scheme' ][ 'font_current_normal' ] ? "color:". $switcher_data[ 'color_scheme' ][ 'font_current_normal' ] .";" : '';
391
+ $css .= $switcher_data[ 'color_scheme' ][ 'background_current_normal' ] ? "background-color:". $switcher_data[ 'color_scheme' ][ 'background_current_normal' ] .";" : '';
392
+ $css .= "}";
393
+ }
394
+
395
+ if ( $switcher_data[ 'color_scheme' ][ 'font_current_hover' ]|| $switcher_data[ 'color_scheme' ][ 'background_current_hover' ] ) {
396
+ $css .= "$wrapper_class .wcml-cs-active-currency:hover>a, $wrapper_class .wcml-cs-active-currency:focus>a {";
397
+ $css .= $switcher_data[ 'color_scheme' ][ 'font_current_hover' ] ? "color:". $switcher_data[ 'color_scheme' ][ 'font_current_hover' ] .";" : '';
398
+ $css .= $switcher_data[ 'color_scheme' ][ 'background_current_hover' ] ? "background-color:". $switcher_data[ 'color_scheme' ][ 'background_current_hover' ] .";" : '';
399
+ $css .= "}";
400
+ }
401
+
402
+ return $css;
403
+ }
404
+
405
+
406
+ public function get_inline_style( $switcher_id, $switcher_template, $css ) {
407
+ $style_id = 'wcml-cs-inline-styles-' . $switcher_id.'-'.$switcher_template;
408
+ return '<style type="text/css" id="' . $style_id . '">' . $css . '</style>' . PHP_EOL;
409
+ }
410
+
411
+ public function set_templates( $templates ) {
412
+ $this->templates = $templates;
413
+ }
414
+ }
inc/currencies/currency-switcher/class-wcml-currency-switcher-widget.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WCML_Currency_Switcher_Widget extends WP_Widget {
4
+
5
+ const SLUG = 'currency_sel_widget';
6
+
7
+ function __construct() {
8
+ parent::__construct( 'currency_sel_widget', __('Currency switcher', 'woocommerce-multilingual'), array(), array() );
9
+ }
10
+
11
+ function widget($args, $instance) {
12
+
13
+ echo $args['before_widget'];
14
+
15
+ if( isset( $instance['settings']['widget_title'] ) && !empty( $instance['settings']['widget_title'] ) ){
16
+ $widget_title = apply_filters( 'widget_title', $instance['settings']['widget_title'] );
17
+ echo $args['before_title']. $widget_title . $args['after_title'];
18
+ }
19
+
20
+ do_action( 'wcml_currency_switcher', array( 'switcher_id' => $args[ 'id' ] ) );
21
+
22
+ echo $args['after_widget'];
23
+ }
24
+
25
+ public function update( $new_instance, $old_instance ) {
26
+
27
+ if ( ! $new_instance ) {
28
+ $new_instance = array(
29
+ 'id' => $_POST['sidebar'],
30
+ 'settings' => WCML_Currency_Switcher::get_settings( $_POST['sidebar'] )
31
+ );
32
+ }
33
+
34
+ return $new_instance;
35
+ }
36
+
37
+ function form( $instance ) {
38
+ if ( ! isset( $instance[ 'id' ] ) ) {
39
+ $instance[ 'id' ] = '';
40
+ }
41
+
42
+ $url_to_currency_switcher = esc_url( admin_url( 'admin.php?page=wpml-wcml&tab=multi-currency#currency-switcher/' . (int) $instance[ 'id' ] ) );
43
+ $button_text = esc_html__( 'Customize the currency switcher', 'woocommerce-multilingual' );
44
+ printf('<p><a class="button button-secondary wcml-cs-widgets-edit-link" href="%s"><span class="otgs-ico-edit"></span> %s</a></p>', $url_to_currency_switcher, $button_text );
45
+ }
46
+
47
+ }
inc/currencies/currency-switcher/class-wcml-currency-switcher.php ADDED
@@ -0,0 +1,278 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class WCML_Currency_Switcher
5
+ *
6
+ * Main class
7
+ */
8
+ class WCML_Currency_Switcher{
9
+
10
+ private $woocommerce_wpml;
11
+ private $sitepress;
12
+ private $is_touch_screen;
13
+
14
+ public function __construct( &$woocommerce_wpml, &$sitepress ) {
15
+
16
+ $this->woocommerce_wpml = $woocommerce_wpml;
17
+ $this->sitepress = $sitepress;
18
+
19
+ add_action( 'init', array($this, 'init'), 5 );
20
+ }
21
+
22
+ public function init() {
23
+
24
+ add_action( 'wcml_currency_switcher', array($this, 'wcml_currency_switcher') );
25
+ //@deprecated 3.9
26
+ add_action( 'currency_switcher', array($this, 'currency_switcher') );
27
+
28
+ add_shortcode( 'currency_switcher', array($this, 'currency_switcher_shortcode') );
29
+
30
+ // Built in currency switcher
31
+ add_action( 'woocommerce_product_meta_start', array($this, 'show_currency_switcher') );
32
+
33
+ add_action( 'pre_update_option_sidebars_widgets', array( $this, 'update_option_sidebars_widgets' ), 10, 2 );
34
+ }
35
+
36
+ public static function get_settings( $switcher_id ) {
37
+ global $woocommerce_wpml;
38
+
39
+ $wcml_settings = $woocommerce_wpml->get_settings();
40
+
41
+ return isset( $wcml_settings[ 'currency_switchers' ][ $switcher_id ] ) ? $wcml_settings[ 'currency_switchers' ][ $switcher_id ] : array();
42
+ }
43
+
44
+ public function currency_switcher_shortcode( $atts ) {
45
+ extract( shortcode_atts( array(), $atts ) );
46
+
47
+ ob_start();
48
+ $this->wcml_currency_switcher( $atts );
49
+ $html = ob_get_contents();
50
+ ob_end_clean();
51
+
52
+ return $html;
53
+ }
54
+
55
+ public function wcml_currency_switcher( $args = array() ) {
56
+ if ( is_page( wc_get_page_id( 'myaccount' ) ) ) {
57
+ return '';
58
+ }
59
+
60
+ if( empty( $args ) ){
61
+ $args = array(
62
+ 'switcher_id' => 'product'
63
+ );
64
+ }
65
+
66
+ $wcml_settings = $this->woocommerce_wpml->get_settings();
67
+ $multi_currency_object =& $this->woocommerce_wpml->multi_currency;
68
+
69
+ if( isset( $args[ 'switcher_id' ] ) && isset( $wcml_settings[ 'currency_switchers' ][ $args[ 'switcher_id' ] ] ) ){
70
+
71
+ $currency_switcher_settings = $wcml_settings[ 'currency_switchers' ][ $args[ 'switcher_id' ] ];
72
+
73
+ if ( !isset( $args[ 'switcher_style' ] ) ) {
74
+ $args[ 'switcher_style' ] = isset( $currency_switcher_settings[ 'switcher_style' ] ) ? $currency_switcher_settings[ 'switcher_style' ] : 'wcml-dropdown';
75
+ }
76
+
77
+ if ( !isset( $args[ 'format' ] ) ) {
78
+ $args[ 'format' ] = isset( $currency_switcher_settings[ 'template' ] ) && $currency_switcher_settings[ 'template' ] != '' ?
79
+ $currency_switcher_settings[ 'template' ] : '%name% (%symbol%) - %code%';
80
+ }
81
+
82
+ if ( !isset( $args[ 'color_scheme' ] ) ) {
83
+ $args[ 'color_scheme' ] = isset($currency_switcher_settings['color_scheme']) ? $currency_switcher_settings['color_scheme'] : array();
84
+ }
85
+
86
+ }elseif( !isset( $args[ 'switcher_style' ] ) ){
87
+ $args[ 'switcher_style' ] = 'wcml-dropdown';
88
+ }
89
+
90
+ $preview = '';
91
+ $show_currency_switcher = true;
92
+
93
+ $display_custom_prices = isset( $wcml_settings[ 'display_custom_prices' ] ) && $wcml_settings[ 'display_custom_prices' ];
94
+ $is_cart_or_checkout = is_page( wc_get_page_id( 'cart' ) ) || is_page( wc_get_page_id( 'checkout' ) );
95
+
96
+ if ( $display_custom_prices ) {
97
+ if( $is_cart_or_checkout ){
98
+ $show_currency_switcher = false;
99
+ }elseif( is_product() ){
100
+ $current_product_id = get_post()->ID;
101
+ $original_product_language = $this->woocommerce_wpml->products->get_original_product_language( $current_product_id );
102
+ $use_custom_prices = get_post_meta(
103
+ apply_filters( 'translate_object_id', $current_product_id, get_post_type( $current_product_id ), true, $original_product_language ),
104
+ '_wcml_custom_prices_status',
105
+ true
106
+ );
107
+
108
+ if ( !$use_custom_prices ) $show_currency_switcher = false;
109
+ }
110
+ }
111
+
112
+ if ( $show_currency_switcher ) {
113
+
114
+ $currencies = isset($wcml_settings['currencies_order']) ?
115
+ $wcml_settings['currencies_order'] :
116
+ $multi_currency_object->get_currency_codes();
117
+
118
+ if ( count($currencies) > 1) {
119
+ if ( !is_admin() ) {
120
+ foreach ( $currencies as $k => $currency ) {
121
+ if ( $wcml_settings['currency_options'][$currency]['languages'][$this->sitepress->get_current_language()] != 1 ) {
122
+ unset( $currencies[$k] );
123
+ }
124
+ }
125
+ }
126
+
127
+ $template = $this->woocommerce_wpml->cs_templates->get_template( $args[ 'switcher_style' ] );
128
+ $template->set_model( $this->get_model_data( $args, $currencies ) );
129
+ $preview = $template->get_view();
130
+ } else{
131
+
132
+ if( is_admin() ){
133
+ $preview = '<i>' . esc_html__("You haven't added any secondary currencies.", 'woocommerce-multilingual') . '</i>';
134
+ }else{
135
+ $preview = '';
136
+ }
137
+ }
138
+ }
139
+
140
+ if ( !isset($args['echo']) || $args['echo'] ) {
141
+ echo $preview;
142
+ } else {
143
+ return $preview;
144
+ }
145
+ }
146
+
147
+ public function get_model_data( $args, $currencies ){
148
+
149
+ $css_classes = $this->get_css_classes( array( $args[ 'switcher_style' ], $args[ 'switcher_id' ], 'wcml_currency_switcher' ) );
150
+
151
+ $model = array(
152
+ 'css_classes' => $css_classes,
153
+ 'format' => isset( $args['format'] ) ? $args['format'] : '%name% (%symbol%) - %code%',
154
+ 'currencies' => $currencies,
155
+ 'selected_currency' => $this->woocommerce_wpml->multi_currency->get_client_currency()
156
+ );
157
+
158
+ return $model;
159
+ }
160
+
161
+ public function get_css_classes( $classes = array() ){
162
+
163
+ if ( $this->sitepress->is_rtl( $this->sitepress->get_current_language() ) ) {
164
+ $classes[] = 'wcml-cs-rtl';
165
+ }
166
+
167
+ $classes = $this->add_user_agent_touch_device_classes( $classes );
168
+ $classes = apply_filters( 'wcml_cs_template_css_classes', $classes );
169
+
170
+ return implode( ' ', $classes );
171
+ }
172
+
173
+ public function add_user_agent_touch_device_classes( $classes ) {
174
+
175
+ if ( is_null( $this->is_touch_screen ) ) {
176
+ if ( ! class_exists( 'WPML_Mobile_Detect' ) ) {
177
+ require_once ICL_PLUGIN_PATH . '/lib/mobile-detect.php';
178
+ }
179
+ $mobile_detect = new WPML_Mobile_Detect();
180
+ $this->is_touch_screen = $mobile_detect->isMobile() || $mobile_detect->isTablet();
181
+ }
182
+
183
+ if ( $this->is_touch_screen ) {
184
+ $classes[] = 'wcml-cs-touch-device';
185
+ }
186
+
187
+ return $classes;
188
+ }
189
+
190
+ public function show_currency_switcher() {
191
+ $settings = $this->woocommerce_wpml->get_settings();
192
+
193
+ if ( is_product() && isset($settings['currency_switcher_product_visibility']) && $settings['currency_switcher_product_visibility'] === 1 ) {
194
+ echo( do_shortcode( '[currency_switcher]' ) );
195
+ }
196
+ }
197
+
198
+ /**
199
+ * @deprecated 3.9
200
+ */
201
+ public function currency_switcher( $args = array() ){
202
+ $this->wcml_currency_switcher( $args );
203
+ }
204
+
205
+ /**
206
+ * @return array
207
+ */
208
+ public function get_registered_sidebars() {
209
+ global $wp_registered_sidebars;
210
+
211
+ return is_array( $wp_registered_sidebars ) ? $wp_registered_sidebars : array();
212
+ }
213
+
214
+ public function get_available_sidebars(){
215
+ $sidebars = $this->get_registered_sidebars();
216
+ $wcml_settings = $this->woocommerce_wpml->get_settings();
217
+
218
+ foreach( $sidebars as $key => $sidebar ){
219
+ if ( isset( $wcml_settings[ 'currency_switchers' ][ $sidebar[ 'id' ] ] ) ){
220
+ unset( $sidebars[ $key ] );
221
+ }
222
+ }
223
+
224
+ return $sidebars;
225
+ }
226
+
227
+ public function update_option_sidebars_widgets( $sidebars, $old_sidebars ) {
228
+
229
+ foreach ( $sidebars as $sidebar => $widgets ) {
230
+ if ( 'wp_inactive_widgets' === $sidebar ) {
231
+ continue;
232
+ }
233
+ $found = false;
234
+ if ( is_array( $widgets ) ) {
235
+ foreach ( $widgets as $key => $widget_id ) {
236
+ if ( strpos($widget_id, WCML_Currency_Switcher_Widget::SLUG ) === 0 ) {
237
+ if ( $found ) { //Only one CS widget instance per sidebar
238
+ unset($sidebars[$sidebar][$key]);
239
+ continue;
240
+ }
241
+ $found = true;
242
+ }
243
+ }
244
+ }
245
+
246
+ $wcml_settings = $this->woocommerce_wpml->get_settings();
247
+ if( $found && empty( $wcml_settings[ 'currency_switchers' ][ $sidebar ] ) ){
248
+ $wcml_settings[ 'currency_switchers' ][ $sidebar ] = $this->get_switcher_default_settings();
249
+ }elseif( !$found && isset( $wcml_settings[ 'currency_switchers' ][ $sidebar ] ) ){
250
+ unset( $wcml_settings[ 'currency_switchers' ][ $sidebar ] );
251
+ }
252
+
253
+ $this->woocommerce_wpml->update_settings( $wcml_settings );
254
+ }
255
+
256
+ return $sidebars;
257
+ }
258
+
259
+ public function get_switcher_default_settings(){
260
+ return array(
261
+ 'switcher_style' => 'wcml-dropdown',
262
+ 'widget_title' => '',
263
+ 'template' => '%name% (%symbol%) - %code%',
264
+ 'color_scheme' => array(
265
+ 'font_current_normal' => '',
266
+ 'font_current_hover' => '',
267
+ 'background_current_normal' => '',
268
+ 'background_current_hover' => '',
269
+ 'font_other_normal' => '',
270
+ 'font_other_hover' => '',
271
+ 'background_other_normal' => '',
272
+ 'background_other_hover' => '',
273
+ 'border_normal' => ''
274
+ )
275
+ );
276
+ }
277
+
278
+ }
inc/rest-api-support/class-wcml-rest-api-suport.php ADDED
@@ -0,0 +1,385 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WCML_REST_API_Support{
4
+
5
+ /** @var woocommerce_wpml */
6
+ private $woocommerce_wpml;
7
+ /** @var Sitepress */
8
+ private $sitepress;
9
+
10
+ function __construct( &$woocommerce_wpml, &$sitepress ) {
11
+
12
+ $this->woocommerce_wpml =& $woocommerce_wpml;
13
+ $this->sitepress =& $sitepress;
14
+
15
+ $this->prevent_default_lang_url_redirect();
16
+
17
+ add_action( 'rest_api_init', array( $this, 'set_language_for_request' ) );
18
+
19
+ add_action( 'parse_query', array($this, 'auto_adjust_included_ids') );
20
+
21
+ // Products
22
+ add_action( 'woocommerce_rest_prepare_product', array( $this, 'append_product_language_and_translations' ) );
23
+ add_action( 'woocommerce_rest_prepare_product', array( $this, 'append_product_secondary_prices' ) );
24
+
25
+ add_filter( 'woocommerce_rest_product_query', array( $this, 'filter_products_query' ), 10, 2 );
26
+
27
+
28
+ add_action( 'woocommerce_rest_insert_product', array( $this, 'set_product_language' ), 10 , 2 );
29
+ add_action( 'woocommerce_rest_update_product', array( $this, 'set_product_language' ), 10 , 2 );
30
+
31
+ add_action( 'woocommerce_rest_insert_product', array( $this, 'set_product_custom_prices' ), 10 , 2 );
32
+ add_action( 'woocommerce_rest_update_product', array( $this, 'set_product_custom_prices' ), 10 , 2 );
33
+
34
+ // Orders
35
+ add_filter( 'woocommerce_rest_shop_order_query', array( $this, 'filter_orders_by_language' ), 20, 2 );
36
+ add_action( 'woocommerce_rest_prepare_shop_order', array( $this, 'filter_order_items_by_language'), 10, 3 );
37
+ add_action( 'woocommerce_rest_insert_shop_order' , array( $this, 'set_order_language' ), 10, 2 );
38
+
39
+ // Terms
40
+ add_action( 'woocommerce_rest_product_cat_query', array($this, 'filter_terms_query' ), 10, 2 );
41
+ add_action( 'woocommerce_rest_product_tag_query', array($this, 'filter_terms_query' ), 10, 2 );
42
+
43
+ }
44
+
45
+ /**
46
+ * @param $wp_rest_server
47
+ * enforces the language of request as the current language to be able to filter items by language
48
+ */
49
+ public function set_language_for_request( $wp_rest_server ){
50
+ if( isset( $_GET['lang'] ) ){
51
+ $request_language = $_GET['lang'];
52
+ $active_languages = $this->sitepress->get_active_languages();
53
+ if( isset( $active_languages[ $request_language ] ) ){
54
+ $this->sitepress->switch_lang( $request_language );
55
+ }
56
+ }
57
+
58
+ }
59
+
60
+ /**
61
+ * Check if is request to the WooCommerce REST API.
62
+ *
63
+ * @return bool
64
+ */
65
+ protected static function is_request_to_rest_api() {
66
+ if ( empty( $_SERVER['REQUEST_URI'] ) ) {
67
+ return false;
68
+ }
69
+
70
+ $rest_prefix = trailingslashit( rest_get_url_prefix() );
71
+ // Check if WooCommerce endpoint.
72
+ $woocommerce = ( false !== strpos( $_SERVER['REQUEST_URI'], $rest_prefix . 'wc/' ) );
73
+
74
+ return apply_filters( 'woocommerce_rest_is_request_to_rest_api', $woocommerce );
75
+ }
76
+
77
+ /**
78
+ * Prevent WPML redirection when using the default language as a parameter in the url
79
+ */
80
+ private function prevent_default_lang_url_redirect(){
81
+
82
+ if( self::is_request_to_rest_api() ) {
83
+ $exp = explode( '?', $_SERVER['REQUEST_URI'] );
84
+ if ( ! empty( $exp[1] ) ) {
85
+ parse_str( $exp[1], $vars );
86
+ if ( isset($vars['lang']) && $vars['lang'] === $this->sitepress->get_default_language() ) {
87
+ unset( $vars['lang'] );
88
+ $_SERVER['REQUEST_URI'] = $exp[0] . '?' . http_build_query( $vars );
89
+ }
90
+ }
91
+ }
92
+ }
93
+
94
+ // Use url without the language parameter. Needed for the signature match.
95
+ public static function remove_wpml_global_url_filters(){
96
+ if( self::is_request_to_rest_api() ) {
97
+ global $wpml_url_filters;
98
+ remove_filter( 'home_url', array( $wpml_url_filters, 'home_url_filter' ), - 10 );
99
+ }
100
+ }
101
+
102
+ /**
103
+ * When lang=all don't filter products by language
104
+ *
105
+ * @param array $args
106
+ * @param WP_REST_Request $request
107
+ *
108
+ * @return array
109
+ */
110
+ public function filter_products_query( $args, $request ){
111
+ $data = $request->get_params();
112
+ if( isset( $data['lang'] ) && $data['lang'] === 'all' ){
113
+ global $wpml_query_filter;
114
+ remove_filter( 'posts_join', array( $wpml_query_filter, 'posts_join_filter' ), 10 );
115
+ remove_filter( 'posts_where', array( $wpml_query_filter, 'posts_where_filter' ), 10 );
116
+ }
117
+ return $args;
118
+ }
119
+
120
+ /**
121
+ * When lang=all don't filter terms by language
122
+ *
123
+ * @param array $args
124
+ * @param WP_REST_Request $request
125
+ *
126
+ * @return array
127
+ */
128
+ public function filter_terms_query( $args, $request ){
129
+ $data = $request->get_params();
130
+ if( isset( $data['lang'] ) && $data['lang'] === 'all' ){
131
+ remove_filter( 'terms_clauses', array( $this->sitepress, 'terms_clauses' ), 10, 4 );
132
+ remove_filter( 'get_term', array( $this->sitepress, 'get_term_adjust_id' ), 1, 1 );
133
+ }
134
+ return $args;
135
+ }
136
+
137
+ /**
138
+ * @param WP_Query $wp_query
139
+ */
140
+ public function auto_adjust_included_ids( $wp_query ){
141
+ $lang = $wp_query->get('lang');
142
+ $include = $wp_query->get('post__in');
143
+ if( empty( $lang ) && !empty( $include ) ){
144
+ $filtered_include = [];
145
+ foreach( $include as $id ){
146
+ $filtered_include[] = apply_filters( 'translate_object_id', $id, get_post_type($id), true );
147
+ }
148
+ $wp_query->set( 'post__in' , $filtered_include );
149
+ }
150
+ }
151
+
152
+ /**
153
+ * Appends the language and translation information to the get_product response
154
+ *
155
+ * @param $product_data
156
+ */
157
+ public function append_product_language_and_translations( $product_data ){
158
+
159
+ $product_data->data['translations'] = array();
160
+
161
+ $trid = $this->sitepress->get_element_trid( $product_data->data['id'], 'post_product' );
162
+
163
+ if( $trid ) {
164
+ $translations = $this->sitepress->get_element_translations( $trid, 'post_product' );
165
+ foreach ( $translations as $translation ) {
166
+ if ( $translation->element_id == $product_data->data['id'] ) {
167
+ $product_language = $translation->language_code;
168
+ } else {
169
+ $product_data->data['translations'][ $translation->language_code ] = $translation->element_id;
170
+ }
171
+ }
172
+
173
+ $product_data->data['lang'] = $product_language;
174
+ }
175
+
176
+ return $product_data;
177
+ }
178
+
179
+ /**
180
+ * Appends the secondary prices information to the get_product response
181
+ *
182
+ * @param $product_data
183
+ */
184
+ public function append_product_secondary_prices( $product_data ){
185
+
186
+ if( !empty($this->woocommerce_wpml->multi_currency) && !empty($this->woocommerce_wpml->settings['currencies_order']) ){
187
+
188
+ $product_data->data['multi-currency-prices'] = array();
189
+
190
+ $custom_prices_on = get_post_meta( $product_data->data['id'], '_wcml_custom_prices_status', true);
191
+
192
+ foreach( $this->woocommerce_wpml->settings['currencies_order'] as $currency ){
193
+
194
+ if( $currency != get_option('woocommerce_currency') ){
195
+
196
+ if( $custom_prices_on ){
197
+
198
+ $custom_prices = (array) $this->woocommerce_wpml->multi_currency->custom_prices->get_product_custom_prices( $product_data->data['id'], $currency );
199
+ foreach( $custom_prices as $key => $price){
200
+ $product_data->data['multi-currency-prices'][$currency][ preg_replace('#^_#', '', $key) ] = $price;
201
+
202
+ }
203
+
204
+ } else {
205
+ $product_data->data['multi-currency-prices'][$currency]['regular_price'] =
206
+ $this->woocommerce_wpml->multi_currency->prices->raw_price_filter( $product_data->data['regular_price'], $currency );
207
+ if( !empty($product_data->data['sale_price']) ){
208
+ $product_data->data['multi-currency-prices'][$currency]['sale_price'] =
209
+ $this->woocommerce_wpml->multi_currency->prices->raw_price_filter( $product_data->data['sale_price'], $currency );
210
+ }
211
+ }
212
+
213
+ }
214
+
215
+ }
216
+
217
+ }
218
+
219
+ return $product_data;
220
+ }
221
+
222
+ /**
223
+ * Sets the product information according to the provided language
224
+ *
225
+ * @param WP_Post $post
226
+ * @param WP_REST_Request $request
227
+ *
228
+ * @throws WC_API_Exception
229
+ *
230
+ */
231
+ public function set_product_language( $post, $request ){
232
+
233
+ $data = $request->get_params();
234
+
235
+ if( isset( $data['lang'] )){
236
+ $active_languages = $this->sitepress->get_active_languages();
237
+ if( !isset( $active_languages[$data['lang']] ) ){
238
+ throw new WC_REST_Exception( '404', sprintf( __( 'Invalid language parameter: %s', 'woocommerce-multilingual' ), $data['lang'] ), '404' );
239
+ }
240
+ if( isset( $data['translation_of'] ) ){
241
+ $trid = $this->sitepress->get_element_trid( $data['translation_of'], 'post_product' );
242
+ if( empty($trid) ){
243
+ throw new WC_REST_Exception( '404', sprintf( __( 'Source product id not found: %s', 'woocommerce-multilingual' ), $data['translation_of'] ), '404' );
244
+ }
245
+ }else{
246
+ $trid = null;
247
+ }
248
+ $this->sitepress->set_element_language_details( $post->ID, 'post_product', $trid, $data['lang'] );
249
+ wpml_tm_save_post( $post->ID, $post , ICL_TM_COMPLETE );
250
+ }else{
251
+ if( isset( $data['translation_of'] ) ){
252
+ throw new WC_REST_Exception( '404', __( 'Using "translation_of" requires providing a "lang" parameter too', 'woocommerce-multilingual' ), '404' );
253
+ }
254
+ }
255
+
256
+ }
257
+
258
+ /**
259
+ * Sets custom prices in secondary currencies for products
260
+ *
261
+ * @param WP_Post $post
262
+ * @param WP_REST_Request $request
263
+ *
264
+ * @throws WC_API_Exception
265
+ *
266
+ */
267
+ public function set_product_custom_prices( $post, $request ){
268
+
269
+ $data = $request->get_params();
270
+
271
+ if( !empty( $this->woocommerce_wpml->multi_currency ) ){
272
+
273
+ if( !empty( $data['custom_prices'] ) ){
274
+
275
+ $original_post_id = $this->sitepress->get_original_element_id_filter('', $post->ID, 'post_product' );
276
+
277
+ update_post_meta( $original_post_id, '_wcml_custom_prices_status', 1);
278
+
279
+ foreach( $data['custom_prices'] as $currency => $prices ){
280
+
281
+ $prices_uscore = array();
282
+ foreach( $prices as $k => $p){
283
+ $prices_uscore['_' . $k] = $p;
284
+ }
285
+ $this->woocommerce_wpml->multi_currency->custom_prices->update_custom_prices( $original_post_id, $prices_uscore, $currency );
286
+
287
+ }
288
+
289
+ }
290
+ }
291
+
292
+ }
293
+
294
+ public function filter_orders_by_language( $args, $request ){
295
+
296
+ $lang = $request->get_param( 'lang' );
297
+
298
+ if( !is_null( $lang ) && $lang !== 'all' ){
299
+
300
+ $args['meta_query'][] = array(
301
+ 'key' => 'wpml_language',
302
+ 'value' => strval( $lang )
303
+ );
304
+
305
+ }
306
+
307
+ return $args;
308
+ }
309
+
310
+ /**
311
+ * Filters the items of an order according to a given languages
312
+ *
313
+ * @param $order_data
314
+ * @param $order
315
+ * @param $fields
316
+ * @param $server
317
+ * @return mixed
318
+ */
319
+
320
+ public function filter_order_items_by_language( $response, $order, $request ){
321
+
322
+ $lang = get_query_var('lang');
323
+
324
+ $order_lang = get_post_meta( $order->ID, 'wpml_language', true );
325
+
326
+ if( $order_lang != $lang ){
327
+
328
+ foreach( $response->data['line_items'] as $k => $item ){
329
+
330
+ global $wpdb;
331
+ $sql = "SELECT meta_value FROM {$wpdb->prefix}woocommerce_order_itemmeta WHERE order_item_id=%d AND meta_key='_product_id'";
332
+ $product_id = $wpdb->get_var( $wpdb->prepare( $sql, $item['id']) );
333
+
334
+ if( $product_id ){
335
+
336
+ $translated_product_id = apply_filters( 'translate_object_id', $product_id, 'product', true, $lang );
337
+
338
+ if( $translated_product_id ){
339
+ $translated_product = get_post( $translated_product_id );
340
+ $response->data['line_items'][$k]['product_id'] = $translated_product_id;
341
+ if( $translated_product->post_type == 'product_variation' ){
342
+ $post_parent = get_post( $translated_product->post_parent );
343
+ $post_name = $post_parent->post_title;
344
+ } else {
345
+ $post_name = $translated_product->post_title;
346
+ }
347
+ $response->data['line_items'][$k]['name'] = $post_name;
348
+ }
349
+
350
+ }
351
+
352
+ }
353
+
354
+ }
355
+
356
+ return $response;
357
+ }
358
+
359
+ /**
360
+ * Sets the language for a new order
361
+ *
362
+ * @param $order_id
363
+ * @param $data
364
+ *
365
+ * @throws WC_API_Exception
366
+ */
367
+ public function set_order_language( $post, $request ){
368
+
369
+ $data = $request->get_params();
370
+ if( isset( $data['lang'] ) ){
371
+ $order_id = $post->ID;
372
+ $active_languages = $this->sitepress->get_active_languages();
373
+ if( !isset( $active_languages[$data['lang']] ) ){
374
+ throw new WC_REST_Exception( '404', sprintf( __( 'Invalid language parameter: %s' ), $data['lang'] ), '404' );
375
+ }
376
+
377
+ update_post_meta( $order_id, 'wpml_language', $data['lang'] );
378
+
379
+ }
380
+
381
+ }
382
+
383
+
384
+
385
+ }
inc/template-classes/class-wcml-custom-files-ui.php CHANGED
@@ -35,7 +35,7 @@ class WCML_Custom_Files_UI extends WPML_Templates_Factory {
35
  'strings' => array(
36
  'use_custom' => __( 'Use custom settings for translations download files', 'woocommerce-multilingual' ),
37
  'use_same' => __( 'Use the same files for translations', 'woocommerce-multilingual' ),
38
- 'separate' => __( 'Add separate download files for translations', 'woocommerce-multilingual' )
39
  )
40
  );
41
 
35
  'strings' => array(
36
  'use_custom' => __( 'Use custom settings for translations download files', 'woocommerce-multilingual' ),
37
  'use_same' => __( 'Use the same files for translations', 'woocommerce-multilingual' ),
38
+ 'separate' => __( 'Add separate download files for translations when you translate this product', 'woocommerce-multilingual' )
39
  )
40
  );
41
 
inc/template-classes/class-wcml-plugins-wrap.php CHANGED
@@ -1,15 +1,19 @@
1
  <?php
2
 
3
- class WCML_Plugins_Wrap extends WPML_Templates_Factory {
4
 
5
  private $woocommerce_wpml;
6
  private $sitepress;
7
 
 
 
8
  function __construct( &$woocommerce_wpml, &$sitepress ){
9
- parent::__construct();
10
 
11
  $this->woocommerce_wpml = $woocommerce_wpml;
12
  $this->sitepress = $sitepress;
 
 
 
13
  }
14
 
15
  public function get_model(){
@@ -59,14 +63,9 @@ class WCML_Plugins_Wrap extends WPML_Templates_Factory {
59
 
60
  }
61
 
62
- protected function init_template_base_dir() {
63
- $this->template_paths = array(
64
- WCML_PLUGIN_PATH . '/templates/',
65
- );
66
- }
67
-
68
- public function get_template() {
69
- return 'plugins-wrap.twig';
70
  }
71
 
72
  }
1
  <?php
2
 
3
+ class WCML_Plugins_Wrap {
4
 
5
  private $woocommerce_wpml;
6
  private $sitepress;
7
 
8
+ private $twig;
9
+
10
  function __construct( &$woocommerce_wpml, &$sitepress ){
 
11
 
12
  $this->woocommerce_wpml = $woocommerce_wpml;
13
  $this->sitepress = $sitepress;
14
+
15
+ $loader = new Twig_Loader_Filesystem( WCML_PLUGIN_PATH . '/templates' );
16
+ $this->twig = new Twig_Environment( $loader );
17
  }
18
 
19
  public function get_model(){
63
 
64
  }
65
 
66
+ public function show(){
67
+ $template = $this->twig->load( 'plugins-wrap.twig' );
68
+ echo $template->render( $this->get_model() );
 
 
 
 
 
69
  }
70
 
71
  }
inc/template-classes/class-wcml-settings-ui.php CHANGED
@@ -54,7 +54,7 @@ class WCML_Settings_UI extends WPML_Templates_Factory {
54
  synchronized, or seperate for each language.', 'woocommerce-multilingual' ),
55
  'value' => $this->woocommerce_wpml->settings['file_path_sync'],
56
  'label_same' => __('Use the same files for translations', 'woocommerce-multilingual'),
57
- 'label_diff' => __('Add separate download files for translations', 'woocommerce-multilingual'),
58
  ),
59
 
60
  'cart_sync' => array(
54
  synchronized, or seperate for each language.', 'woocommerce-multilingual' ),
55
  'value' => $this->woocommerce_wpml->settings['file_path_sync'],
56
  'label_same' => __('Use the same files for translations', 'woocommerce-multilingual'),
57
+ 'label_diff' => __('Add separate download files for translations when translating products', 'woocommerce-multilingual'),
58
  ),
59
 
60
  'cart_sync' => array(
inc/template-classes/currency-switcher/class-wcml-currency-switcher-options-dialog.php ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WCML_Currency_Switcher_Options_Dialog extends WPML_Templates_Factory {
4
+
5
+ private $woocommerce_wpml;
6
+ private $args;
7
+
8
+ function __construct( &$args, &$woocommerce_wpml ){
9
+ parent::__construct( );
10
+
11
+ $this->woocommerce_wpml = $woocommerce_wpml;
12
+ $this->args = $args;
13
+
14
+ add_action( 'wcml_before_currency_switcher_options', array( $this, 'render' ) );
15
+ }
16
+
17
+ public function get_model(){
18
+
19
+ $model = array(
20
+
21
+ 'args' => $this->args,
22
+ 'color_schemes' => array(
23
+ 'clear_all' => array(
24
+ 'label' => __( 'Clear all colors', 'woocommerce-multilingual' ),
25
+ ),
26
+ 'gray' => array(
27
+ 'label' => __( 'Gray', 'woocommerce-multilingual' ),
28
+ ),
29
+ 'white' => array(
30
+ 'label' => __( 'White', 'woocommerce-multilingual' ),
31
+ ),
32
+ 'blue' => array(
33
+ 'label' => __( 'Blue', 'woocommerce-multilingual' )
34
+ )
35
+ ),
36
+ 'options' => array(
37
+ 'border' => __( 'Border', 'woocommerce-multilingual' ),
38
+ 'font_current' => __( 'Current currency font color', 'woocommerce-multilingual' ),
39
+ 'font_other' => __( 'Other currency font color', 'woocommerce-multilingual' ),
40
+ 'background_current' => __( 'Current currency background color', 'woocommerce-multilingual' ),
41
+ 'background_other' => __( 'Other currency background color', 'woocommerce-multilingual' )
42
+ ),
43
+ 'form' => array(
44
+ 'switcher_style' => array(
45
+ 'label' =>__( 'Currency switcher style', 'woocommerce-multilingual' ),
46
+ 'core' =>__( 'Core', 'woocommerce-multilingual' ),
47
+ 'custom' =>__( 'Custom', 'woocommerce-multilingual' ),
48
+ 'allowed_tags' => __( 'Allowed HTML tags: <img> <span> <u> <strong> <em>', 'woocommerce-multilingual')
49
+ ),
50
+ 'template' => array(
51
+ 'label' => __( 'Template for currency switcher', 'woocommerce-multilingual' ),
52
+ 'parameters' => __( 'Available parameters', 'woocommerce-multilingual' ),
53
+ 'template_tip' => __( 'Default: %name% (%symbol%) - %code%', 'woocommerce-multilingual' ),
54
+ 'parameters_list' => '%code%, %symbol%, %name%, %subtotal%'
55
+ ),
56
+ 'colors' => array(
57
+ 'label' => __( 'Currency switcher colors', 'woocommerce-multilingual' ),
58
+ 'theme' => __( 'Color theme', 'woocommerce-multilingual' ),
59
+ 'normal' => __( 'Normal', 'woocommerce-multilingual' ),
60
+ 'hover' => __( 'Hover', 'woocommerce-multilingual' ),
61
+ 'select_option_choose' => __( 'Select a preset', 'woocommerce-multilingual' )
62
+ ),
63
+ 'widgets' => array(
64
+ 'widget_area' => __( 'Widget area', 'woocommerce-multilingual' ),
65
+ 'widget_title' => __( 'Widget title', 'woocommerce-multilingual' ),
66
+ 'choose_label' => __( '-- Choose a widget area --', 'woocommerce-multilingual' ),
67
+ 'available_sidebars' => $this->woocommerce_wpml->multi_currency->currency_switcher->get_available_sidebars()
68
+ ),
69
+ 'preview' => __( 'Preview', 'woocommerce-multilingual' ),
70
+ 'preview_nonce' => wp_create_nonce( 'wcml_currencies_switcher_preview' ),
71
+ 'save_settings_nonce' => wp_create_nonce( 'wcml_currencies_switcher_save_settings' ),
72
+ 'cancel' => __( 'Cancel', 'woocommerce-multilingual' ),
73
+ 'save' => __( 'Save', 'woocommerce-multilingual' )
74
+ )
75
+ );
76
+
77
+ return $model;
78
+ }
79
+
80
+ static public function currency_switcher_pre_selected_colors(){
81
+
82
+ $defaults = array();
83
+
84
+ $defaults['clear_all'] = array(
85
+ 'font_current_normal' => '',
86
+ 'font_current_hover' => '',
87
+ 'background_current_normal' => '',
88
+ 'background_current_hover' => '',
89
+ 'font_other_normal' => '',
90
+ 'font_other_hover' => '',
91
+ 'background_other_normal' => '',
92
+ 'background_other_hover' => '',
93
+ 'border_normal' => ''
94
+ );
95
+
96
+ $defaults['gray'] = array(
97
+ 'font_current_normal' => '#222222',
98
+ 'font_current_hover' => '#000000',
99
+ 'background_current_normal' => '#eeeeee',
100
+ 'background_current_hover' => '#eeeeee',
101
+ 'font_other_normal' => '#222222',
102
+ 'font_other_hover' => '#000000',
103
+ 'background_other_normal' => '#e5e5e5',
104
+ 'background_other_hover' => '#eeeeee',
105
+ 'border_normal' => '#cdcdcd'
106
+ );
107
+
108
+ $defaults['white'] = array(
109
+ 'font_current_normal' => '#444444',
110
+ 'font_current_hover' => '#000000',
111
+ 'background_current_normal' => '#ffffff',
112
+ 'background_current_hover' => '#eeeeee',
113
+ 'font_other_normal' => '#444444',
114
+ 'font_other_hover' => '#000000',
115
+ 'background_other_normal' => '#ffffff',
116
+ 'background_other_hover' => '#eeeeee',
117
+ 'border_normal' => '#cdcdcd'
118
+ );
119
+
120
+ $defaults['blue'] = array(
121
+ 'font_current_normal' => '#ffffff',
122
+ 'font_current_hover' => '#000000',
123
+ 'background_current_normal' => '#95bedd',
124
+ 'background_current_hover' => '#95bedd',
125
+ 'font_other_normal' => '#000000',
126
+ 'font_other_hover' => '#ffffff',
127
+ 'background_other_normal' => '#cbddeb',
128
+ 'background_other_hover' => '#95bedd',
129
+ 'border_normal' => '#0099cc'
130
+ );
131
+
132
+ return $defaults;
133
+ }
134
+
135
+ public function render(){
136
+ echo $this->get_view();
137
+ }
138
+
139
+ protected function init_template_base_dir() {
140
+ $this->template_paths = array(
141
+ WCML_PLUGIN_PATH . '/templates/multi-currency/',
142
+ );
143
+ }
144
+
145
+ public function get_template() {
146
+ return 'currency-switcher-options-dialog.twig';
147
+ }
148
+ }
inc/template-classes/currency-switcher/class-wcml-currency-switcher-template.php ADDED
@@ -0,0 +1,220 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WCML_Currency_Switcher_Template extends WPML_Templates_Factory {
4
+
5
+ const FILENAME = 'template.twig';
6
+
7
+ /* @var array $template */
8
+ private $template;
9
+
10
+ /* @var string $prefix */
11
+ private $prefix = 'wcml-cs-';
12
+
13
+ /**
14
+ * @var woocommerce_wpml
15
+ */
16
+ private $woocommerce_wpml;
17
+
18
+
19
+ function __construct( &$woocommerce_wpml, $template_data ){
20
+
21
+ $this->woocommerce_wpml =& $woocommerce_wpml;
22
+
23
+ $this->template = $this->format_data( $template_data );
24
+
25
+ if ( array_key_exists( 'template_string', $this->template ) ) {
26
+ $this->template_string = $this->template['template_string'];
27
+ }
28
+
29
+ $functions = array(
30
+ new Twig_SimpleFunction( 'get_formatted_price', array( $this, 'get_formatted_price' ) )
31
+ );
32
+
33
+ parent::__construct( $functions );
34
+
35
+ }
36
+
37
+ /**
38
+ * @param array $model
39
+ */
40
+ public function set_model( $model ) {
41
+ $this->model = is_array( $model ) ? $model : array( $model );
42
+ }
43
+
44
+ /**
45
+ * @return array
46
+ */
47
+ public function get_model() {
48
+ return $this->model;
49
+ }
50
+
51
+ public function render(){
52
+ echo $this->get_view();
53
+ }
54
+
55
+ public function get_formatted_price( $currency, $format ){
56
+
57
+ $wc_currencies = get_woocommerce_currencies();
58
+ if( preg_match( '#%subtotal%#', $format ) ){ // include cart total
59
+ $cart_object =& $this->woocommerce_wpml->cart;
60
+ }
61
+ $wcml_settings = $this->woocommerce_wpml->get_settings();
62
+ $multi_currency =& $this->woocommerce_wpml->multi_currency;
63
+ $client_currency = $multi_currency->get_client_currency();
64
+
65
+ if( preg_match( '#%subtotal%#', $format ) ) { // include cart total
66
+ if( !is_admin() ){
67
+
68
+ $multi_currency->set_client_currency( $currency );
69
+ $cart_object->woocommerce_calculate_totals( WC()->cart, $currency );
70
+ $cart_subtotal = WC()->cart->get_cart_subtotal();
71
+
72
+ }else{
73
+ switch( $wcml_settings['currency_options'][$currency]['position'] ){
74
+ case 'left' :
75
+ $price_format = '%1$s%2$s';
76
+ break;
77
+ case 'right' :
78
+ $price_format = '%2$s%1$s';
79
+ break;
80
+ case 'left_space' :
81
+ $price_format = '%1$s&nbsp;%2$s';
82
+ break;
83
+ case 'right_space' :
84
+ $price_format = '%2$s&nbsp;%1$s';
85
+ break;
86
+ }
87
+ $cart_subtotal = wc_price('1234.56',
88
+ array(
89
+ 'currency' => $currency,
90
+ 'decimal_separator' => $wcml_settings['currency_options'][$currency]['decimal_sep'],
91
+ 'thousand_separator' => $wcml_settings['currency_options'][$currency]['thousand_sep'],
92
+ 'decimals' => $wcml_settings['currency_options'][$currency]['num_decimals'],
93
+ 'price_format' => $price_format
94
+ )
95
+ );
96
+ }
97
+ }else{
98
+ $cart_subtotal = false;
99
+ }
100
+
101
+ $currency_format = preg_replace( array('#%name%#', '#%symbol%#', '#%code%#', '#%subtotal%#'),
102
+ array(
103
+ $wc_currencies[$currency],
104
+ get_woocommerce_currency_symbol( $currency ),
105
+ $currency,
106
+ $cart_subtotal
107
+
108
+ ), $format );
109
+
110
+ if( preg_match( '#%subtotal%#', $format ) && !is_admin() ) { // include cart total
111
+ $multi_currency->set_client_currency( $client_currency );
112
+ }
113
+
114
+ return $currency_format;
115
+ }
116
+
117
+ /**
118
+ * Make sure some elements are of array type
119
+ *
120
+ * @param array $template_data
121
+ *
122
+ * @return array
123
+ */
124
+ private function format_data( $template_data ) {
125
+ foreach ( array( 'path', 'js', 'css' ) as $k ) {
126
+ $template_data[ $k ] = isset( $template_data[ $k ] ) ? $template_data[ $k ] : array();
127
+ $template_data[ $k ] = is_array( $template_data[ $k ] ) ? $template_data[ $k ] : array( $template_data[ $k ] );
128
+ }
129
+
130
+ return $template_data;
131
+ }
132
+
133
+
134
+ /**
135
+ * @param bool $with_version
136
+ *
137
+ * @return array
138
+ */
139
+ public function get_styles( $with_version = false ) {
140
+ return $with_version
141
+ ? array_map( array( $this, 'add_resource_version' ), $this->template['css'] )
142
+ : $this->template['css'];
143
+ }
144
+
145
+ /**
146
+ * @return bool
147
+ */
148
+ public function has_styles() {
149
+ return ! empty( $this->template['css'] );
150
+ }
151
+
152
+ /**
153
+ * @param bool $with_version
154
+ *
155
+ * @return array
156
+ */
157
+ public function get_scripts( $with_version = false ) {
158
+ return $with_version
159
+ ? array_map( array( $this, 'add_resource_version' ), $this->template['js'] )
160
+ : $this->template['js'];
161
+ }
162
+
163
+ /**
164
+ * @param string $url
165
+ *
166
+ * @return string
167
+ */
168
+ private function add_resource_version( $url ) {
169
+ return $url . '?ver=' . WCML_VERSION;
170
+ }
171
+
172
+ /**
173
+ * @param int $index
174
+ *
175
+ * @return string
176
+ */
177
+ public function get_resource_handler( $index ) {
178
+ $slug = isset( $this->template['slug'] ) ? $this->template['slug'] : '';
179
+ $prefix = $this->is_core() ? '' : $this->prefix;
180
+ return $prefix . $slug . '-' . $index;
181
+ }
182
+
183
+ public function get_inline_style_handler() {
184
+ $count = count( $this->template['css'] );
185
+ return $count > 0 ? $this->get_resource_handler( $count - 1 ) : null;
186
+ }
187
+
188
+ protected function init_template_base_dir() {
189
+ $this->template_paths = $this->template['path'];
190
+ }
191
+
192
+ /**
193
+ * @return string Template filename
194
+ */
195
+ public function get_template() {
196
+ $template = self::FILENAME;
197
+
198
+ if ( isset( $this->template_string ) ) {
199
+ $template = $this->template_string;
200
+ } elseif ( array_key_exists( 'filename', $this->template ) ) {
201
+ $template = $this->template['filename'];
202
+ }
203
+
204
+ return $template;
205
+ }
206
+
207
+ /**
208
+ * @return array
209
+ */
210
+ public function get_template_data() {
211
+ return $this->template;
212
+ }
213
+
214
+ /**
215
+ * return bool
216
+ */
217
+ public function is_core() {
218
+ return isset( $this->template['is_core'] ) ? (bool) $this->template['is_core'] : false;
219
+ }
220
+ }
inc/template-classes/multi-currency/class-wcml-custom-currency-options.php CHANGED
@@ -27,7 +27,7 @@ class WCML_Custom_Currency_Options extends WPML_Templates_Factory {
27
  $exchange_rate_services =& $this->woocommerce_wpml->multi_currency->exchange_rate_services;
28
  $exchange_rates_automatic = $exchange_rate_services->get_setting('automatic');
29
 
30
- if( !$exchange_rates_automatic ){
31
  $service_id = $exchange_rate_services->get_setting('service');
32
  $services = $exchange_rate_services->get_services();
33
  $exchange_rates_service = $services[$service_id]->get_name();
@@ -43,6 +43,8 @@ class WCML_Custom_Currency_Options extends WPML_Templates_Factory {
43
  'rate' => array(
44
  'label' => __( 'Exchange Rate', 'woocommerce-multilingual' ),
45
  'only_numeric' => __( 'Only numeric', 'woocommerce-multilingual' ),
 
 
46
  'set_on' => empty($this->args['currency']['updated'] ) ? '' :
47
  sprintf( __( 'Set on %s', 'woocommerce-multilingual' ),
48
  date( 'F j, Y g:i a', strtotime( $this->args['currency']['updated'] ) ) ),
@@ -91,6 +93,7 @@ class WCML_Custom_Currency_Options extends WPML_Templates_Factory {
91
  'only_numeric' => __( 'Only numeric', 'woocommerce-multilingual' )
92
  ),
93
 
 
94
  'cancel' => __( 'Cancel', 'woocommerce-multilingual' ),
95
  'save' => __( 'Save', 'woocommerce-multilingual' )
96
 
27
  $exchange_rate_services =& $this->woocommerce_wpml->multi_currency->exchange_rate_services;
28
  $exchange_rates_automatic = $exchange_rate_services->get_setting('automatic');
29
 
30
+ if( $exchange_rates_automatic ){
31
  $service_id = $exchange_rate_services->get_setting('service');
32
  $services = $exchange_rate_services->get_services();
33
  $exchange_rates_service = $services[$service_id]->get_name();
43
  'rate' => array(
44
  'label' => __( 'Exchange Rate', 'woocommerce-multilingual' ),
45
  'only_numeric' => __( 'Only numeric', 'woocommerce-multilingual' ),
46
+ 'min' => '0.01',
47
+ 'step' => '0.01',
48
  'set_on' => empty($this->args['currency']['updated'] ) ? '' :
49
  sprintf( __( 'Set on %s', 'woocommerce-multilingual' ),
50
  date( 'F j, Y g:i a', strtotime( $this->args['currency']['updated'] ) ) ),
93
  'only_numeric' => __( 'Only numeric', 'woocommerce-multilingual' )
94
  ),
95
 
96
+ 'number_error' => __( 'Please enter a valid number', 'woocommerce-multilingual' ),
97
  'cancel' => __( 'Cancel', 'woocommerce-multilingual' ),
98
  'save' => __( 'Save', 'woocommerce-multilingual' )
99
 
inc/template-classes/multi-currency/class-wcml-custom-prices-ui.php CHANGED
@@ -20,7 +20,6 @@ class WCML_Custom_Prices_UI extends WPML_Templates_Factory {
20
  $this->custom_prices = get_post_custom( $product_id );
21
  $this->custom_prices_fields = apply_filters( 'wcml_custom_prices_fields', array( '_regular_price', '_sale_price' ), $product_id );
22
  $this->custom_prices_fields_labels = apply_filters( 'wcml_custom_prices_fields_labels', array( '_regular_price' => __( 'Regular Price', 'woocommerce-multilingual' ), '_sale_price' => __( 'Sale Price', 'woocommerce-multilingual' ) ), $product_id );
23
-
24
  }
25
 
26
  public function get_model() {
@@ -80,6 +79,7 @@ class WCML_Custom_Prices_UI extends WPML_Templates_Factory {
80
  $currencies[ $key ][ 'readonly_price' ][ $price_field ] = get_post_meta( $this->product_id, $price_field, true );
81
  if( $currencies[ $key ][ 'readonly_price' ][ $price_field ] ){
82
  $currencies[ $key ][ 'readonly_price' ][ $price_field ] = $currencies[ $key ][ 'readonly_price' ][ $price_field ]*$currency['rate'];
 
83
  }
84
  }
85
 
@@ -89,7 +89,7 @@ class WCML_Custom_Prices_UI extends WPML_Templates_Factory {
89
 
90
  foreach( $this->custom_prices_fields as $price_field ){
91
  if( isset( $this->custom_prices[ $price_field.'_'.$key ][ 0 ] ) ){
92
- $currencies[ $key ][ 'custom_price' ][ $price_field ] = $this->custom_prices[ $price_field.'_'.$key ][ 0 ];
93
  }
94
  }
95
 
@@ -100,8 +100,6 @@ class WCML_Custom_Prices_UI extends WPML_Templates_Factory {
100
 
101
  if( $this->is_variation ){
102
  $currencies[ $key ][ 'custom_id' ] = '['.$key.']['.$this->product_id.']';
103
- $currencies[ $key ][ 'wc_input_type' ] = 'text';
104
-
105
  }else{
106
  $currencies[ $key ][ 'custom_id' ] = '['.$key.']';
107
 
@@ -116,7 +114,7 @@ class WCML_Custom_Prices_UI extends WPML_Templates_Factory {
116
  woocommerce_wp_text_input(
117
  array(
118
  'id' => '_custom'.$price_field.'['.$key.']',
119
- 'value'=> $currencies[ $key ][ 'custom_price' ][ $price_field ] ,
120
  'class' => 'wc_input_price wcml_input_price short wcml'.$price_field,
121
  'label' => $this->custom_prices_fields_labels[ $price_field ] . ' ('. $currencies[ $key ][ 'currency_symbol' ].')',
122
  $wc_input['type_name'] => $wc_input['type_val'],
@@ -134,7 +132,7 @@ class WCML_Custom_Prices_UI extends WPML_Templates_Factory {
134
  woocommerce_wp_text_input(
135
  array(
136
  'id' => '_readonly'.$price_field,
137
- 'value'=> $currencies[ $key ][ 'readonly_price' ][ $price_field ],
138
  'class' => 'wc_input_price short',
139
  'label' => $this->custom_prices_fields_labels[ $price_field ] . ' ('. $currencies[ $key ][ 'currency_symbol' ] .')',
140
  $wc_input['type_name'] => $wc_input['type_val'],
20
  $this->custom_prices = get_post_custom( $product_id );
21
  $this->custom_prices_fields = apply_filters( 'wcml_custom_prices_fields', array( '_regular_price', '_sale_price' ), $product_id );
22
  $this->custom_prices_fields_labels = apply_filters( 'wcml_custom_prices_fields_labels', array( '_regular_price' => __( 'Regular Price', 'woocommerce-multilingual' ), '_sale_price' => __( 'Sale Price', 'woocommerce-multilingual' ) ), $product_id );
 
23
  }
24
 
25
  public function get_model() {
79
  $currencies[ $key ][ 'readonly_price' ][ $price_field ] = get_post_meta( $this->product_id, $price_field, true );
80
  if( $currencies[ $key ][ 'readonly_price' ][ $price_field ] ){
81
  $currencies[ $key ][ 'readonly_price' ][ $price_field ] = $currencies[ $key ][ 'readonly_price' ][ $price_field ]*$currency['rate'];
82
+ $currencies[ $key ][ 'readonly_price' ][ $price_field ] = wc_format_localized_price( $currencies[ $key ][ 'readonly_price' ][ $price_field ] );
83
  }
84
  }
85
 
89
 
90
  foreach( $this->custom_prices_fields as $price_field ){
91
  if( isset( $this->custom_prices[ $price_field.'_'.$key ][ 0 ] ) ){
92
+ $currencies[ $key ][ 'custom_price' ][ $price_field ] = wc_format_localized_price( $this->custom_prices[ $price_field.'_'.$key ][ 0 ] );
93
  }
94
  }
95
 
100
 
101
  if( $this->is_variation ){
102
  $currencies[ $key ][ 'custom_id' ] = '['.$key.']['.$this->product_id.']';
 
 
103
  }else{
104
  $currencies[ $key ][ 'custom_id' ] = '['.$key.']';
105
 
114
  woocommerce_wp_text_input(
115
  array(
116
  'id' => '_custom'.$price_field.'['.$key.']',
117
+ 'value'=> wc_format_localized_price( $currencies[ $key ][ 'custom_price' ][ $price_field ] ),
118
  'class' => 'wc_input_price wcml_input_price short wcml'.$price_field,
119
  'label' => $this->custom_prices_fields_labels[ $price_field ] . ' ('. $currencies[ $key ][ 'currency_symbol' ].')',
120
  $wc_input['type_name'] => $wc_input['type_val'],
132
  woocommerce_wp_text_input(
133
  array(
134
  'id' => '_readonly'.$price_field,
135
+ 'value'=> wc_format_localized_price( $currencies[ $key ][ 'readonly_price' ][ $price_field ] ),
136
  'class' => 'wc_input_price short',
137
  'label' => $this->custom_prices_fields_labels[ $price_field ] . ' ('. $currencies[ $key ][ 'currency_symbol' ] .')',
138
  $wc_input['type_name'] => $wc_input['type_val'],
inc/template-classes/multi-currency/class-wcml-multi-currency-ui.php CHANGED
@@ -44,6 +44,7 @@ class WCML_Multi_Currency_UI extends WPML_Templates_Factory {
44
  $this->wc_currency = get_option( 'woocommerce_currency' );
45
 
46
  $this->load_custom_currency_option_boxes();
 
47
 
48
  }
49
 
@@ -117,39 +118,34 @@ class WCML_Multi_Currency_UI extends WPML_Templates_Factory {
117
  'currency_switcher' => array(
118
  'headers' => array(
119
  'main' => __('Currency switcher options', 'woocommerce-multilingual'),
120
- 'style' => __('Currency switcher style', 'woocommerce-multilingual'),
121
- 'order' => __( 'Currency order', 'woocommerce-multilingual' ),
122
- 'parameters' => __( 'Available parameters', 'woocommerce-multilingual' ),
123
- 'parameters_list' => '%code%, %symbol%, %name%, %subtotal%',
124
- 'template' => __( 'Template for currency switcher', 'woocommerce-multilingual' ),
125
- 'visibility' => __('Visibility', 'woocommerce-multilingual')
 
 
 
 
 
 
126
  ),
127
- 'preview_nonce' => wp_create_nonce( 'wcml_currencies_switcher_preview' ),
128
- 'preview' => $this->woocommerce_wpml->multi_currency->currency_switcher->wcml_currency_switcher( array('echo' => false) ),
 
129
  'preview_text' => __( 'Currency switcher preview', 'woocommerce-multilingual' ),
130
- 'style' => isset($this->woocommerce_wpml->settings['currency_switcher_style']) ? $this->woocommerce_wpml->settings['currency_switcher_style'] : false,
131
- 'options' => array(
132
- 'dropdown' => __('Drop-down menu', 'woocommerce-multilingual'),
133
- 'list' => __('List of currencies', 'woocommerce-multilingual'),
134
- 'vertical' => __('Vertical', 'woocommerce-multilingual'),
135
- 'horizontal' => __('Horizontal', 'woocommerce-multilingual'),
136
- 'allowed_tags' => __('Allowed HTML tags: <img> <span> <u> <strong> <em>', 'woocommerce-multilingual')
137
- ),
138
- 'orientation' => isset($this->woocommerce_wpml->settings['wcml_curr_sel_orientation']) ?
139
- $this->woocommerce_wpml->settings['wcml_curr_sel_orientation'] : 'vertical',
140
  'order' => !isset( $this->woocommerce_wpml->settings['currencies_order'] ) ?
141
  $this->woocommerce_wpml->multi_currency->get_currency_codes() :
142
  $this->woocommerce_wpml->settings['currencies_order'],
143
  'order_nonce' => wp_create_nonce( 'set_currencies_order_nonce' ),
144
- 'order_tip' => __( 'Drag the currencies to change their order', 'woocommerce-multilingual' ),
145
- 'parameters_tip' => __( '%name%, %symbol%, %code%', 'woocommerce-multilingual' ),
146
- 'template' => isset($this->woocommerce_wpml->settings['wcml_curr_template']) ?
147
- $this->woocommerce_wpml->settings['wcml_curr_template'] : '',
148
- 'template_tip' => __( 'Default: %name% (%symbol%) - %code%', 'woocommerce-multilingual' ),
149
- 'template_default' => '%name% (%symbol%) - %code%',
150
  'visibility_label' => __('Show a currency selector on the product page template', 'woocommerce-multilingual'),
151
  'visibility_on' => isset($this->woocommerce_wpml->settings['currency_switcher_product_visibility']) ?
152
- $this->woocommerce_wpml->settings['currency_switcher_product_visibility']:1
 
 
153
  ),
154
  'exchange_rates' => $exchange_rates_ui->get_model()
155
  );
@@ -276,6 +272,74 @@ class WCML_Multi_Currency_UI extends WPML_Templates_Factory {
276
 
277
  }
278
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
  public function wp_do_action( $hook ){
280
  do_action( $hook );
281
  }
@@ -285,5 +349,17 @@ class WCML_Multi_Currency_UI extends WPML_Templates_Factory {
285
  return $wp_locale->get_weekday( $day_index );
286
  }
287
 
 
 
 
 
 
 
 
 
 
 
 
 
288
 
289
  }
44
  $this->wc_currency = get_option( 'woocommerce_currency' );
45
 
46
  $this->load_custom_currency_option_boxes();
47
+ $this->load_curency_switcher_option_boxes();
48
 
49
  }
50
 
118
  'currency_switcher' => array(
119
  'headers' => array(
120
  'main' => __('Currency switcher options', 'woocommerce-multilingual'),
121
+ 'main_desc' => __('All currency switchers in your site are affected by the settings in this section.', 'woocommerce-multilingual'),
122
+ 'order' => __( 'Order of currencies', 'woocommerce-multilingual' ),
123
+ 'additional_css' => __('Additional CSS', 'woocommerce-multilingual'),
124
+ 'widget' => __('Widget Currency Switcher', 'woocommerce-multilingual'),
125
+ 'product_page' => __('Product page Currency Switcher', 'woocommerce-multilingual'),
126
+ 'preview' => __('Preview', 'woocommerce-multilingual'),
127
+ 'position' => __('Position', 'woocommerce-multilingual'),
128
+ 'actions' => __('Actions', 'woocommerce-multilingual'),
129
+ 'action' => __('Action', 'woocommerce-multilingual'),
130
+ 'delete' => __('Delete', 'woocommerce-multilingual'),
131
+ 'edit' => __('Edit currency switcher', 'woocommerce-multilingual'),
132
+ 'add_widget' => __('Add a new currency switcher to a widget area', 'woocommerce-multilingual'),
133
  ),
134
+ 'preview' => $this->get_currency_switchers_preview(),
135
+ 'widget_currency_switchers' => $this->widget_currency_switchers(),
136
+ 'available_sidebars' => $this->woocommerce_wpml->multi_currency->currency_switcher->get_available_sidebars(),
137
  'preview_text' => __( 'Currency switcher preview', 'woocommerce-multilingual' ),
 
 
 
 
 
 
 
 
 
 
138
  'order' => !isset( $this->woocommerce_wpml->settings['currencies_order'] ) ?
139
  $this->woocommerce_wpml->multi_currency->get_currency_codes() :
140
  $this->woocommerce_wpml->settings['currencies_order'],
141
  'order_nonce' => wp_create_nonce( 'set_currencies_order_nonce' ),
142
+ 'delete_nonce' => wp_create_nonce( 'delete_currency_switcher' ),
143
+ 'order_tip' => __( 'Drag and drop the currencies to change their order', 'woocommerce-multilingual' ),
 
 
 
 
144
  'visibility_label' => __('Show a currency selector on the product page template', 'woocommerce-multilingual'),
145
  'visibility_on' => isset($this->woocommerce_wpml->settings['currency_switcher_product_visibility']) ?
146
+ $this->woocommerce_wpml->settings['currency_switcher_product_visibility']:1,
147
+ 'additional_css' => isset($this->woocommerce_wpml->settings['currency_switcher_additional_css']) ?
148
+ $this->woocommerce_wpml->settings['currency_switcher_additional_css']:''
149
  ),
150
  'exchange_rates' => $exchange_rates_ui->get_model()
151
  );
272
 
273
  }
274
 
275
+
276
+ public function load_curency_switcher_option_boxes(){
277
+
278
+ $wcml_settings = $this->woocommerce_wpml->get_settings();
279
+ $currency_switchers = isset( $wcml_settings[ 'currency_switchers' ] ) ? $wcml_settings[ 'currency_switchers' ] : array();
280
+
281
+ //add empty dialog for new sidebar currency switcher
282
+ $currency_switchers[ 'new_widget' ] = array(
283
+ 'switcher_style' => 'wcml-dropdown',
284
+ 'widget_title' => '',
285
+ 'switcher_templates' => $this->woocommerce_wpml->cs_templates->get_templates(),
286
+ 'template' => '%name% (%symbol%) - %code%',
287
+ 'color_scheme' => array(
288
+ 'font_current_normal' => '',
289
+ 'font_current_hover' => '',
290
+ 'background_current_normal' => '',
291
+ 'background_current_hover' => '',
292
+ 'font_other_normal' => '',
293
+ 'font_other_hover' => '',
294
+ 'background_other_normal' => '',
295
+ 'background_other_hover' => '',
296
+ 'border_normal' => ''
297
+ )
298
+ );
299
+
300
+ if( !isset( $currency_switchers[ 'product' ] ) ){
301
+ $currency_switchers[ 'product' ] = $currency_switchers[ 'new_widget' ];
302
+ }
303
+
304
+ $widget_currency_switchers = $this->widget_currency_switchers();
305
+
306
+ foreach( $currency_switchers as $switcher_id => $currency_switcher ){
307
+
308
+ if( $switcher_id == 'product'){
309
+ $dialog_title = __('Edit Product Currency Switcher', 'woocommerce-multilingual');
310
+ }elseif( $switcher_id == 'new_widget' ){
311
+ $dialog_title = __('New Widget Area Currency Switcher', 'woocommerce-multilingual');
312
+ }else{
313
+ $dialog_title = sprintf( __('Edit %s Currency Switcher', 'woocommerce-multilingual'), $widget_currency_switchers[ $switcher_id ]['name'] );
314
+ }
315
+
316
+ $args = array(
317
+ 'title' => $dialog_title,
318
+ 'currency_switcher' => $switcher_id,
319
+ 'switcher_style' => $currency_switcher[ 'switcher_style' ],
320
+ 'widget_title' => $currency_switcher[ 'widget_title' ],
321
+ 'switcher_templates' => $this->woocommerce_wpml->cs_templates->get_templates(),
322
+ 'template' => $currency_switcher[ 'template' ],
323
+ 'template_default' => '%name% (%symbol%) - %code%',
324
+ 'options' => $currency_switcher[ 'color_scheme' ]
325
+ );
326
+
327
+ new WCML_Currency_Switcher_Options_Dialog( $args, $this->woocommerce_wpml );
328
+ }
329
+ }
330
+
331
+ public function get_currency_switchers_preview(){
332
+ $preview = array(
333
+ 'product' => $this->woocommerce_wpml->multi_currency->currency_switcher->wcml_currency_switcher( array( 'switcher_id' => 'product', 'echo' => false ) )
334
+ );
335
+
336
+ foreach( $this->widget_currency_switchers() as $switcher ){
337
+ $preview[ $switcher['id'] ] = $this->woocommerce_wpml->multi_currency->currency_switcher->wcml_currency_switcher( array( 'switcher_id' => $switcher['id'], 'echo' => false ) );
338
+ }
339
+
340
+ return $preview;
341
+ }
342
+
343
  public function wp_do_action( $hook ){
344
  do_action( $hook );
345
  }
349
  return $wp_locale->get_weekday( $day_index );
350
  }
351
 
352
+ public function widget_currency_switchers(){
353
+ $wcml_settings = $this->woocommerce_wpml->get_settings();
354
+ $currency_switchers = isset( $wcml_settings[ 'currency_switchers' ] ) ? $wcml_settings[ 'currency_switchers' ] : array();
355
+ $sidebars = $this->woocommerce_wpml->multi_currency->currency_switcher->get_registered_sidebars();
356
+ foreach( $sidebars as $key => $sidebar ){
357
+ if( !isset( $currency_switchers[ $key ] ) ){
358
+ unset( $sidebars[ $key ] );
359
+ }
360
+ }
361
+
362
+ return $sidebars;
363
+ }
364
 
365
  }
inc/template-classes/setup/class-wcml-setup-introduction-ui.php CHANGED
@@ -22,7 +22,7 @@ class WCML_Setup_Introduction_UI extends WPML_Templates_Factory {
22
  'description2' => array(
23
 
24
  'title' => __("We'll help you:", 'woocommerce-multilingual'),
25
- 'step1' => __("Translate the 'store' pages", 'woocommerce-multilingual'),
26
  'step2' => __("Choose which attributes to make translatable", 'woocommerce-multilingual'),
27
  'step3' => __("Choose if you need multiple currencies", 'woocommerce-multilingual'),
28
 
22
  'description2' => array(
23
 
24
  'title' => __("We'll help you:", 'woocommerce-multilingual'),
25
+ 'step1' => __('Translate the &quot;store&quot; pages', 'woocommerce-multilingual'),
26
  'step2' => __("Choose which attributes to make translatable", 'woocommerce-multilingual'),
27
  'step3' => __("Choose if you need multiple currencies", 'woocommerce-multilingual'),
28
 
inc/template-classes/setup/class-wcml-setup-ready-ui.php CHANGED
@@ -28,7 +28,7 @@ class WCML_Setup_Ready_UI extends WPML_Templates_Factory {
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 &raquo; 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'),
33
  'continue' => __('Close setup', 'woocommerce-multilingual'),
34
  ),
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 &raquo; 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'),
33
  'continue' => __('Close setup', 'woocommerce-multilingual'),
34
  ),
inc/template-classes/status/class-wcml-status-config-warnings-ui.php CHANGED
@@ -36,11 +36,9 @@ class WCML_Status_Config_Warnings_UI extends WPML_Templates_Factory {
36
  'conf' => __( 'Configuration Warnings', 'woocommerce-multilingual' ),
37
  'base_not_trnsl' => __( 'Your product permalink base is not translated to:', 'woocommerce-multilingual' ),
38
  'trsl_urls' => __( 'Translate URLs', 'woocommerce-multilingual' ),
39
- 'def_and_st_not_en' => __( "Your site's default language is not English and the strings language is also not English.", 'woocommerce-multilingual' ),
40
  'run_not_en' => __( 'Running WooCommerce multilingual with default language other than English.', 'woocommerce-multilingual' ),
41
  'url_problems' => __( 'This may cause problems with URLs in different languages.', 'woocommerce-multilingual' ),
42
  'change_def_lang' => __( 'Change default language', 'woocommerce-multilingual' ),
43
- 'def_not_en' => __( "Your site's default language is not English.", 'woocommerce-multilingual' ),
44
  'attent_sett' => __( 'There are some settings that require careful attention.', 'woocommerce-multilingual' ),
45
  'over_sett' => __( 'Some settings from the WooCommerce Multilingual wpml-config.xml file have been overwritten.', 'woocommerce-multilingual' ),
46
  'check_conf' => __( 'You should check WPML configuration files added by other plugins or manual settings on the %s section.', 'woocommerce-multilingual' ),
36
  'conf' => __( 'Configuration Warnings', 'woocommerce-multilingual' ),
37
  'base_not_trnsl' => __( 'Your product permalink base is not translated to:', 'woocommerce-multilingual' ),
38
  'trsl_urls' => __( 'Translate URLs', 'woocommerce-multilingual' ),
 
39
  'run_not_en' => __( 'Running WooCommerce multilingual with default language other than English.', 'woocommerce-multilingual' ),
40
  'url_problems' => __( 'This may cause problems with URLs in different languages.', 'woocommerce-multilingual' ),
41
  'change_def_lang' => __( 'Change default language', 'woocommerce-multilingual' ),
 
42
  'attent_sett' => __( 'There are some settings that require careful attention.', 'woocommerce-multilingual' ),
43
  'over_sett' => __( 'Some settings from the WooCommerce Multilingual wpml-config.xml file have been overwritten.', 'woocommerce-multilingual' ),
44
  'check_conf' => __( 'You should check WPML configuration files added by other plugins or manual settings on the %s section.', 'woocommerce-multilingual' ),
inc/template-classes/status/class-wcml-status-store-pages-ui.php CHANGED
@@ -27,14 +27,14 @@ class WCML_Status_Store_Pages_UI extends WPML_Templates_Factory {
27
  'request_uri' => $_SERVER["REQUEST_URI"],
28
  'strings' => array(
29
  'store_pages' => __( 'WooCommerce Store Pages', 'woocommerce-multilingual' ),
30
- 'pages_trnsl' => __( 'To run a multilingual e-commerce site, you need to have the WooCommerce shop pages translated to all the site\'s languages. Once all the pages are installed you can add the translations for them from this menu.', 'woocommerce-multilingual' ),
31
  'store_pages' => __( 'WooCommerce Store Pages', 'woocommerce-multilingual' ),
32
  'not_created' => __( 'One or more WooCommerce pages have not been created.', 'woocommerce-multilingual' ),
33
  'install' => __( 'Install WooCommerce Pages', 'woocommerce-multilingual' ),
34
  'not_exist' => __( 'WooCommerce store pages do not exist for these languages:', 'woocommerce-multilingual' ),
35
  'create_transl' => __( 'Create missing translations', 'woocommerce-multilingual' ),
36
  'translated_wpml' => __( 'These pages are currently being translated by translators via WPML: ', 'woocommerce-multilingual' ),
37
- 'translated' => __( 'WooCommerce store pages are translated to all the site\'s languages.', 'woocommerce-multilingual' )
38
  ),
39
  'nonces' => array(
40
  'create_pages' => wp_nonce_field( 'create_pages', 'wcml_nonce' )
27
  'request_uri' => $_SERVER["REQUEST_URI"],
28
  'strings' => array(
29
  'store_pages' => __( 'WooCommerce Store Pages', 'woocommerce-multilingual' ),
30
+ 'pages_trnsl' => __( "To run a multilingual e-commerce site, you need to have the WooCommerce shop pages translated to all the site's languages. Once all the pages are installed you can add the translations for them from this menu.", 'woocommerce-multilingual' ),
31
  'store_pages' => __( 'WooCommerce Store Pages', 'woocommerce-multilingual' ),
32
  'not_created' => __( 'One or more WooCommerce pages have not been created.', 'woocommerce-multilingual' ),
33
  'install' => __( 'Install WooCommerce Pages', 'woocommerce-multilingual' ),
34
  'not_exist' => __( 'WooCommerce store pages do not exist for these languages:', 'woocommerce-multilingual' ),
35
  'create_transl' => __( 'Create missing translations', 'woocommerce-multilingual' ),
36
  'translated_wpml' => __( 'These pages are currently being translated by translators via WPML: ', 'woocommerce-multilingual' ),
37
+ 'translated' => __( "WooCommerce store pages are translated to all the site's languages.", 'woocommerce-multilingual' )
38
  ),
39
  'nonces' => array(
40
  'create_pages' => wp_nonce_field( 'create_pages', 'wcml_nonce' )
inc/template-classes/status/class-wcml-status-taxonomies-ui.php CHANGED
@@ -41,7 +41,7 @@ class WCML_Status_Taxonomies_UI extends WPML_Templates_Factory {
41
  $taxonomies_data = array();
42
 
43
  foreach ( $taxonomies as $key => $taxonomy ) {
44
- if( $taxonomy == 'product_type' ) continue;
45
  $taxonomies_data[$key]['tax'] = $taxonomy;
46
  $taxonomies_data[$key]['untranslated'] = $this->woocommerce_wpml->terms->get_untranslated_terms_number($taxonomy);
47
  $taxonomies_data[$key]['fully_trans'] = $this->woocommerce_wpml->terms->is_fully_translated($taxonomy);
41
  $taxonomies_data = array();
42
 
43
  foreach ( $taxonomies as $key => $taxonomy ) {
44
+ if( !is_taxonomy_translated( $taxonomy ) ) continue;
45
  $taxonomies_data[$key]['tax'] = $taxonomy;
46
  $taxonomies_data[$key]['untranslated'] = $this->woocommerce_wpml->terms->get_untranslated_terms_number($taxonomy);
47
  $taxonomies_data[$key]['fully_trans'] = $this->woocommerce_wpml->terms->is_fully_translated($taxonomy);
inc/translation-editor/class-wcml-downloadable-products.php CHANGED
@@ -28,21 +28,22 @@ class WCML_Downloadable_Products{
28
  public function product_options_downloads_custom_option( $loop = false, $variation_data = false, $variation = false ){
29
  global $pagenow;
30
 
 
 
 
 
 
 
 
 
31
  if ( ( isset( $_GET['post_type'] ) && $_GET['post_type'] === 'product' && isset( $_GET['source_lang'] ) )
32
- || ( isset( $_GET['post'] ) && ( get_post_type( $_GET['post'] ) !== 'product' || ! $this->woocommerce_wpml->products->is_original_product( $_GET['post'] ) ) )
33
  ){
34
  return;
35
  }
36
 
37
  $this->load_custom_files_js_css();
38
 
39
- $product_id = false;
40
- $is_variation = false;
41
-
42
- if ( $pagenow === 'post.php' && isset( $_GET['post'] ) ){
43
- $product_id = $_GET['post'];
44
- }
45
-
46
  if( $variation ) {
47
  $product_id = $variation->ID;
48
  $is_variation = true;
@@ -64,6 +65,7 @@ class WCML_Downloadable_Products{
64
  public function sync_files_to_translations( $original_id, $trnsl_id, $data ){
65
 
66
  $custom_product_sync = get_post_meta( $original_id, 'wcml_sync_files', true );
 
67
  if ( ( $custom_product_sync && $custom_product_sync === 'self' ) || ( ! $custom_product_sync && ! $this->woocommerce_wpml->settings['file_path_sync'] ) ){
68
  if( $data ){
69
  $orig_var_files = $this->get_files_data( $original_id );
28
  public function product_options_downloads_custom_option( $loop = false, $variation_data = false, $variation = false ){
29
  global $pagenow;
30
 
31
+ $product_id = false;
32
+ $is_variation = false;
33
+ if( $pagenow === 'post.php' && isset( $_GET['post'] ) ){
34
+ $product_id = $_GET['post'];
35
+ }elseif( isset( $_POST['product_id'] ) ){
36
+ $product_id = $_POST['product_id'];
37
+ }
38
+
39
  if ( ( isset( $_GET['post_type'] ) && $_GET['post_type'] === 'product' && isset( $_GET['source_lang'] ) )
40
+ || ( get_post_type( $product_id ) !== 'product' || ! $this->woocommerce_wpml->products->is_original_product( $product_id ) )
41
  ){
42
  return;
43
  }
44
 
45
  $this->load_custom_files_js_css();
46
 
 
 
 
 
 
 
 
47
  if( $variation ) {
48
  $product_id = $variation->ID;
49
  $is_variation = true;
65
  public function sync_files_to_translations( $original_id, $trnsl_id, $data ){
66
 
67
  $custom_product_sync = get_post_meta( $original_id, 'wcml_sync_files', true );
68
+
69
  if ( ( $custom_product_sync && $custom_product_sync === 'self' ) || ( ! $custom_product_sync && ! $this->woocommerce_wpml->settings['file_path_sync'] ) ){
70
  if( $data ){
71
  $orig_var_files = $this->get_files_data( $original_id );
inc/translation-editor/class-wcml-editor-ui-product-job.php CHANGED
@@ -8,6 +8,10 @@ class WCML_Editor_UI_Product_Job extends WPML_Editor_UI_Job {
8
  * @var SitePress
9
  */
10
  private $sitepress;
 
 
 
 
11
  /**
12
  * @var WPDB
13
  */
@@ -19,9 +23,11 @@ class WCML_Editor_UI_Product_Job extends WPML_Editor_UI_Job {
19
  private $not_display_fields_for_variables_product;
20
 
21
  function __construct( $job_details, &$woocommerce_wpml, &$sitepress, &$wpdb ) {
 
22
 
23
  $this->woocommerce_wpml =& $woocommerce_wpml;
24
  $this->sitepress =& $sitepress;
 
25
  $this->wpdb =& $wpdb;
26
  $this->not_display_fields_for_variables_product = array( '_purchase_note', '_regular_price', '_sale_price',
27
  '_price', '_min_variation_price', '_max_variation_price',
@@ -94,10 +100,10 @@ class WCML_Editor_UI_Product_Job extends WPML_Editor_UI_Job {
94
 
95
  $this->add_field( new WPML_Editor_UI_Single_Line_Field( 'title', __( 'Title', 'woocommerce-multilingual' ), $this->data, true ) );
96
  $this->add_field( new WPML_Editor_UI_Single_Line_Field( 'slug', __( 'Slug', 'woocommerce-multilingual' ), $this->data, true ) );
97
- $this->add_field( new WPML_Editor_UI_WYSIWYG_Field( 'product_content', __( 'Content / Description', 'woocommerce-multilingual' ), $this->data, true ) );
98
 
99
  $excerpt_section = new WPML_Editor_UI_Field_Section( __( 'Excerpt', 'woocommerce-multilingual' ) );
100
- $excerpt_section->add_field( new WPML_Editor_UI_WYSIWYG_Field( 'product_excerpt', null, $this->data, true ) );
101
  $this->add_field( $excerpt_section );
102
 
103
  $purchase_note_section = new WPML_Editor_UI_Field_Section( __( 'Purchase note', 'woocommerce-multilingual' ) );
@@ -136,16 +142,35 @@ class WCML_Editor_UI_Product_Job extends WPML_Editor_UI_Job {
136
  }
137
 
138
  $custom_fields = $this->get_product_custom_fields_to_translate( $this->product_id );
 
 
139
  if( $this->product_type === 'external' ){
140
  $custom_fields = array_diff( $custom_fields, array( '_product_url', '_button_text' ) );
141
  }
142
 
143
  if( $custom_fields ) {
 
144
  $custom_fields_section = new WPML_Editor_UI_Field_Section( __( 'Custom Fields', 'woocommerce-multilingual' ) );
145
 
146
- $this->add_custom_fields_ui_section( $custom_fields_section, $custom_fields, false );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
 
148
- $this->add_field( $custom_fields_section );
 
 
149
  }
150
 
151
  if( $this->woocommerce_wpml->products->is_variable_product( $this->product_id ) ){
@@ -204,6 +229,29 @@ class WCML_Editor_UI_Product_Job extends WPML_Editor_UI_Job {
204
  }
205
  }
206
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  if( $this->product_type === 'external' ){
208
  $external_product_section = new WPML_Editor_UI_Field_Section( __( 'External Product', 'woocommerce-multilingual' ) );
209
  $external_product_section->add_field( new WPML_Editor_UI_Single_Line_Field( '_product_url', __( 'Product url', 'woocommerce-multilingual' ), $this->data, true ) );
@@ -245,7 +293,9 @@ class WCML_Editor_UI_Product_Job extends WPML_Editor_UI_Job {
245
 
246
  }
247
 
248
-
 
 
249
  function get_data() {
250
 
251
  $trn_product_id = apply_filters( 'translate_object_id', $this->product_id, 'product', false, $this->get_target_language() );
@@ -306,6 +356,27 @@ class WCML_Editor_UI_Product_Job extends WPML_Editor_UI_Job {
306
  }
307
  }
308
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  $element_data = $this->add_custom_field_to_element_data( $element_data, $this->product_id, isset( $translation->ID ) ? $translation->ID : false, false );
310
 
311
  if( $is_variable_product ){
@@ -514,6 +585,7 @@ class WCML_Editor_UI_Product_Job extends WPML_Editor_UI_Job {
514
 
515
  $this->woocommerce_wpml->sync_product_data->duplicate_product_post_meta( $this->product_id, $tr_product_id, $translations );
516
 
 
517
  //sync taxonomies
518
  $this->woocommerce_wpml->sync_product_data->sync_product_taxonomies( $this->product_id, $tr_product_id, $this->get_target_language() );
519
 
@@ -535,7 +607,7 @@ class WCML_Editor_UI_Product_Job extends WPML_Editor_UI_Job {
535
  }
536
 
537
  // synchronize post variations
538
- $this->woocommerce_wpml->sync_variations_data->sync_product_variations( $this->product_id, $tr_product_id, $this->get_target_language(), $translations );
539
 
540
  $this->woocommerce_wpml->sync_product_data->sync_linked_products( $this->product_id, $tr_product_id, $this->get_target_language() );
541
  //save images texts
@@ -587,6 +659,31 @@ class WCML_Editor_UI_Product_Job extends WPML_Editor_UI_Job {
587
 
588
  }
589
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
590
  public function get_custom_product_atributes( )
591
  {
592
  $attributes = get_post_meta( $this->product_id, '_product_attributes', true);
8
  * @var SitePress
9
  */
10
  private $sitepress;
11
+ /**
12
+ * @var TranslationManagement
13
+ */
14
+ private $tm_instance;
15
  /**
16
  * @var WPDB
17
  */
23
  private $not_display_fields_for_variables_product;
24
 
25
  function __construct( $job_details, &$woocommerce_wpml, &$sitepress, &$wpdb ) {
26
+ global $iclTranslationManagement;
27
 
28
  $this->woocommerce_wpml =& $woocommerce_wpml;
29
  $this->sitepress =& $sitepress;
30
+ $this->tm_instance =& $iclTranslationManagement;
31
  $this->wpdb =& $wpdb;
32
  $this->not_display_fields_for_variables_product = array( '_purchase_note', '_regular_price', '_sale_price',
33
  '_price', '_min_variation_price', '_max_variation_price',
100
 
101
  $this->add_field( new WPML_Editor_UI_Single_Line_Field( 'title', __( 'Title', 'woocommerce-multilingual' ), $this->data, true ) );
102
  $this->add_field( new WPML_Editor_UI_Single_Line_Field( 'slug', __( 'Slug', 'woocommerce-multilingual' ), $this->data, true ) );
103
+ $this->add_field( new WCML_Editor_UI_WYSIWYG_Field( 'product_content', __( 'Content / Description', 'woocommerce-multilingual' ), $this->data, true ) );
104
 
105
  $excerpt_section = new WPML_Editor_UI_Field_Section( __( 'Excerpt', 'woocommerce-multilingual' ) );
106
+ $excerpt_section->add_field( new WCML_Editor_UI_WYSIWYG_Field( 'product_excerpt', null, $this->data, true ) );
107
  $this->add_field( $excerpt_section );
108
 
109
  $purchase_note_section = new WPML_Editor_UI_Field_Section( __( 'Purchase note', 'woocommerce-multilingual' ) );
142
  }
143
 
144
  $custom_fields = $this->get_product_custom_fields_to_translate( $this->product_id );
145
+
146
+
147
  if( $this->product_type === 'external' ){
148
  $custom_fields = array_diff( $custom_fields, array( '_product_url', '_button_text' ) );
149
  }
150
 
151
  if( $custom_fields ) {
152
+
153
  $custom_fields_section = new WPML_Editor_UI_Field_Section( __( 'Custom Fields', 'woocommerce-multilingual' ) );
154
 
155
+ foreach( $custom_fields as $custom_field ){
156
+
157
+ $cf_settings = new WPML_Post_Custom_Field_Setting( $this->tm_instance, $custom_field );
158
+ switch( $cf_settings->get_editor_style() ){
159
+ case 'visual':
160
+ $cf_field = new WPML_Editor_UI_WYSIWYG_Field( $custom_field, $cf_settings->get_editor_label(), $this->data, true );
161
+ break;
162
+ case 'textarea':
163
+ $cf_field = new WPML_Editor_UI_TextArea_Field( $custom_field, $cf_settings->get_editor_label(), $this->data, true );
164
+ break;
165
+ default: //line
166
+ $cf_field = new WPML_Editor_UI_Single_Line_Field( $custom_field, $cf_settings->get_editor_label(), $this->data, true );
167
+ }
168
+
169
+ $custom_fields_section->add_field( $cf_field );
170
 
171
+ }
172
+
173
+ $this->add_field( $custom_fields_section );
174
  }
175
 
176
  if( $this->woocommerce_wpml->products->is_variable_product( $this->product_id ) ){
229
  }
230
  }
231
 
232
+ $taxonomies = get_object_taxonomies( 'product', 'objects' );
233
+ foreach( $taxonomies as $taxonomy => $taxonomy_obj ){
234
+ if( $taxonomy != 'product_type' && is_taxonomy_translated( $taxonomy ) ){
235
+ $product_terms = wp_get_post_terms( $this->product_id, $taxonomy );
236
+ if( $product_terms ){
237
+ $tax_section = new WPML_Editor_UI_Field_Section( $taxonomy_obj->label, __( 'Changes in these translations will affect terms in general! ( Not only for this product )', 'woocommerce-multilingual' ));
238
+ foreach( $product_terms as $term ){
239
+ if(
240
+ $this->sitepress->get_setting( 'tm_block_retranslating_terms' ) &&
241
+ !is_null( apply_filters( 'translate_object_id', $term->term_id, $taxonomy, false, $this->get_target_language() ) )
242
+ ){
243
+ continue;
244
+ }
245
+ $term_field = new WPML_Editor_UI_Single_Line_Field( 't_'. $term->term_id, '', $this->data, false );
246
+ $tax_section->add_field( $term_field );
247
+ }
248
+ if( isset( $term_field ) ){
249
+ $this->add_field( $tax_section );
250
+ }
251
+ }
252
+ }
253
+ }
254
+
255
  if( $this->product_type === 'external' ){
256
  $external_product_section = new WPML_Editor_UI_Field_Section( __( 'External Product', 'woocommerce-multilingual' ) );
257
  $external_product_section->add_field( new WPML_Editor_UI_Single_Line_Field( '_product_url', __( 'Product url', 'woocommerce-multilingual' ), $this->data, true ) );
293
 
294
  }
295
 
296
+ /**
297
+ * @return array
298
+ */
299
  function get_data() {
300
 
301
  $trn_product_id = apply_filters( 'translate_object_id', $this->product_id, 'product', false, $this->get_target_language() );
356
  }
357
  }
358
 
359
+ $taxonomies = get_object_taxonomies( 'product', 'objects' );
360
+ foreach( $taxonomies as $taxonomy => $taxonomy_obj ){
361
+ if( $taxonomy != 'product_type' && is_taxonomy_translated( $taxonomy ) ){
362
+ $product_terms = wp_get_post_terms( $this->product_id, $taxonomy );
363
+ if( $product_terms ){
364
+ foreach( $product_terms as $term ){
365
+ $translated_term = $this->woocommerce_wpml->terms->wcml_get_translated_term( $term->term_id, $taxonomy, $this->get_target_language() );
366
+ if(
367
+ $this->sitepress->get_setting( 'tm_block_retranslating_terms' ) &&
368
+ $translated_term->term_id != $term->term_id
369
+ ){
370
+ continue;
371
+ }
372
+
373
+ $element_data[ 't_'.$term->term_id ] = array( 'original' => $term->name );
374
+ $element_data[ 't_'.$term->term_id ][ 'translation' ] = $translated_term->term_id != $term->term_id ? $translated_term->name : '';
375
+ }
376
+ }
377
+ }
378
+ }
379
+
380
  $element_data = $this->add_custom_field_to_element_data( $element_data, $this->product_id, isset( $translation->ID ) ? $translation->ID : false, false );
381
 
382
  if( $is_variable_product ){
585
 
586
  $this->woocommerce_wpml->sync_product_data->duplicate_product_post_meta( $this->product_id, $tr_product_id, $translations );
587
 
588
+ $this->save_translated_terms( );
589
  //sync taxonomies
590
  $this->woocommerce_wpml->sync_product_data->sync_product_taxonomies( $this->product_id, $tr_product_id, $this->get_target_language() );
591
 
607
  }
608
 
609
  // synchronize post variations
610
+ $this->woocommerce_wpml->sync_variations_data->sync_product_variations( $this->product_id, $tr_product_id, $this->get_target_language(), $translations, true );
611
 
612
  $this->woocommerce_wpml->sync_product_data->sync_linked_products( $this->product_id, $tr_product_id, $this->get_target_language() );
613
  //save images texts
659
 
660
  }
661
 
662
+ private function save_translated_terms() {
663
+ $job_data = array();
664
+ parse_str( $_POST['data'], $job_data );
665
+
666
+ foreach( $job_data['fields'] as $field_key => $field ){
667
+ if( substr( $field_key, 0, 2 ) === 't_' ){
668
+ $update = array();
669
+ if ( isset( $field[ 'data' ] ) ) {
670
+ $update[ 'field_data_translated' ] = base64_encode( $field[ 'data' ] );
671
+
672
+ $update[ 'field_finished' ] = 1;
673
+
674
+ $this->wpdb->update(
675
+ $this->wpdb->prefix . 'icl_translate',
676
+ $update,
677
+ array( 'field_type' => $field_key )
678
+ );
679
+ }
680
+ }
681
+ }
682
+
683
+ $job = new WPML_Post_Translation_Job( $job_data[ 'job_id' ] );
684
+ $job->save_terms_to_post();
685
+ }
686
+
687
  public function get_custom_product_atributes( )
688
  {
689
  $attributes = get_post_meta( $this->product_id, '_product_attributes', true);
inc/translation-editor/class-wcml-editor-ui-wysiwyg-field.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WCML_Editor_UI_WYSIWYG_Field extends WPML_Editor_UI_WYSIWYG_Field{
4
+
5
+ public function __construct( $id, $title, $data, $include_copy_button, $requires_complete = false ) {
6
+
7
+ $data[$id]['original'] = strpos( $data[$id]['original'], "\n" ) !== false ?
8
+ wpautop( $data[$id]['original'] ) : $data[$id]['original'];
9
+
10
+ parent::__construct( $id, $title, $data, $include_copy_button, $requires_complete );
11
+ }
12
+
13
+ }
inc/translation-editor/class-wcml-synchronize-product-data.php CHANGED
@@ -21,7 +21,12 @@ class WCML_Synchronize_Product_Data{
21
  add_action( 'icl_pro_translation_completed', array( $this, 'icl_pro_translation_completed' ) );
22
 
23
  add_filter( 'icl_make_duplicate', array( $this, 'icl_make_duplicate'), 110, 4 );
24
- add_action( 'woocommerce_duplicate_product', array( $this, 'woocommerce_duplicate_product' ), 10, 2 );
 
 
 
 
 
25
 
26
  //quick & bulk edit
27
  add_action( 'woocommerce_product_quick_edit_save', array( $this, 'woocommerce_product_quick_edit_save' ) );
@@ -113,6 +118,9 @@ class WCML_Synchronize_Product_Data{
113
  $this->woocommerce_wpml->multi_currency->custom_prices->save_custom_prices( $original_product_id );
114
  }
115
 
 
 
 
116
  }
117
 
118
  public function sync_product_data( $original_product_id, $tr_product_id, $lang ){
@@ -314,15 +322,18 @@ class WCML_Synchronize_Product_Data{
314
 
315
  public function sync_stock_status_for_translations( $id, $status ){
316
 
317
- $type = get_post_type( $id );
318
- $trid = $this->sitepress->get_element_trid( $id, 'post_'.$type );
319
- $translations = $this->sitepress->get_element_translations( $trid, 'post_'.$type, true);
 
320
 
321
- foreach ( $translations as $translation ) {
322
- if ( !$translation->original ) {
323
- update_post_meta( $translation->element_id, '_stock_status', $status );
 
324
  }
325
  }
 
326
  }
327
 
328
  //sync product parent & post_status
@@ -357,24 +368,28 @@ class WCML_Synchronize_Product_Data{
357
  }
358
  }
359
 
 
360
 
 
361
 
362
- public function icl_pro_translation_completed( $tr_product_id ){
363
- $trid = $this->sitepress->get_element_trid( $tr_product_id, 'post_product' );
364
- $translations = $this->sitepress->get_element_translations( $trid, 'post_product' );
365
 
366
- foreach( $translations as $translation ){
367
- if( $translation->original ){
368
- $original_product_id = $translation->element_id;
 
369
  }
370
- }
371
 
372
- if( !isset( $original_product_id ) ){
373
- return;
 
 
 
 
 
374
  }
375
 
376
- $lang = $this->sitepress->get_language_for_element( $tr_product_id, 'post_product' );
377
- $this->sync_product_data( $original_product_id, $tr_product_id, $lang );
378
  }
379
 
380
  public function icl_make_duplicate( $master_post_id, $lang, $postarr, $id ){
@@ -388,8 +403,10 @@ class WCML_Synchronize_Product_Data{
388
  }
389
 
390
  public function woocommerce_product_quick_edit_save( $product ){
391
- $is_original = $this->woocommerce_wpml->products->is_original_product( $product->id );
392
- $trid = $this->sitepress->get_element_trid( $product->id, 'post_product' );
 
 
393
 
394
  if( $trid ){
395
  $translations = $this->sitepress->get_element_translations( $trid, 'post_product' );
@@ -397,12 +414,12 @@ class WCML_Synchronize_Product_Data{
397
  foreach( $translations as $translation ){
398
  if( $is_original ){
399
  if( !$translation->original ){
400
- $this->sync_product_data( $product->id, $translation->element_id, $translation->language_code );
401
- $this->sync_date_and_parent( $product->id, $translation->element_id, $translation->language_code );
402
  }
403
  }elseif( $translation->original ){
404
- $this->sync_product_data( $translation->element_id, $product->id, $this->sitepress->get_language_for_element( $product->id, 'post_product' ) );
405
- $this->sync_date_and_parent( $translation->element_id, $product->id, $this->sitepress->get_language_for_element( $product->id, 'post_product' ) );
406
  }
407
  }
408
  }
21
  add_action( 'icl_pro_translation_completed', array( $this, 'icl_pro_translation_completed' ) );
22
 
23
  add_filter( 'icl_make_duplicate', array( $this, 'icl_make_duplicate'), 110, 4 );
24
+
25
+ if( ( defined('WC_VERSION') && version_compare( WC_VERSION , '2.7', '<' ) ) ) {
26
+ add_action('woocommerce_duplicate_product', array($this, 'woocommerce_duplicate_product'), 10, 2);
27
+ }else{
28
+ add_action( 'woocommerce_product_duplicate', array( $this, 'woocommerce_duplicate_product' ), 10, 2 );
29
+ }
30
 
31
  //quick & bulk edit
32
  add_action( 'woocommerce_product_quick_edit_save', array( $this, 'woocommerce_product_quick_edit_save' ) );
118
  $this->woocommerce_wpml->multi_currency->custom_prices->save_custom_prices( $original_product_id );
119
  }
120
 
121
+ //save files option
122
+ $this->woocommerce_wpml->downloadable->save_files_option( $original_product_id );
123
+
124
  }
125
 
126
  public function sync_product_data( $original_product_id, $tr_product_id, $lang ){
322
 
323
  public function sync_stock_status_for_translations( $id, $status ){
324
 
325
+ if( $this->woocommerce_wpml->products->is_original_product( $id ) ){
326
+ $type = get_post_type( $id );
327
+ $trid = $this->sitepress->get_element_trid( $id, 'post_'.$type );
328
+ $translations = $this->sitepress->get_element_translations( $trid, 'post_'.$type, true);
329
 
330
+ foreach ( $translations as $translation ) {
331
+ if ( !$translation->original ) {
332
+ update_post_meta( $translation->element_id, '_stock_status', $status );
333
+ }
334
  }
335
  }
336
+
337
  }
338
 
339
  //sync product parent & post_status
368
  }
369
  }
370
 
371
+ public function icl_pro_translation_completed( $tr_product_id ){
372
 
373
+ if( get_post_type( $tr_product_id ) == 'product' ){
374
 
375
+ $trid = $this->sitepress->get_element_trid( $tr_product_id, 'post_product' );
376
+ $translations = $this->sitepress->get_element_translations( $trid, 'post_product' );
 
377
 
378
+ foreach( $translations as $translation ){
379
+ if( $translation->original ){
380
+ $original_product_id = $translation->element_id;
381
+ }
382
  }
 
383
 
384
+ if( !isset( $original_product_id ) ){
385
+ return;
386
+ }
387
+
388
+ $lang = $this->sitepress->get_language_for_element( $tr_product_id, 'post_product' );
389
+ $this->sync_product_data( $original_product_id, $tr_product_id, $lang );
390
+
391
  }
392
 
 
 
393
  }
394
 
395
  public function icl_make_duplicate( $master_post_id, $lang, $postarr, $id ){
403
  }
404
 
405
  public function woocommerce_product_quick_edit_save( $product ){
406
+
407
+ $product_id = WooCommerce_Functions_Wrapper::get_product_id( $product );
408
+ $is_original = $this->woocommerce_wpml->products->is_original_product( $product_id );
409
+ $trid = $this->sitepress->get_element_trid( $product_id, 'post_product' );
410
 
411
  if( $trid ){
412
  $translations = $this->sitepress->get_element_translations( $trid, 'post_product' );
414
  foreach( $translations as $translation ){
415
  if( $is_original ){
416
  if( !$translation->original ){
417
+ $this->sync_product_data( $product_id, $translation->element_id, $translation->language_code );
418
+ $this->sync_date_and_parent( $product_id, $translation->element_id, $translation->language_code );
419
  }
420
  }elseif( $translation->original ){
421
+ $this->sync_product_data( $translation->element_id, $product_id, $this->sitepress->get_language_for_element( $product_id, 'post_product' ) );
422
+ $this->sync_date_and_parent( $translation->element_id, $product_id, $this->sitepress->get_language_for_element( $product_id, 'post_product' ) );
423
  }
424
  }
425
  }
inc/translation-editor/class-wcml-synchronize-variations-data.php CHANGED
@@ -232,7 +232,7 @@ class WCML_Synchronize_Variations_Data{
232
  public function duplicate_variation_data( $original_variation_id, $variation_id, $data, $lang, $trbl ){
233
  global $iclTranslationManagement;
234
 
235
- if( $this->woocommerce_wpml->sync_product_data->check_if_product_fields_sync_needed( $original_variation_id, $variation_id, 'postmeta_fields' ) ){
236
  // custom fields
237
  $settings = $iclTranslationManagement->settings[ 'custom_fields_translation' ];
238
  $all_meta = get_post_custom( $original_variation_id );
@@ -252,7 +252,12 @@ class WCML_Synchronize_Variations_Data{
252
  $meta_value = $trn_post_meta['meta_value'];
253
  $meta_key = $trn_post_meta['meta_key'];
254
  }
255
- update_post_meta( $variation_id, $meta_key, $meta_value );
 
 
 
 
 
256
  }elseif ( !isset( $settings[ $meta_key ] ) || $settings[ $meta_key ] == WPML_IGNORE_CUSTOM_FIELD ) {
257
  continue;
258
  }
@@ -275,6 +280,31 @@ class WCML_Synchronize_Variations_Data{
275
  }
276
  }
277
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
278
  public function delete_removed_variation_attributes( $orig_product_id, $variation_id ){
279
 
280
  $original_product_attr = get_post_meta( $orig_product_id, '_product_attributes', true );
232
  public function duplicate_variation_data( $original_variation_id, $variation_id, $data, $lang, $trbl ){
233
  global $iclTranslationManagement;
234
 
235
+ if( $this->woocommerce_wpml->sync_product_data->check_if_product_fields_sync_needed( $original_variation_id, $variation_id, 'postmeta_fields' ) || $trbl ){
236
  // custom fields
237
  $settings = $iclTranslationManagement->settings[ 'custom_fields_translation' ];
238
  $all_meta = get_post_custom( $original_variation_id );
252
  $meta_value = $trn_post_meta['meta_value'];
253
  $meta_key = $trn_post_meta['meta_key'];
254
  }
255
+
256
+ if( $meta_key == '_stock'){
257
+ $this->update_stock_quantity( $variation_id, $meta_value );
258
+ }else{
259
+ update_post_meta( $variation_id, $meta_key, $meta_value );
260
+ }
261
  }elseif ( !isset( $settings[ $meta_key ] ) || $settings[ $meta_key ] == WPML_IGNORE_CUSTOM_FIELD ) {
262
  continue;
263
  }
280
  }
281
  }
282
 
283
+ //use direct query to update '_stock' to not trigger additional filters
284
+ public function update_stock_quantity( $variation_id, $meta_value ){
285
+
286
+ if( !get_post_meta( $variation_id, '_stock' ) ){
287
+ $this->wpdb->insert( $this->wpdb->postmeta,
288
+ array(
289
+ 'meta_value' => $meta_value,
290
+ 'meta_key' => '_stock',
291
+ 'post_id' => $variation_id
292
+ )
293
+ );
294
+ }else{
295
+ $this->wpdb->update( $this->wpdb->postmeta,
296
+ array(
297
+ 'meta_value' => $meta_value
298
+ ),
299
+ array(
300
+ 'meta_key' => '_stock',
301
+ 'post_id' => $variation_id
302
+ )
303
+ );
304
+ }
305
+
306
+ }
307
+
308
  public function delete_removed_variation_attributes( $orig_product_id, $variation_id ){
309
 
310
  $original_product_attr = get_post_meta( $orig_product_id, '_product_attributes', true );
inc/translation-editor/class-wcml-translation-editor.php CHANGED
@@ -204,10 +204,38 @@ class WCML_Translation_Editor{
204
 
205
  if( !$product_id ){
206
  return;
207
- }elseif( ! $this->woocommerce_wpml->products->is_original_product( $product_id ) && get_post_status( $product_id ) != 'auto-draft' ){ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  <script type="text/javascript">
209
  jQuery(document).ready(function() {
210
- wcml_lock_variation_fields();
211
  });
212
  </script>
213
  <?php
204
 
205
  if( !$product_id ){
206
  return;
207
+ }elseif( ! $this->woocommerce_wpml->products->is_original_product( $product_id ) && get_post_status( $product_id ) != 'auto-draft' ){
208
+
209
+ $args = array(
210
+ 'post_type' => 'product_variation',
211
+ 'post_status' => array( 'private', 'publish' ),
212
+ 'posts_per_page' => ! empty( $_POST['per_page'] ) ? absint( $_POST['per_page'] ) : 10,
213
+ 'paged' => ! empty( $_POST['page'] ) ? absint( $_POST['page'] ) : 1,
214
+ 'orderby' => array( 'menu_order' => 'ASC', 'ID' => 'DESC' ),
215
+ 'post_parent' => $product_id,
216
+ );
217
+
218
+ $variations = get_posts( $args );
219
+ $original_language = $this->woocommerce_wpml->products->get_original_product_language( $product_id );
220
+ $file_path_sync = array();
221
+
222
+ if ( $variations ) {
223
+ foreach ($variations as $variation) {
224
+ $variation_id = absint( $variation->ID );
225
+ $original_id = apply_filters( 'translate_object_id', $variation_id, 'product_variation', true, $original_language );
226
+ $custom_product_sync = get_post_meta( $original_id, 'wcml_sync_files', true );
227
+ if( $custom_product_sync && $custom_product_sync == 'self' ) {
228
+ $file_path_sync[ $variation_id ] = false;
229
+ }elseif( $custom_product_sync && $custom_product_sync == 'auto' ){
230
+ $file_path_sync[ $variation_id ] = true;
231
+ }
232
+ }
233
+ }
234
+
235
+ ?>
236
  <script type="text/javascript">
237
  jQuery(document).ready(function() {
238
+ wcml_lock_variation_fields( <?php echo json_encode( $file_path_sync ) ?> );
239
  });
240
  </script>
241
  <?php
inc/wcml-cart-switch-lang-functions.php CHANGED
@@ -60,7 +60,10 @@ class WCML_Cart_Switch_Lang_Functions{
60
  $new_language_details = $sitepress->get_language_details( $this->lang_to );
61
  $current_language_details = $sitepress->get_language_details( $this->lang_from );
62
  $dialog_title = __( 'Switching language?', 'woocommerce-multilingual' );
63
- $confirmation_message = sprintf( __( "You've switched language and there are items in the cart. If you keep the %s language, the cart will be emptied and you will have to add the items again to the cart.", 'woocommerce-multilingual' ), $new_language_details[ 'display_name' ] );
 
 
 
64
  $stay_in = sprintf( __( 'Stay in %s', 'woocommerce-multilingual' ), $new_language_details[ 'display_name' ] );
65
  $switch_to = sprintf( __( 'Switch back to %s', 'woocommerce-multilingual' ), $current_language_details[ 'display_name' ] );
66
 
60
  $new_language_details = $sitepress->get_language_details( $this->lang_to );
61
  $current_language_details = $sitepress->get_language_details( $this->lang_from );
62
  $dialog_title = __( 'Switching language?', 'woocommerce-multilingual' );
63
+ $confirmation_message = esc_html ( sprintf(
64
+ __( "You've switched language and there are items in the cart. If you keep the %s language, the cart will be emptied and you will have to add the items again to the cart.", 'woocommerce-multilingual' ),
65
+ $new_language_details[ 'display_name' ]
66
+ ) );
67
  $stay_in = sprintf( __( 'Stay in %s', 'woocommerce-multilingual' ), $new_language_details[ 'display_name' ] );
68
  $switch_to = sprintf( __( 'Switch back to %s', 'woocommerce-multilingual' ), $current_language_details[ 'display_name' ] );
69
 
inc/wcml-switch-lang-request.php CHANGED
@@ -133,7 +133,13 @@ class WCML_Switch_Lang_Request{
133
 
134
  public function get_requested_lang() {
135
 
136
- return $this->wp_api->is_comments_post_page() ? $this->get_cookie_lang() : $this->get_request_uri_lang();
 
 
 
 
 
 
137
  }
138
 
139
  /**
133
 
134
  public function get_requested_lang() {
135
 
136
+ return $this->is_comments_post_page() ? $this->get_cookie_lang() : $this->get_request_uri_lang();
137
+ }
138
+
139
+ public function is_comments_post_page() {
140
+ global $pagenow;
141
+
142
+ return 'wp-comments-post.php' === $pagenow;
143
  }
144
 
145
  /**
locale/orig/woocommerce-multilingual.po CHANGED
@@ -13,1131 +13,1285 @@ msgstr ""
13
  "Language:en\n"
14
  "MIME-Version: 1.0\n"
15
 
16
- # $translation_array = array(
17
- # 'installing' => __( 'Installing %s', 'installer' ),
18
- # 'updating' => __( 'Updating %s', 'installer' ),
19
-
20
- msgid "Installing %s"
21
- msgstr ""
22
-
23
- # 'installing' => __( 'Installing %s', 'installer' ),
24
- # 'updating' => __( 'Updating %s', 'installer' ),
25
- # 'activating' => __( 'Activating %s', 'installer' )
26
 
27
- msgid "Updating %s"
28
  msgstr ""
29
 
30
- # 'updating' => __( 'Updating %s', 'installer' ),
31
- # 'activating' => __( 'Activating %s', 'installer' )
32
- # );
33
 
34
- msgid "Activating %s"
35
  msgstr ""
36
 
37
- # $this->menu_multisite_redirect();
38
- # add_options_page(__('Installer', 'installer'), __('Installer', 'installer'), 'manage_options', 'installer', array($this, 'show_products')) ;
39
- # }else{
40
 
41
- msgid "Installer"
42
  msgstr ""
43
 
44
- # public function plugins_action_links_registered($links){
45
- # $links[] = '<a href="' . $this->menu_url() . '">' . __('Registered', 'installer') . '</a>';
46
- # return $links;
47
 
48
- msgid "Registered"
49
  msgstr ""
50
 
51
- # public function plugins_action_links_not_registered($links){
52
- # $links[] = '<a href="' . $this->menu_url() . '">' . __('Register', 'installer') . '</a>';
53
- # return $links;
54
 
55
- msgid "Register"
56
  msgstr ""
57
 
58
- # echo '<div class="updated error otgs-is-dismissible"><p>';
59
- # printf(__("To get automatic updates, you need to register %s for this site. %sRegister %s%s", 'sitepress'),
60
- # $nag['product_name'], '<a class="button-primary" href="' . $this->menu_url() . '">', $nag['product_name'], '</a>');
61
 
62
- msgid "To get automatic updates, you need to register %s for this site. %sRegister %s%s"
63
  msgstr ""
64
 
65
- # echo '</p>';
66
- # echo '<span class="installer-dismiss-nag notice-dismiss" data-repository="' . $nag['repository_id'] . '"><span class="screen-reader-text">' . __('Dismiss', 'sitepress') . '</span></span>';
67
- # echo '</div>';
68
 
69
- msgid "Dismiss"
70
  msgstr ""
71
 
72
- #
73
- # $tabs['commercial'] = __('Commercial', 'installer');
74
- #
75
 
76
- msgid "Commercial"
77
  msgstr ""
78
 
79
- #
80
- # $error = sprintf(__("Installer cannot display the products information because the automatic updating for %s was explicitly disabled with the configuration below (usually in wp-config.php):", 'installer'), strtoupper( join(', ', $repository_names) ));
81
- # $error .= '<br /><br /><code>define("OTGS_DISABLE_AUTO_UPDATES", true);</code><br /><br />';
82
 
83
- msgid "Installer cannot display the products information because the automatic updating for %s was explicitly disabled with the configuration below (usually in wp-config.php):"
84
  msgstr ""
85
 
86
- # $error .= '<br /><br /><code>define("OTGS_DISABLE_AUTO_UPDATES", true);</code><br /><br />';
87
- # $error .= sprintf(__("In order to see the products information, please run the %smanual updates check%s to initialize the products list or (temporarily) remove the above code.", 'installer'), '<a href="' . admin_url('update-core.php') . '">', '</a>');
88
  #
 
 
89
 
90
- msgid "In order to see the products information, please run the %smanual updates check%s to initialize the products list or (temporarily) remove the above code."
91
  msgstr ""
92
 
93
- #
94
- # $error = sprintf(__("Installer cannot contact our updates server to get information about the available products and check for new versions. If you are seeing this message for the first time, you can ignore it, as it may be a temporary communication problem. If the problem persists and your WordPress admin is slowing down, you can disable automated version checks. Add the following line to your wp-config.php file:", 'installer'), strtoupper($id));
95
- # $error .= '<br /><br /><code>define("OTGS_DISABLE_AUTO_UPDATES", true);</code>';
96
 
97
- msgid "Installer cannot contact our updates server to get information about the available products and check for new versions. If you are seeing this message for the first time, you can ignore it, as it may be a temporary communication problem. If the problem persists and your WordPress admin is slowing down, you can disable automated version checks. Add the following line to your wp-config.php file:"
98
  msgstr ""
99
 
100
  #
101
- # echo '<center>' . __('No repositories defined.', 'installer') . '</center>';
102
- #
103
 
104
- msgid "No repositories defined."
105
  msgstr ""
106
 
107
- # } else {
108
- # $error = __( 'Invalid site key for the current site.', 'installer' )
109
- # . '<br /><div class="installer-footnote">' . __('Please note that the site key is case sensitive.', 'installer') . '</div>';
110
 
111
- msgid "Invalid site key for the current site."
112
  msgstr ""
113
 
114
- # $error = __( 'Invalid site key for the current site.', 'installer' )
115
- # . '<br /><div class="installer-footnote">' . __('Please note that the site key is case sensitive.', 'installer') . '</div>';
116
  # }
117
 
118
- msgid "Please note that the site key is case sensitive."
119
  msgstr ""
120
 
121
- # if( preg_match('#Could not resolve host: (.*)#', $error, $matches) || preg_match('#Couldn\'t resolve host \'(.*)\'#', $error, $matches) ){
122
- # $error = sprintf(__("%s cannot access %s to register. Try again to see if it's a temporary problem. If the problem continues, make sure that this site has access to the Internet. You can still use the plugin without registration, but you will not receive automated updates.", 'installer'),
123
- # '<strong><i>' . $this->get_generic_product_name($repository_id) . '</i></strong>',
124
 
125
- msgid "%s cannot access %s to register. Try again to see if it's a temporary problem. If the problem continues, make sure that this site has access to the Internet. You can still use the plugin without registration, but you will not receive automated updates."
126
  msgstr ""
127
 
128
- # unset($this->settings['repositories'][$repository_id]['subscription']);
129
- # $error = __( 'Invalid site key for the current site. If the error persists, try to unregister first and then register again with the same site key.', 'installer' );
130
- # }
131
 
132
- msgid "Invalid site key for the current site. If the error persists, try to unregister first and then register again with the same site key."
133
  msgstr ""
134
 
135
- # $days = 30;
136
- # $message = __('You will have to renew your subscription in order to continue getting the updates and support.', 'installer');
137
- #
138
 
139
- msgid "You will have to renew your subscription in order to continue getting the updates and support."
140
  msgstr ""
141
 
142
- # echo $this->_plugins_renew_warnings[$plugin_file]. ' ';
143
- # printf(__('%sRenew here%s.', 'installer'),
144
- # '<a href="' . $this->menu_url() . '">', '</a>');
145
 
146
- msgid "%sRenew here%s."
147
  msgstr ""
148
 
149
- # $ret = false;
150
- # $message = __('Your subscription appears to no longer be valid. Please try to register again using a valid site key.', 'installer');
151
- # }
152
 
153
- msgid "Your subscription appears to no longer be valid. Please try to register again using a valid site key."
154
  msgstr ""
155
 
156
- # <p class="installer-q-icon">
157
- # <?php printf( __('You must have a valid subscription in order to get upgrades or support for this plugin. %sPurchase a subscription or enter an existing site key%s.', 'installer'),
158
- # '<a href="' . $this->menu_url() . '">', '</a>'); ?>
159
 
160
- msgid "You must have a valid subscription in order to get upgrades or support for this plugin. %sPurchase a subscription or enter an existing site key%s."
161
  msgstr ""
162
 
163
  #
164
- # $error_message = sprintf(__("%s cannot update because your site's registration is not valid. Please %sregister %s%s again for this site first.", 'installer'),
165
- # '<strong>' . $plugin_name . '</strong>', '<a target="_top" href="' . $this->menu_url() . '&validate_repository=' . $plugin_repository .
166
 
167
- msgid "%s cannot update because your site's registration is not valid. Please %sregister %s%s again for this site first."
168
  msgstr ""
169
 
170
- # echo '<div class="wrap">';
171
- # echo '<h2>' . __('Update Plugin') . '</h2>';
172
- # echo '<a href="' . admin_url('plugins.php') . '">' . __('Return to the plugins page') . '</a>';
173
 
174
- msgid "Update Plugin"
175
  msgstr ""
176
 
177
- # echo '<h2>' . __('Update Plugin') . '</h2>';
178
- # echo '<a href="' . admin_url('plugins.php') . '">' . __('Return to the plugins page') . '</a>';
179
- # echo '</div>';
180
 
181
- msgid "Return to the plugins page"
182
  msgstr ""
183
 
184
- # echo '<div><p class="installer-warn-box">' .
185
- # sprintf(_n('Your subscription expires in %d day.', 'Your subscription expires in %d days.', $days_to_expiration, 'installer'), $days_to_expiration) .
186
- # '<br />' . $message .
187
 
188
- msgid "Your subscription expires in %d day."
189
  msgstr ""
190
 
191
- # echo '<div><p class="installer-warn-box">' .
192
- # sprintf(_n('Your subscription expires in %d day.', 'Your subscription expires in %d days.', $days_to_expiration, 'installer'), $days_to_expiration) .
193
- # '<br />' . $message .
194
 
195
- msgid "Your subscription expires in %d days."
196
  msgstr ""
197
 
198
- # $theme_repo_name = $this->installer_theme_get_repo_product_name( $frontend_tab_selected );;
199
- # $response['unregistered_messages'] = sprintf( __( 'To install and update %s, please %sregister%s %s for this site.', 'installer' ),
200
- # $theme_repo_name, '<a href="' . $registration_url . '">', '</a>', $theme_repo_name );
201
 
202
- msgid "To install and update %s, please %sregister%s %s for this site."
203
  msgstr ""
204
 
205
- # public function win_paths_exception_message(){
206
- # return __('Downloading is not possible. WordPress cannot create required folders because of the
207
- # 256 characters limitation of the current Windows environment.', 'installer');
208
 
209
- msgid "Downloading is not possible. WordPress cannot create required folders because of the\n 256 characters limitation of the current Windows environment."
210
  msgstr ""
211
 
212
- # echo '<h2>' . __('Update Plugin') . '</h2>';
213
- # echo '<a href="' . admin_url('update-core.php') . '">' . __('Return to the updates page', 'installer') . '</a>';
214
- # echo '</div>';
215
 
216
- msgid "Return to the updates page"
217
  msgstr ""
218
 
219
- # <?php if( !WP_Installer()->dependencies->is_uploading_allowed() ): ?>
220
- # <p><?php printf(__('Downloading is not possible because WordPress cannot write into the plugins folder. %sHow to fix%s.', 'installer'),
221
- # '<a href="http://codex.wordpress.org/Changing_File_Permissions">', '</a>') ?></p>
222
 
223
- msgid "Downloading is not possible because WordPress cannot write into the plugins folder. %sHow to fix%s."
224
  msgstr ""
225
 
226
- # <br clear="all" /><br />
227
- # <strong><?php _e('Downloads:', 'installer') ?></strong>
228
- #
229
 
230
- msgid "Downloads:"
231
  msgstr ""
232
 
233
- # <th>&nbsp;</th>
234
- # <th><?php _e('Plugin', 'installer') ?></th>
235
- # <th><?php _e('Current version', 'installer') ?></th>
236
 
237
- msgid "Plugin"
238
  msgstr ""
239
 
240
- # <th><?php _e('Plugin', 'installer') ?></th>
241
- # <th><?php _e('Current version', 'installer') ?></th>
242
- # <th><?php _e('Released', 'installer') ?></th>
243
 
244
- msgid "Current version"
245
  msgstr ""
246
 
247
- # <th><?php _e('Current version', 'installer') ?></th>
248
- # <th><?php _e('Released', 'installer') ?></th>
249
- # <th><?php _e('Installed version', 'installer') ?></th>
250
 
251
- msgid "Released"
252
  msgstr ""
253
 
254
- # <th><?php _e('Released', 'installer') ?></th>
255
- # <th><?php _e('Installed version', 'installer') ?></th>
256
- # <th>&nbsp;</th>
257
 
258
- msgid "Installed version"
259
  msgstr ""
260
 
261
- # <span class="<?php echo $class ?>"><?php echo $v; ?></span>
262
- # <?php if($this->plugin_is_embedded_version($download['name'], $download['slug'])): ?>&nbsp;<?php _e('(embedded)', 'installer'); ?><?php endif; ?>
263
- # <?php endif; ?>
264
 
265
- msgid "(embedded)"
266
  msgstr ""
267
 
268
- # <td>
269
- # <span class="installer-status-installing"><?php _e('installing...', 'installer') ?></span>
270
- # <span class="installer-status-updating"><?php _e('updating...', 'installer') ?></span>
271
 
272
- msgid "installing..."
273
  msgstr ""
274
 
275
- # <span class="installer-status-installing"><?php _e('installing...', 'installer') ?></span>
276
- # <span class="installer-status-updating"><?php _e('updating...', 'installer') ?></span>
277
- # <span class="installer-status-installed" data-fail="<?php _e('failed!', 'installer') ?>"><?php _e('installed', 'installer') ?></span>
278
 
279
- msgid "updating..."
280
- msgstr ""
281
-
282
- # <span class="installer-status-updating"><?php _e('updating...', 'installer') ?></span>
283
- # <span class="installer-status-installed" data-fail="<?php _e('failed!', 'installer') ?>"><?php _e('installed', 'installer') ?></span>
284
- # <span class="installer-status-updated" data-fail="<?php _e('failed!', 'installer') ?>"><?php _e('updated', 'installer') ?></span>
285
-
286
- msgid "failed!"
287
  msgstr ""
288
 
289
- # <span class="installer-status-updating"><?php _e('updating...', 'installer') ?></span>
290
- # <span class="installer-status-installed" data-fail="<?php _e('failed!', 'installer') ?>"><?php _e('installed', 'installer') ?></span>
291
- # <span class="installer-status-updated" data-fail="<?php _e('failed!', 'installer') ?>"><?php _e('updated', 'installer') ?></span>
292
 
293
- msgid "installed"
294
  msgstr ""
295
 
296
- # <span class="installer-status-installed" data-fail="<?php _e('failed!', 'installer') ?>"><?php _e('installed', 'installer') ?></span>
297
- # <span class="installer-status-updated" data-fail="<?php _e('failed!', 'installer') ?>"><?php _e('updated', 'installer') ?></span>
298
- # </td>
299
 
300
- msgid "updated"
301
  msgstr ""
302
 
303
- # <td>
304
- # <span class="installer-status-activating"><?php _e('activating', 'installer') ?></span>
305
- # <span class="installer-status-activated"><?php _e('activated', 'installer') ?></span>
306
 
307
- msgid "activating"
308
  msgstr ""
309
 
310
- # <span class="installer-status-activating"><?php _e('activating', 'installer') ?></span>
311
- # <span class="installer-status-activated"><?php _e('activated', 'installer') ?></span>
312
- # </td>
313
 
314
- msgid "activated"
315
  msgstr ""
316
 
317
- # &nbsp;
318
- # <label><input name="activate" type="checkbox" value="1" disabled="disabled" />&nbsp;<?php _e('Activate after download', 'installer') ?></label>
319
- #
320
 
321
- msgid "Activate after download"
322
  msgstr ""
323
 
324
- #
325
- # <div class="installer-status-success"><?php _e('Operation complete!', 'installer') ?></div>
326
- #
327
 
328
- msgid "Operation complete!"
329
  msgstr ""
330
 
331
- #
332
- # <span class="installer-revalidate-message hidden"><?php _e("Download failed!\n\nPlease refresh the page and try again.", 'installer') ?></span>
333
- # </form>
334
 
335
- msgid "Download failed!\n\nPlease refresh the page and try again."
336
  msgstr ""
337
 
338
- #
339
- # <input type="submit" class="button-secondary" value="<?php esc_attr_e('Download', 'installer') ?>" disabled="disabled" />
340
- # &nbsp;
341
 
342
- msgid "Download"
343
  msgstr ""
344
 
345
- # <span><?php _e('Already bought?', 'installer'); ?>&nbsp;</span>
346
- # <a class="enter_site_key_js button-primary" href="#"><?php printf(__('Register %s', 'installer'), $generic_product_name); ?></a>&nbsp;&nbsp;
347
- # <form class="otgsi_site_key_form" method="post">
348
 
349
- msgid "Register %s"
350
  msgstr ""
351
 
352
- #
353
- # <div class="alignleft" style="margin-top:6px;"><?php printf(__('1. Go to your %s%s account%s and add this site URL: %s', 'installer'),
354
- # '<a href="' . $this->settings['repositories'][$repository_id]['data']['site_keys_management_url'] . '?add='.urlencode($this->get_installer_site_url( $repository_id )).'">',
355
 
356
- msgid "1. Go to your %s%s account%s and add this site URL: %s"
357
  msgstr ""
358
 
359
- # <div class="alignright">
360
- # <a class="remove_site_key_js button-secondary" href="#" data-repository=<?php echo $repository_id ?> data-confirmation="<?php esc_attr_e('Are you sure you want to unregister?', 'installer') ?>" data-nonce="<?php echo wp_create_nonce('remove_site_key_' . $repository_id) ?>"><?php printf(__("Unregister %s from this site", 'installer'), $generic_product_name) ?></a>&nbsp;
361
- # <a class="update_site_key_js button-secondary" href="#" data-repository=<?php echo $repository_id ?> data-nonce="<?php echo wp_create_nonce('update_site_key_' . $repository_id) ?>">
362
 
363
- msgid "Unregister %s from this site"
364
  msgstr ""
365
 
366
- # <?php if($expires = $this->settings['repositories'][$repository_id]['subscription']['data']->expires): ?>
367
- # <?php printf(__('%s is registered on this site. You will receive automatic updates until %s', 'installer'), $generic_product_name, date_i18n('F j, Y', strtotime($expires))); ?>
368
- # <?php else: ?>
369
 
370
- msgid "%s is registered on this site. You will receive automatic updates until %s"
371
  msgstr ""
372
 
373
- # <?php else: ?>
374
- # <?php printf(__('%s is registered on this site. Your Lifetime account gives you updates for life.', 'installer'), $generic_product_name); ?>
375
- # <?php endif; ?>
376
 
377
- msgid "%s is registered on this site. Your Lifetime account gives you updates for life."
378
  msgstr ""
379
 
380
  #
381
- # <p><i><?php printf(__('This page lets you install plugins and update existing plugins. To remove any of these plugins, go to the %splugins%s page and if you have the permission to remove plugins you should be able to do this.', 'installer'), '<a href="' . admin_url('plugins.php') . '">' , '</a>'); ?></i></p>
382
- #
383
 
384
- msgid "This page lets you install plugins and update existing plugins. To remove any of these plugins, go to the %splugins%s page and if you have the permission to remove plugins you should be able to do this."
385
  msgstr ""
386
 
387
- # <div style="text-align: right;">
388
- # <span><?php _e('Already bought?', 'installer'); ?>&nbsp;</span>
389
- # <a class="enter_site_key_js button-primary" href="#"><?php printf(__('Register %s', 'installer'), $generic_product_name); ?></a>&nbsp;&nbsp;
390
 
391
- msgid "Already bought?"
392
  msgstr ""
393
 
394
- # <input type="hidden" name="repository_id" value="<?php echo $repository_id ?>">
395
- # <?php _e('2. Enter your site key', 'installer'); ?>
396
- # <input type="text" size="10" name="site_key_<?php echo $repository_id ?>" placeholder="<?php echo esc_attr('site key') ?>" />
397
 
398
- msgid "2. Enter your site key"
399
  msgstr ""
400
 
401
- # <p class="installer-warn-box">
402
- # <?php _e('Subscription expired. You need to either purchase a new subscription or upgrade if available.', 'installer') ?>
403
- # <span class="alignright">
404
 
405
- msgid "Subscription expired. You need to either purchase a new subscription or upgrade if available."
406
  msgstr ""
407
 
408
- # <a class="update_site_key_js button-secondary" href="#" data-repository=<?php echo $repository_id ?> data-nonce="<?php echo wp_create_nonce('update_site_key_' . $repository_id) ?>">
409
- # <?php _e('Revalidate subscription', 'installer'); ?>
410
- # </a>
411
 
412
- msgid "Revalidate subscription"
413
  msgstr ""
414
 
415
- # <br />
416
- # <span class="details"><?php _e("If you have already purchased or renewed your subscription and you can still see this message, please revalidate your subscription", 'installer') ?></span>
417
- # </p>
418
 
419
- msgid "If you have already purchased or renewed your subscription and you can still see this message, please revalidate your subscription"
420
  msgstr ""
421
 
422
- # <a class="update_site_key_js button-secondary" href="#" data-repository=<?php echo $repository_id ?> data-nonce="<?php echo wp_create_nonce('update_site_key_' . $repository_id) ?>">
423
- # <?php _e('Check for updates', 'installer'); ?>
424
- # </a>
425
 
426
- msgid "Check for updates"
427
  msgstr ""
428
 
429
- # <?php if($subpackages_expandable): ?>
430
- # <h5><a class="installer_expand_button" href="#" title="<?php esc_attr_e('Click to see individual components options.', 'installer') ?>"><?php _e('Individual components', 'installer') ?></a></h5>
431
- # <?php endif; ?>
432
 
433
- msgid "Individual components"
434
  msgstr ""
435
 
436
- # <input type="text" size="10" name="site_key_<?php echo $repository_id ?>" placeholder="<?php echo esc_attr('site key') ?>" />
437
- # <input class="button-primary" type="submit" value="<?php esc_attr_e('OK', 'installer') ?>" />
438
- # <input class="button-secondary cancel_site_key_js" type="button" value="<?php esc_attr_e('Cancel', 'installer') ?>" />
439
 
440
- msgid "OK"
441
  msgstr ""
442
 
443
- # <input class="button-primary" type="submit" value="<?php esc_attr_e('OK', 'installer') ?>" />
444
- # <input class="button-secondary cancel_site_key_js" type="button" value="<?php esc_attr_e('Cancel', 'installer') ?>" />
445
- #
446
 
447
- msgid "Cancel"
448
  msgstr ""
449
 
450
- # <div class="alignright">
451
- # <a class="remove_site_key_js button-secondary" href="#" data-repository=<?php echo $repository_id ?> data-confirmation="<?php esc_attr_e('Are you sure you want to unregister?', 'installer') ?>" data-nonce="<?php echo wp_create_nonce('remove_site_key_' . $repository_id) ?>"><?php printf(__("Unregister %s from this site", 'installer'), $generic_product_name) ?></a>&nbsp;
452
- # <a class="update_site_key_js button-secondary" href="#" data-repository=<?php echo $repository_id ?> data-nonce="<?php echo wp_create_nonce('update_site_key_' . $repository_id) ?>">
453
 
454
- msgid "Are you sure you want to unregister?"
455
  msgstr ""
456
 
457
- # <?php if($subpackages_expandable): ?>
458
- # <h5><a class="installer_expand_button" href="#" title="<?php esc_attr_e('Click to see individual components options.', 'installer') ?>"><?php _e('Individual components', 'installer') ?></a></h5>
459
- # <?php endif; ?>
460
 
461
- msgid "Click to see individual components options."
462
  msgstr ""
463
 
464
- # <td class="twelve">
465
- # <div class="installer-status-downloading"><?php _e('downloading...', 'installer') ?></div>
466
- # <div class="installer-status-downloaded" data-fail="<?php _e('failed!', 'installer') ?>"><?php _e('downloaded', 'installer') ?></div>
467
 
468
- msgid "downloading..."
469
  msgstr ""
470
 
471
- # <div class="installer-status-downloading"><?php _e('downloading...', 'installer') ?></div>
472
- # <div class="installer-status-downloaded" data-fail="<?php _e('failed!', 'installer') ?>"><?php _e('downloaded', 'installer') ?></div>
473
- # </td>
474
 
475
- msgid "downloaded"
476
  msgstr ""
477
 
478
  #
479
- # <span class="installer-revalidate-message hidden"><?php _e("Download failed!\n\nClick OK to revalidate your subscription or CANCEL to try again.", 'installer') ?></span>
480
- # </form>
481
 
482
- msgid "Download failed!\n\nClick OK to revalidate your subscription or CANCEL to try again."
483
  msgstr ""
484
 
485
- # <th><?php _e('Plugin', 'installer') ?></th>
486
- # <th><img src="<?php echo $this->plugin_url() ?>/res/img/globe.png" alt="<?php esc_attr_e('Available', 'installer') ?>" width="16" height="16"></th>
487
- # <th><img src="<?php echo $this->plugin_url() ?>/res/img/computer.png" alt="<?php esc_attr_e('Installed', 'installer') ?>" width="16" height="16"></th>
488
 
489
- msgid "Available"
490
  msgstr ""
491
 
492
- # <th><img src="<?php echo $this->plugin_url() ?>/res/img/globe.png" alt="<?php esc_attr_e('Available', 'installer') ?>" width="16" height="16"></th>
493
- # <th><img src="<?php echo $this->plugin_url() ?>/res/img/computer.png" alt="<?php esc_attr_e('Installed', 'installer') ?>" width="16" height="16"></th>
494
- # <th><img src="<?php echo $this->plugin_url() ?>/res/img/dn2.gif" alt="<?php esc_attr_e('Downloading', 'installer') ?>" width="16" height="16"></th>
495
 
496
- msgid "Installed"
497
  msgstr ""
498
 
499
- # <th><img src="<?php echo $this->plugin_url() ?>/res/img/computer.png" alt="<?php esc_attr_e('Installed', 'installer') ?>" width="16" height="16"></th>
500
- # <th><img src="<?php echo $this->plugin_url() ?>/res/img/dn2.gif" alt="<?php esc_attr_e('Downloading', 'installer') ?>" width="16" height="16"></th>
501
- # <th><img src="<?php echo $this->plugin_url() ?>/res/img/on.png" alt="<?php esc_attr_e('Activate', 'installer') ?>" width="16" height="16"></th>
502
 
503
- msgid "Downloading"
504
  msgstr ""
505
 
506
- # <th><img src="<?php echo $this->plugin_url() ?>/res/img/dn2.gif" alt="<?php esc_attr_e('Downloading', 'installer') ?>" width="16" height="16"></th>
507
- # <th><img src="<?php echo $this->plugin_url() ?>/res/img/on.png" alt="<?php esc_attr_e('Activate', 'installer') ?>" width="16" height="16"></th>
508
- # </tr>
509
 
510
- msgid "Activate"
511
  msgstr ""
512
 
513
- # if(empty($args['repository']) || empty($args['package']) || empty($args['product'])){
514
- # echo __('Incorrect setup', 'installer');
515
- # return;
516
 
517
- msgid "Incorrect setup"
518
  msgstr ""
519
 
520
- # if(!$product){
521
- # echo __('Invalid product', 'installer');
522
- # return;
523
 
524
- msgid "Invalid product"
525
  msgstr ""
526
 
527
- # }else{
528
- # echo __('Unknown repository', 'installer');
529
- # return;
530
 
531
- msgid "Unknown repository"
532
  msgstr ""
533
 
534
- # if($subscription_type != $product['subscription_type'] && !$this->have_superior_subscription($subscription_type, $product) && $site_key){
535
- # $subscription_no_match = sprintf(__(' Your current site key (%s) does not match the selected product (%s).', 'installer'), $site_key, $product['name']);
536
  # }
537
 
538
- msgid " Your current site key (%s) does not match the selected product (%s)."
539
  msgstr ""
540
 
541
- #
542
- # <a class="button-primary" href="<?php echo $this->append_parameters_to_buy_url($product['url'], $repository_id, $args) ?>"><?php printf(__('Buy %s', 'installer'), $args['product_name']) ?></a>
543
  #
544
 
545
- msgid "Buy %s"
546
  msgstr ""
547
 
548
- # <br />
549
- # <?php printf(__('Already bought %s?', 'installer'), $args['product_name']) ?>
550
- # <a class="enter_site_key_js" href="#"><?php _e('Enter site key', 'installer') ?></a>&nbsp;&nbsp;
551
 
552
- msgid "Already bought %s?"
553
  msgstr ""
554
 
555
- # <li>
556
- # <a href="<?php echo $this->append_parameters_to_buy_url($renewal['url'], $repository_id, $args) ?>"><?php printf(__('Renew %s', 'installer'), $args['product_name']) ?></a>
557
- # </li>
558
 
559
- msgid "Renew %s"
560
  msgstr ""
561
 
562
- # <center>
563
- # <a class="remove_site_key_js" href="#" data-repository=<?php echo $repository_id ?> data-confirmation="<?php esc_attr_e('Are you sure you want to remove this site key?', 'installer') ?>" data-nonce="<?php echo wp_create_nonce('remove_site_key_' . $repository_id) ?>"><?php printf(__("Remove current site key (%s)", 'installer'), $site_key) ?></a>
564
- # </center>
565
 
566
- msgid "Remove current site key (%s)"
567
  msgstr ""
568
 
569
- # <?php if($support_link): ?>
570
- # <p><a href="<?php echo $support_link ?>" target="_blank"><?php printf(__('%s support on wpml.org', 'installer'), $args['name'] ) ?></a></p>
571
  #
 
 
572
 
573
- msgid "%s support on wpml.org"
574
  msgstr ""
575
 
576
- # <?php printf(__('Already bought %s?', 'installer'), $args['product_name']) ?>
577
- # <a class="enter_site_key_js" href="#"><?php _e('Enter site key', 'installer') ?></a>&nbsp;&nbsp;
578
- #
579
 
580
- msgid "Enter site key"
581
  msgstr ""
582
 
583
- #
584
- # <div><p class="installer-warn-box"><?php _e('Subscription is expired.', 'installer') ?></p></div>
585
- #
586
 
587
- msgid "Subscription is expired."
588
  msgstr ""
589
 
590
- # <input type="text" size="10" name="site_key_<?php echo $repository_id ?>" />
591
- # <input class="button-secondary" type="submit" value="<?php esc_attr_e('Add', 'installer') ?>" />
592
- # </form>
593
 
594
- msgid "Add"
595
  msgstr ""
596
 
597
- # <center>
598
- # <a class="remove_site_key_js" href="#" data-repository=<?php echo $repository_id ?> data-confirmation="<?php esc_attr_e('Are you sure you want to remove this site key?', 'installer') ?>" data-nonce="<?php echo wp_create_nonce('remove_site_key_' . $repository_id) ?>"><?php printf(__("Remove current site key (%s)", 'installer'), $site_key) ?></a>
599
- # </center>
600
 
601
- msgid "Are you sure you want to remove this site key?"
602
  msgstr ""
603
 
604
- #
605
- # $message = sprintf(__('To translate %s please use the %s translation%s page, inside the %sWooCommerce Multilingual admin%s.', 'woocommerce-multilingual'),
606
- # $taxonomy_obj->labels->name,
607
 
608
- msgid "To translate %s please use the %s translation%s page, inside the %sWooCommerce Multilingual admin%s."
609
  msgstr ""
610
 
611
- # $ret['html'] = '<i class="otgs-ico-ok"></i> ';
612
- # $ret['html'] .= sprintf(__('%s do not require translation.', 'woocommerce-multilingual'), get_taxonomy($taxonomy)->labels->name);
613
- # $ret['html'] .= '<small class="actions">';
614
 
615
- msgid "%s do not require translation."
616
  msgstr ""
617
 
618
- # $ret['html'] .= '<small class="actions">';
619
- # $ret['html'] .= '<a href="#unignore-' . $taxonomy . '">' . __( 'Include to translation', 'woocommerce-multilingual' ) . '</a>';
620
- # $ret['html'] .= '</small>';
621
 
622
- msgid "Include to translation"
623
  msgstr ""
624
 
625
- # $ret['html'] = '<i class="otgs-ico-warning-sign"></i> ';
626
- # $ret['html'] .= sprintf( __( '%d %s are missing translations.', 'woocommerce-multilingual' ), $wcml_settings['untranstaled_terms'][ $taxonomy ]['count'], get_taxonomy( $taxonomy )->labels->name );
627
- # $ret['html'] .= ' <a class="button-secondary" href="' . admin_url( 'admin.php?page=wpml-wcml&tab=' . $taxonomy ) . '">' . sprintf( __( 'Translate %s', 'woocommerce-multilingual' ), get_taxonomy( $taxonomy )->labels->name ) . '</a>';
628
 
629
- msgid "%d %s are missing translations."
630
  msgstr ""
631
 
632
- # $ret['html'] .= sprintf( __( '%d %s are missing translations.', 'woocommerce-multilingual' ), $wcml_settings['untranstaled_terms'][ $taxonomy ]['count'], get_taxonomy( $taxonomy )->labels->name );
633
- # $ret['html'] .= ' <a class="button-secondary" href="' . admin_url( 'admin.php?page=wpml-wcml&tab=' . $taxonomy ) . '">' . sprintf( __( 'Translate %s', 'woocommerce-multilingual' ), get_taxonomy( $taxonomy )->labels->name ) . '</a>';
634
- # $ret['html'] .= '<small class="actions">';
635
 
636
- msgid "Translate %s"
637
  msgstr ""
638
 
639
- # $ret['html'] .= '<small class="actions">';
640
- # $ret['html'] .= '<a href="#ignore-' . $taxonomy . '">' . __( 'Exclude from translation', 'woocommerce-multilingual' ) . '</a>';
641
- # $ret['html'] .= '</small>';
642
 
643
- msgid "Exclude from translation"
644
  msgstr ""
645
 
646
- # $ret['html'] = '<i class="otgs-ico-ok"></i> ';
647
- # $ret['html'] .= sprintf(__('All %s are translated.', 'woocommerce-multilingual'), get_taxonomy($taxonomy)->labels->name);
648
- #
649
 
650
- msgid "All %s are translated."
651
  msgstr ""
652
 
653
- #
654
- # $response['progress'] = $response['go'] ? sprintf(__('%d products left', 'woocommerce-multilingual'), count($post_ids) - $posts_processed) : __('Synchronization complete!', 'woocommerce-multilingual');
655
- #
656
 
657
- msgid "%d products left"
658
  msgstr ""
659
 
660
  #
661
- # $response['progress'] = $response['go'] ? sprintf(__('%d products left', 'woocommerce-multilingual'), count($post_ids) - $posts_processed) : __('Synchronization complete!', 'woocommerce-multilingual');
662
  #
663
 
664
- msgid "Synchronization complete!"
665
  msgstr ""
666
 
667
- # }else{
668
- # $errors = sprintf(__('Invalid taxonomy %s', 'woocommerce-multilingual'), $_POST['taxonomy']);
669
- # }
670
 
671
- msgid "Invalid taxonomy %s"
672
  msgstr ""
673
 
674
- # $out .= '<input type="hidden" name="taxonomy" value="' . $taxonomy . '" />';
675
- # $out .= sprintf(__('Some translated %s have different %s assignments.', 'woocommerce-multilingual'),
676
- # '<strong>' . mb_strtolower($wp_post_types[$object_type]->labels->name) . '</strong>',
677
 
678
- msgid "Some translated %s have different %s assignments."
679
  msgstr ""
680
 
681
- # '<strong>' . mb_strtolower($wp_taxonomies[$taxonomy]->labels->name) . '</strong>');
682
- # $out .= '&nbsp;<a class="submit button-secondary" href="#">' . sprintf(__('Update %s for all translated %s', 'woocommerce-multilingual'),
683
- # '<strong>' . mb_strtolower($wp_taxonomies[$taxonomy]->labels->name) . '</strong>',
684
 
685
- msgid "Update %s for all translated %s"
686
  msgstr ""
687
 
688
- # }else{
689
- # $out .= sprintf(__('All %s have the same %s assignments.', 'woocommerce-multilingual'),
690
- # '<strong>' . mb_strtolower($wp_taxonomies[$taxonomy]->labels->name) . '</strong>',
691
 
692
- msgid "All %s have the same %s assignments."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
693
  msgstr ""
694
 
695
  #
696
- # $out .= sprintf(__('Successfully updated %s for all translated %s.', 'woocommerce-multilingual'), $wp_taxonomies[$taxonomy]->labels->name, $wp_post_types[$object_type]->labels->name);
697
  #
698
 
699
- msgid "Successfully updated %s for all translated %s."
700
  msgstr ""
701
 
702
- # 'show' => 1,
703
- # 'text' => __('Looks like you are upgrading from a previous version of WooCommerce Multilingual. Would you like to automatically create translated variations and images?', 'wcml').
704
- # '<br /><strong>' .
705
 
706
- msgid "Looks like you are upgrading from a previous version of WooCommerce Multilingual. Would you like to automatically create translated variations and images?"
707
  msgstr ""
708
 
709
- # '<br /><strong>' .
710
- # ' <a href="' . admin_url('admin.php?page=wpml-wcml&tab=troubleshooting') . '">' . __('Yes, go to the troubleshooting page', 'wcml') . '</a> |' .
711
- # ' <a href="#" onclick="jQuery.ajax({type:\'POST\',url: ajaxurl,data:\'action=wcml_hide_notice&notice='.$n.'\',success:function(){jQuery(\'#' . $n . '\').fadeOut()}});return false;">' . __('No - dismiss', 'wcml') . '</a>' .
712
 
713
- msgid "Yes, go to the troubleshooting page"
714
  msgstr ""
715
 
716
- # ' <a href="' . admin_url('admin.php?page=wpml-wcml&tab=troubleshooting') . '">' . __('Yes, go to the troubleshooting page', 'wcml') . '</a> |' .
717
- # ' <a href="#" onclick="jQuery.ajax({type:\'POST\',url: ajaxurl,data:\'action=wcml_hide_notice&notice='.$n.'\',success:function(){jQuery(\'#' . $n . '\').fadeOut()}});return false;">' . __('No - dismiss', 'wcml') . '</a>' .
718
- # '</strong>'
719
 
720
- msgid "No - dismiss"
721
  msgstr ""
722
 
723
- # jQuery('#dropdown_shop_order_language').on('change', function(){
724
- # if(confirm('" . esc_js(__("All the products will be removed from the current order in order to change the language", 'woocommerce-multilingual')). "')){
725
- # var lang = jQuery(this).val();
726
 
727
- msgid "All the products will be removed from the current order in order to change the language"
728
  msgstr ""
729
 
730
- # if(!$nonce || !wp_verify_nonce($nonce, 'set_dashboard_order_language')){
731
- # echo json_encode(array('error' => __('Invalid nonce', 'woocommerce-multilingual')));
732
- # die();
733
 
734
- msgid "Invalid nonce"
735
  msgstr ""
736
 
737
- # <li class="wide">
738
- # <label><?php _e('Order language:'); ?></label>
739
- # <select id="dropdown_shop_order_language" name="wcml_shop_order_language">
740
 
741
- msgid "Order language:"
742
  msgstr ""
743
 
744
- # }elseif( isset( $product_translations[ $language[ 'code' ] ] ) && $product_translations[ $language[ 'code' ] ]->original ) { ?>
745
- # <span title="<?php echo $language['english_name'] . ': ' . __('Original language', 'woocommerce-multilingual'); ?>">
746
- # <i class="otgs-ico-original"></i>
747
 
748
- msgid "Original language"
749
  msgstr ""
750
 
751
- # ?>
752
- # <a href="<?php echo $edit_url ?>" title="<?php echo $language[ 'english_name' ] . ': ' . __( 'Take this and edit', 'woocommerce-multilingual' ); ?>">
753
- # <i class="otgs-ico-add"></i>
754
 
755
- msgid "Take this and edit"
756
  msgstr ""
757
 
758
- # if (!$tr_status ) { ?>
759
- # title="<?php echo $language[ 'english_name' ] . ': ' . __( 'Add translation', 'woocommerce-multilingual' ); ?>">
760
- # <i class="otgs-ico-add"></i>
761
 
762
- msgid "Add translation"
763
  msgstr ""
764
 
765
- # <?php }elseif( $tr_status->needs_update ){ ?>
766
- # title="<?php echo $language[ 'english_name' ] . ': ' . __( 'Update translation', 'woocommerce-multilingual' ); ?>">
767
- # <i class="otgs-ico-refresh"></i>
768
 
769
- msgid "Update translation"
770
  msgstr ""
771
 
772
- # <?php }elseif( $tr_status->status != ICL_TM_COMPLETE && $tr_status->status != ICL_TM_DUPLICATE ){ ?>
773
- # title="<?php echo $language[ 'english_name' ] . ': ' . __( 'Finish translating', 'woocommerce-multilingual' ); ?>">
774
- # <i class="otgs-ico-refresh"></i>
775
 
776
- msgid "Finish translating"
777
  msgstr ""
778
 
779
- # <?php }elseif( $tr_status->status == ICL_TM_COMPLETE ){ ?>
780
- # title="<?php echo $language[ 'english_name' ] . ': ' . __( 'Edit translation', 'woocommerce-multilingual' ); ?>">
781
- # <i class="otgs-ico-edit"></i>
782
 
783
- msgid "Edit translation"
784
  msgstr ""
785
 
786
- # $new_actions[ 'quick_hide' ] = '<a href="#TB_inline?width=200&height=150&inlineId=quick_edit_notice" class="thickbox" title="' .
787
- # __('Edit this item inline', 'woocommerce-multilingual') . '">' .
788
- # __('Quick Edit', 'woocommerce-multilingual') . '</a>';
789
 
790
- msgid "Edit this item inline"
791
  msgstr ""
792
 
793
- # __('Edit this item inline', 'woocommerce-multilingual') . '">' .
794
- # __('Quick Edit', 'woocommerce-multilingual') . '</a>';
795
- # } else {
796
 
797
- msgid "Quick Edit"
798
  msgstr ""
799
 
800
- # if( $tr_status->status == ICL_TM_IN_PROGRESS ) { ?>
801
- # <a title="<?php _e( 'Translation in progress', 'woocommerce-multilingual' ); ?>"><i
802
- # class="otgs-ico-in-progress"></i></a>
803
 
804
- msgid "Translation in progress"
805
  msgstr ""
806
 
807
- # 'id' => 'wcml-settings-saved',
808
- # 'text' => __('Settings saved!', 'woocommerce-multilingual' ),
809
- # 'group' => 'wcml-multi-currency',
810
 
811
- msgid "Settings saved!"
812
  msgstr ""
813
 
814
- #
815
- # $args['title'] = empty($_POST['currency']) ? __('Add new currency', 'woocommerce-multilingual') : __('Update currency', 'woocommerce-multilingual');
816
  #
817
 
818
- msgid "Add new currency"
819
  msgstr ""
820
 
821
  #
822
- # $args['title'] = empty($_POST['currency']) ? __('Add new currency', 'woocommerce-multilingual') : __('Update currency', 'woocommerce-multilingual');
823
  #
824
 
825
- msgid "Update currency"
826
  msgstr ""
827
 
828
  #
829
- # $args['title'] = sprintf( __( 'Update settings for %s', 'woocommerce-multilingual' ),
830
- # '<strong>' . $args['currency_name'] . ' (' . $args['currency_symbol'] . ')</strong>' );
831
 
832
- msgid "Update settings for %s"
833
  msgstr ""
834
 
835
- # 'id' => $message_id,
836
- # 'text' => sprintf(__('The default currency was changed. In order to show accurate prices in all currencies, you need to update the exchange rates under the %sMulti-currency%s configuration.',
837
- # 'woocommerce-multilingual'), '<a href="' . admin_url('admin.php?page=wpml-wcml&tab=multi-currency') . '">', '</a>'),
838
 
839
- msgid "The default currency was changed. In order to show accurate prices in all currencies, you need to update the exchange rates under the %sMulti-currency%s configuration."
 
 
 
 
 
 
 
840
  msgstr ""
841
 
842
  #
843
- # if(confirm('" . esc_js(__("All the products will be removed from the current order in order to change the currency", 'woocommerce-multilingual')). "')){
844
- # jQuery.ajax({
845
 
846
- msgid "All the products will be removed from the current order in order to change the currency"
847
  msgstr ""
848
 
849
- # <select id="dropdown_shop_order_currency" name="_order_currency">
850
- # <option value=""><?php _e( 'Show all currencies', 'woocommerce-multilingual' ) ?></option>
851
- # <?php foreach($order_currencies as $currency => $count): ?>
852
 
853
- msgid "Show all currencies"
854
  msgstr ""
855
 
856
- # <li class="wide">
857
- # <label><?php _e('Order currency:', 'woocommerce-multilingual'); ?></label>
858
- # <select id="dropdown_shop_order_currency" name="wcml_shop_order_currency">
859
 
860
- msgid "Order currency:"
861
  msgstr ""
862
 
863
- # $woocommerce_wpml->update_settings();
864
- # echo json_encode( array('message' => __( 'Currencies order updated', 'woocommerce-multilingual' )) );
865
- # die;
866
 
867
- msgid "Currencies order updated"
868
  msgstr ""
869
 
870
  #
871
- # $preview = '<i>' . __("You haven't added any secondary currencies.", 'woocommerce-multilingual') . '</i>';
872
  #
873
 
874
- msgid "You haven't added any secondary currencies."
875
  msgstr ""
876
 
877
- #
878
- # parent::__construct( 'currency_sel_widget', __('Currency switcher', 'woocommerce-multilingual'), __('Currency switcher', 'woocommerce-multilingual'));
879
- # }
880
 
881
- msgid "Currency switcher"
882
  msgstr ""
883
 
884
- #
885
- # printf('<p><a href="%s">%s</a></p>',admin_url('admin.php?page=wpml-wcml&tab=multi-currency#currency-switcher'),__('Configure options', 'woocommerce-multilingual'));
886
- # return;
887
 
888
- msgid "Configure options"
889
  msgstr ""
890
 
891
- # <?php if(empty($orders_currencies)): ?>
892
- # <option value=""><?php _e('Currency - no orders found', 'woocommerce-multilingual') ?></option>
893
- # <?php else: ?>
894
 
895
- msgid "Currency - no orders found"
896
  msgstr ""
897
 
898
- # $job_details[ 'job_id' ],
899
- # 'wc_product', __( 'Product', 'woocommerce-multilingual' ),
900
- # $this->product->post->post_title,
901
 
902
- msgid "Product"
903
  msgstr ""
904
 
905
- #
906
- # $this->add_field( new WPML_Editor_UI_Single_Line_Field( 'title', __( 'Title', 'woocommerce-multilingual' ), $this->data, true ) );
907
- # $this->add_field( new WPML_Editor_UI_Single_Line_Field( 'slug', __( 'Slug', 'woocommerce-multilingual' ), $this->data, true ) );
908
 
909
- msgid "Title"
910
  msgstr ""
911
 
912
- # $this->add_field( new WPML_Editor_UI_Single_Line_Field( 'title', __( 'Title', 'woocommerce-multilingual' ), $this->data, true ) );
913
- # $this->add_field( new WPML_Editor_UI_Single_Line_Field( 'slug', __( 'Slug', 'woocommerce-multilingual' ), $this->data, true ) );
914
- # $this->add_field( new WPML_Editor_UI_WYSIWYG_Field( 'product_content', __( 'Content / Description', 'woocommerce-multilingual' ), $this->data, true ) );
915
 
916
- msgid "Slug"
917
  msgstr ""
918
 
919
- # $this->add_field( new WPML_Editor_UI_Single_Line_Field( 'slug', __( 'Slug', 'woocommerce-multilingual' ), $this->data, true ) );
920
- # $this->add_field( new WPML_Editor_UI_WYSIWYG_Field( 'product_content', __( 'Content / Description', 'woocommerce-multilingual' ), $this->data, true ) );
921
- #
922
 
923
- msgid "Content / Description"
924
  msgstr ""
925
 
926
- #
927
- # $excerpt_section = new WPML_Editor_UI_Field_Section( __( 'Excerpt', 'woocommerce-multilingual' ) );
928
- # $excerpt_section->add_field( new WPML_Editor_UI_WYSIWYG_Field( 'product_excerpt', null, $this->data, true ) );
929
 
930
- msgid "Excerpt"
931
  msgstr ""
932
 
 
 
933
  #
934
- # $purchase_note_section = new WPML_Editor_UI_Field_Section( __( 'Purchase note', 'woocommerce-multilingual' ) );
935
- # $purchase_note_section->add_field( new WPML_Editor_UI_TextArea_Field( '_purchase_note', null, $this->data, true ) );
936
 
937
- msgid "Purchase note"
938
  msgstr ""
939
 
940
- #
941
- # $images_section = new WPML_Editor_UI_Field_Section( __( 'Images', 'woocommerce-multilingual' ) );
942
- # foreach( $product_images as $image_id ) {
943
 
944
- msgid "Images"
945
  msgstr ""
946
 
947
- # if ( $attributes ){
948
- # $attributes_section = new WPML_Editor_UI_Field_Section( __( 'Custom Product attributes', 'woocommerce-multilingual' ) );
949
- # foreach( $attributes as $attr_key => $attribute ) {
950
 
951
- msgid "Custom Product attributes"
952
  msgstr ""
953
 
954
- # $group = new WPML_Editor_UI_Field_Group( '', true );
955
- # $attribute_field = new WPML_Editor_UI_Single_Line_Field( $attr_key . '_name', __( 'Name', 'woocommerce-multilingual' ), $this->data, false );
956
- # $group->add_field( $attribute_field );
957
 
958
- msgid "Name"
959
  msgstr ""
960
 
961
- # $group->add_field( $attribute_field );
962
- # $attribute_field = new WPML_Editor_UI_Single_Line_Field( $attr_key , __( 'Value(s)', 'woocommerce-multilingual' ), $this->data, false );
963
- # $group->add_field( $attribute_field );
964
 
965
- msgid "Value(s)"
966
  msgstr ""
967
 
968
- # if( $custom_fields ) {
969
- # $custom_fields_section = new WPML_Editor_UI_Field_Section( __( 'Custom Fields', 'woocommerce-multilingual' ) );
970
  #
 
 
971
 
972
- msgid "Custom Fields"
973
  msgstr ""
974
 
975
- # if( !empty( $variations ) ){
976
- # $variations_data_section = new WPML_Editor_UI_Field_Section( __( 'Variations data', 'woocommerce-multilingual' ) );
977
- # foreach( $variations as $variation ){
978
 
979
- msgid "Variations data"
980
  msgstr ""
981
 
982
- # if( $is_variable ){
983
- # $files_section = new WPML_Editor_UI_Field_Section( sprintf( __( 'Download Files for Variation #%s', 'woocommerce-multilingual' ), $post_id ) );
984
- # }else{
985
 
986
- msgid "Download Files for Variation #%s"
987
  msgstr ""
988
 
989
- # }else{
990
- # $files_section = new WPML_Editor_UI_Field_Section( __( 'Download Files', 'woocommerce-multilingual' ) );
991
- # }
992
 
993
- msgid "Download Files"
994
  msgstr ""
995
 
996
- # $sub_group->add_field( $field_input );
997
- # $field_input = new WPML_Editor_UI_Single_Line_Field( 'file-url'.$key.$post_id, __( 'File URL', 'woocommerce-multilingual' ), $this->data, false );
998
- # $sub_group->add_field( $field_input );
999
 
1000
- msgid "File URL"
1001
  msgstr ""
1002
 
1003
- # if( $this->product->product_type === 'external' ){
1004
- # $external_product_section = new WPML_Editor_UI_Field_Section( __( 'External Product', 'woocommerce-multilingual' ) );
1005
- # $external_product_section->add_field( new WPML_Editor_UI_Single_Line_Field( '_product_url', __( 'Product url', 'woocommerce-multilingual' ), $this->data, true ) );
1006
 
1007
- msgid "External Product"
1008
  msgstr ""
1009
 
1010
- # $external_product_section = new WPML_Editor_UI_Field_Section( __( 'External Product', 'woocommerce-multilingual' ) );
1011
- # $external_product_section->add_field( new WPML_Editor_UI_Single_Line_Field( '_product_url', __( 'Product url', 'woocommerce-multilingual' ), $this->data, true ) );
1012
- # $external_product_section->add_field( new WPML_Editor_UI_Single_Line_Field( '_button_text', __( 'Button text', 'woocommerce-multilingual' ), $this->data, true ) );
1013
 
1014
- msgid "Product url"
1015
  msgstr ""
1016
 
1017
- # $external_product_section->add_field( new WPML_Editor_UI_Single_Line_Field( '_product_url', __( 'Product url', 'woocommerce-multilingual' ), $this->data, true ) );
1018
- # $external_product_section->add_field( new WPML_Editor_UI_Single_Line_Field( '_button_text', __( 'Button text', 'woocommerce-multilingual' ), $this->data, true ) );
1019
- # $this->add_field( $external_product_section );
1020
 
1021
- msgid "Button text"
1022
  msgstr ""
1023
 
1024
- # if ( !$args[ 'post_title' ] && !$args[ 'post_content' ] && !$args[ 'post_excerpt' ] ){
1025
- # return new WP_Error( 'empty_content', __( 'Content, title, and excerpt are empty.' ) );
1026
  # }
1027
 
1028
- msgid "Content, title, and excerpt are empty."
1029
  msgstr ""
1030
 
1031
- # <p class="icl-admin-message" style="margin-top: 0">
1032
- # <?php printf( __('To configure how the %sWooCommerce products%s are translated, visit the WooCommerce Multiligual %ssettings%s page.',
1033
- # 'woocommerce-multilingual'), '<strong>', '</strong>', '<a href="' . admin_url('admin.php?page=wpml-wcml&tab=settings') . '">', '</a>' ); ?>
1034
 
1035
- msgid "To configure how the %sWooCommerce products%s are translated, visit the WooCommerce Multiligual %ssettings%s page."
1036
  msgstr ""
1037
 
1038
- # ?>
1039
- # <div class="message error"><p><?php printf(__('WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href="%s">WPML</a> versions prior %s.',
1040
- # 'woocommerce-multilingual'), WCML_Links::generate_tracking_link('https://wpml.org/'), '3.4'); ?></p></div>
1041
 
1042
- msgid "WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href=\"%s\">WPML</a> versions prior %s."
1043
  msgstr ""
1044
 
1045
- # ?>
1046
- # <div class="message error"><p><?php printf(__('WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href="%s">Woocommerce</a> versions prior %s.',
1047
- # 'woocommerce-multilingual'), 'http://www.woothemes.com/woocommerce/', '2.1' ); ?></p></div>
1048
 
1049
- msgid "WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href=\"%s\">Woocommerce</a> versions prior %s."
1050
  msgstr ""
1051
 
1052
- # ?>
1053
- # <div class="message error"><p><?php printf(__('WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href="%s">WPML Translation Management</a> versions prior %s.',
1054
- # 'woocommerce-multilingual'), WCML_Links::generate_tracking_link('https://wpml.org/'), '1.9'); ?></p></div>
1055
 
1056
- msgid "WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href=\"%s\">WPML Translation Management</a> versions prior %s."
1057
  msgstr ""
1058
 
1059
- # ?>
1060
- # <div class="message error"><p><?php printf(__('WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href="%s">WPML String Translation</a> versions prior %s.',
1061
- # 'woocommerce-multilingual'), WCML_Links::generate_tracking_link('https://wpml.org/'), '2.0'); ?></p></div>
1062
 
1063
- msgid "WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href=\"%s\">WPML String Translation</a> versions prior %s."
1064
  msgstr ""
1065
 
1066
- # ?>
1067
- # <div class="message error"><p><?php printf(__('WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href="%s">WPML Media</a> versions prior %s.',
1068
- # 'woocommerce-multilingual'), WCML_Links::generate_tracking_link('https://wpml.org/'), '2.1'); ?></p></div>
1069
 
1070
- msgid "WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href=\"%s\">WPML Media</a> versions prior %s."
1071
  msgstr ""
1072
 
1073
- # } elseif ($counter == sizeof($this->missing) - 1) {
1074
- # $sep = ' ' . __('and', 'woocommerce-multilingual') . ' ';
1075
- # } else {
1076
-
1077
- msgid "and"
1078
  msgstr ""
1079
 
1080
  #
1081
- # <div class="message error"><p><?php printf(__('WooCommerce Multilingual is enabled but not effective. It requires %s in order to work.', 'woocommerce-multilingual'), $missing); ?></p></div>
1082
- # <?php
1083
 
1084
- msgid "WooCommerce Multilingual is enabled but not effective. It requires %s in order to work."
1085
  msgstr ""
1086
 
1087
- # $message .= '<br /><br />';
1088
- # $message .= '<a href="' . admin_url('options-permalink.php') . '">' . __('Permalink settings', 'woocommerce-multilingual') . '</a>';
1089
- # $message .= ' | ';
1090
 
1091
- msgid "Permalink settings"
1092
  msgstr ""
1093
 
1094
- # $message .= ' | ';
1095
- # $message .= '<a href="' . admin_url('admin.php?page=' . WPML_TM_FOLDER . '/menu/main.php&sm=mcsetup#icl_custom_posts_sync_options') . '">' . __('Configure products slug translation', 'woocommerce-multilingual') . '</a>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1096
  #
1097
 
1098
- msgid "Configure products slug translation"
1099
  msgstr ""
1100
 
1101
- # if (!$allsame) {
1102
- # $this->err_message = '<div class="message error"><p>'.printf(__('If you want different slugs for shop pages (%s/%s), you need to disable the shop prefix for products in <a href="%s">WooCommerce Settings</a>', 'woocommerce-multilingual'),
1103
- # $slug, $translated_slug, admin_url("admin.php?page=woocommerce_settings&tab=pages")).'</p></div>';
1104
 
1105
- msgid "If you want different slugs for shop pages (%s/%s), you need to disable the shop prefix for products in <a href=\"%s\">WooCommerce Settings</a>"
1106
  msgstr ""
1107
 
1108
  #
1109
- # $ret['success_1'] = '&nbsp;' . sprintf(__('Finished! You can visit the %sstrings translation%s screen to translate the strings now.', 'woocommerce-multilingual'), '<a href="' . admin_url('admin.php?page=' . WPML_ST_FOLDER . '/menu/string-translation.php') . '">', '</a>');
 
 
 
 
 
1110
  #
 
 
1111
 
1112
- msgid "Finished! You can visit the %sstrings translation%s screen to translate the strings now."
1113
  msgstr ""
1114
 
1115
- # if(!file_exists($file)){
1116
- # $this->xml_config_errors[] = __('wpml-config.xml file missing from WooCommerce Multilingual folder.', 'woocommerce-multilingual');
1117
- # }else{
1118
 
1119
- msgid "wpml-config.xml file missing from WooCommerce Multilingual folder."
1120
  msgstr ""
1121
 
1122
- # if($effective_config_value != $correct_config_value){
1123
- # $this->xml_config_errors[] = sprintf(__('Custom field %s configuration from wpml-config.xml file was altered!', 'woocommerce-multilingual'), '<i>' . $cf['value'] . '</i>');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1124
  # }
1125
 
1126
- msgid "Custom field %s configuration from wpml-config.xml file was altered!"
1127
  msgstr ""
1128
 
1129
- # if($effective_config_value != $correct_config_value){
1130
- # $this->xml_config_errors[] = sprintf(__('Custom type %s configuration from wpml-config.xml file was altered!', 'woocommerce-multilingual'), '<i>' . $ct['value'] . '</i>');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1131
  # }
1132
 
1133
- msgid "Custom type %s configuration from wpml-config.xml file was altered!"
1134
  msgstr ""
1135
 
1136
- # if($effective_config_value != $correct_config_value){
1137
- # $this->xml_config_errors[] = sprintf(__('Custom taxonomy %s configuration from wpml-config.xml file was altered!', 'woocommerce-multilingual'), '<i>' . $tx['value'] . '</i>');
1138
  # }
1139
 
1140
- msgid "Custom taxonomy %s configuration from wpml-config.xml file was altered!"
1141
  msgstr ""
1142
 
1143
  # input.parent().append('<div class="translation_controls"></div>');
@@ -1231,1685 +1385,1617 @@ msgstr ""
1231
  msgid "To quickly translate this and other WooCommerce store pages, please run the %ssetup wizard%s."
1232
  msgstr ""
1233
 
1234
- #
1235
- # printf( '<p>'.__('In order to edit custom attributes you need to use the <a href="%s">custom product translation editor</a>', 'woocommerce-multilingual').'</p>', admin_url('admin.php?page=wpml-wcml&tab=products&prid='.$original_product_id ) );
1236
- # }
1237
 
1238
- msgid "In order to edit custom attributes you need to use the <a href=\"%s\">custom product translation editor</a>"
1239
  msgstr ""
1240
 
1241
- # jQuery('input[name="woocommerce_product_category_slug"]').parent().append('<br><i class="icon-warning-sign"><?php
1242
- # _e('You are using the same value as for the regular category base. This is known to create conflicts resulting in urls not working properly.', 'woocommerce-multilingual') ?></i>');
1243
- # }
1244
 
1245
- msgid "You are using the same value as for the regular category base. This is known to create conflicts resulting in urls not working properly."
1246
  msgstr ""
1247
 
1248
- # if( empty( $permalink_options['product_base'] ) ){
1249
- # $value = _x( 'product', 'default-slug', 'woocommerce' );
1250
- # }else{
1251
 
1252
- msgctxt "default-slug"
1253
- msgid "product"
1254
  msgstr ""
1255
 
1256
- # 'strings' => array(
1257
- # 'choose' => __( 'Choose a file', 'woocommerce_multilingual' ),
1258
- # 'save_tooltip' => __( 'At least one of these fields is required: title, content or excerpt', 'woocommerce_multilingual' ),
1259
 
1260
- msgid "Choose a file"
1261
  msgstr ""
1262
 
1263
- # 'choose' => __( 'Choose a file', 'woocommerce_multilingual' ),
1264
- # 'save_tooltip' => __( 'At least one of these fields is required: title, content or excerpt', 'woocommerce_multilingual' ),
1265
- # 'resign_tooltip'=> __( 'This translation job will no longer be assigned to you. Other translators will be able take it and continue the translation.', 'woocommerce-multilingual')
1266
 
1267
- msgid "At least one of these fields is required: title, content or excerpt"
1268
  msgstr ""
1269
 
1270
- # 'save_tooltip' => __( 'At least one of these fields is required: title, content or excerpt', 'woocommerce_multilingual' ),
1271
- # 'resign_tooltip'=> __( 'This translation job will no longer be assigned to you. Other translators will be able take it and continue the translation.', 'woocommerce-multilingual')
1272
- # ),
1273
 
1274
- msgid "This translation job will no longer be assigned to you. Other translators will be able take it and continue the translation."
1275
  msgstr ""
1276
 
1277
- # echo '<img src="' . WCML_PLUGIN_URL . '/res/images/locked.png" class="wcml_lock_img wcml_lock_icon" alt="' .
1278
- # __( 'This field is locked for editing because WPML will copy its value from the original language.', 'woocommerce-multilingual' ) .
1279
- # '" title="' . __( 'This field is locked for editing because WPML will copy its value from the original language.', 'woocommerce-multilingual' ) .
1280
 
1281
- msgid "This field is locked for editing because WPML will copy its value from the original language."
1282
  msgstr ""
1283
 
1284
- # echo '<h3 class="wcml_prod_hidden_notice">' .
1285
- # sprintf( __( "This is a translation of %s. Some of the fields are not editable. It's recommended to use the %s for translating products.",
1286
- # 'woocommerce-multilingual' ),
1287
 
1288
- msgid "This is a translation of %s. Some of the fields are not editable. It's recommended to use the %s for translating products."
1289
  msgstr ""
1290
 
1291
- # '<a data-action="product-translation-dialog" class="js-wcml-dialog-trigger" data-id="' . $original_id . '" data-job_id="" data-language="' . $language . '">' .
1292
- # __( 'WooCommerce Multilingual products translator', 'woocommerce-multilingual' ) . '</a>' ) . '</h3>';
1293
- # }
1294
 
1295
- msgid "WooCommerce Multilingual products translator"
1296
  msgstr ""
1297
 
1298
- # array(
1299
- # 'warn' => __( "Downloading translations... Please don't close this page.", 'woocommerce-multilingual' )
1300
- # )
1301
 
1302
- msgid "Downloading translations... Please don't close this page."
1303
  msgstr ""
1304
 
1305
- # 'woocommerce',
1306
- # __( 'WooCommerce Multilingual', 'woocommerce-multilingual' ),
1307
- # __( 'WooCommerce Multilingual', 'woocommerce-multilingual' ),
1308
 
1309
- msgid "WooCommerce Multilingual"
1310
  msgstr ""
1311
 
1312
- # $wp_api->add_submenu_page(null,
1313
- # __('Translations', 'wpml-translation-management'), __('Translations', 'wpml-translation-management'),
1314
- # 'wpml_operate_woocommerce_multilingual', WPML_TM_FOLDER . '/menu/translations-queue.php', array($WPML_Translation_Management, 'translation_queue_page'));
1315
 
1316
- msgid "Translations"
1317
  msgstr ""
1318
 
1319
- # $quick_edit_notice = '<div id="quick_edit_notice" style="display:none;"><p>' .
1320
- # sprintf( __( "Quick edit is disabled for product translations. It\'s recommended to use the %s for editing products translations. %s",
1321
- # 'woocommerce-multilingual' ), '<a href="' . admin_url( 'admin.php?page=wpml-wcml&tab=products' ) . '" >' .
1322
 
1323
- msgid "Quick edit is disabled for product translations. It's recommended to use the %s for editing products translations. %s"
1324
  msgstr ""
1325
 
1326
- # 'woocommerce-multilingual' ), '<a href="' . admin_url( 'admin.php?page=wpml-wcml&tab=products' ) . '" >' .
1327
- # __( 'WooCommerce Multilingual products editor', 'woocommerce-multilingual' ) . '</a>',
1328
- # '<a href="" class="quick_product_trnsl_link" >' . __( 'Edit this product translation', 'woocommerce-multilingual' ) . '</a>'
1329
 
1330
- msgid "WooCommerce Multilingual products editor"
1331
  msgstr ""
1332
 
1333
- # __( 'WooCommerce Multilingual products editor', 'woocommerce-multilingual' ) . '</a>',
1334
- # '<a href="" class="quick_product_trnsl_link" >' . __( 'Edit this product translation', 'woocommerce-multilingual' ) . '</a>'
1335
- # ) . '</p></div>';
1336
 
1337
- msgid "Edit this product translation"
1338
  msgstr ""
1339
 
1340
- # $prot_link = '<span class="button" style="padding:4px;margin-top:0px; float: left;"><img align="baseline" src="' . ICL_PLUGIN_URL . '/res/img/icon16.png" width="16" height="16" style="margin-bottom:-4px" /> <a href="' . WCML_Links::generate_tracking_link( 'https://wpml.org/documentation/related-projects/woocommerce-multilingual/', 'woocommerce-multilingual', 'documentation', '#3' ) . '" target="_blank" style="text-decoration: none;">' .
1341
- # __( 'How to translate attributes', 'sitepress' ) . '<\/a>' . '<\/span><br \/><br \/>';
1342
- # ?>
1343
 
1344
- msgid "How to translate attributes"
1345
  msgstr ""
1346
 
1347
- # $prot_link = '<span class="button" style="padding:4px;margin-top:0px; float: left;"><img align="baseline" src="' . ICL_PLUGIN_URL . '/res/img/icon16.png" width="16" height="16" style="margin-bottom:-4px" /> <a href="' . WCML_Links::generate_tracking_link( 'https://wpml.org/documentation/related-projects/woocommerce-multilingual/', 'woocommerce-multilingual', 'documentation', '#3' ) . '" target="_blank" style="text-decoration: none;">' .
1348
- # __( 'How to translate product categories', 'sitepress' ) . '<\/a>' . '<\/span><br \/><br \/>';
1349
- # ?>
1350
 
1351
- msgid "How to translate product categories"
1352
  msgstr ""
1353
 
1354
- # $message .= sprintf(
1355
- # __('The recommended way to translate WooCommerce products is using the
1356
- # %sWooCommerce Multilingual products translation%s page.
1357
 
1358
- msgid "The recommended way to translate WooCommerce products is using the\n %sWooCommerce Multilingual products translation%s page.\n Please use this page only for translating elements that are not available in the WooCommerce Multilingual products translation table."
1359
  msgstr ""
1360
 
1361
- # '<strong><a href="' . admin_url('admin.php?page=wpml-wcml&tab=products') . '">', '</a></strong>');
1362
- # $message .= '</p><a class="notice-dismiss" href="' . $url . '&wcml_action=dismiss_tm_warning"><span class="screen-reader-text">' . __('Dismiss', 'woocommerce-multilingual') . '</a>';
1363
- # $message .= '</div>';
1364
 
1365
- msgid "Dismiss"
1366
  msgstr ""
1367
 
1368
- # foreach( $menu as $key => $menu_item ) {
1369
- # if ( $menu_item[ 0 ] == __( 'WooCommerce', 'woocommerce' ) ) {
1370
- # $menu[ $key ][ 0 ] .= '<span class="wcml-menu-warn"><i class="otgs-ico-warning"></i></span>';
1371
 
1372
- msgid "WooCommerce"
1373
  msgstr ""
1374
 
1375
- # 'introduction' => array(
1376
- # 'name' => __( 'Introduction', 'woocommerce-multilingual' ),
1377
- # 'view' => array( $this, 'setup_introduction' ),
1378
 
1379
- msgid "Introduction"
1380
  msgstr ""
1381
 
1382
- # 'store-pages' => array(
1383
- # 'name' => __( 'Store Pages', 'woocommerce-multilingual' ),
1384
- # 'view' => array( $this, 'setup_store_pages' ),
1385
 
1386
- msgid "Store Pages"
1387
  msgstr ""
1388
 
1389
- # 'attributes' => array(
1390
- # 'name' => __( 'Global Attributes', 'woocommerce-multilingual' ),
1391
- # 'view' => array( $this, 'setup_attributes' ),
1392
 
1393
- msgid "Global Attributes"
1394
  msgstr ""
1395
 
1396
- # 'multi-currency' => array(
1397
- # 'name' => __( 'Multiple Currencies', 'woocommerce-multilingual' ),
1398
- # 'view' => array( $this, 'setup_multi_currency' ),
1399
 
1400
- msgid "Multiple Currencies"
1401
  msgstr ""
1402
 
1403
- # 'ready' => array(
1404
- # 'name' => __( 'Ready!', 'woocommerce-multilingual' ),
1405
- # 'view' => array( $this, 'setup_ready' ),
1406
 
1407
- msgid "Ready!"
1408
  msgstr ""
1409
 
1410
- # if ( ! wp_verify_nonce( $_GET['_wcml_setup_nonce'], 'wcml_setup_skip_nonce' ) ) {
1411
- # wp_die( __( 'Action failed. Please refresh the page and retry.', 'woocommerce-multilingual' ) );
1412
- # }
1413
 
1414
- msgid "Action failed. Please refresh the page and retry."
1415
  msgstr ""
1416
 
1417
- # if ( ! current_user_can( 'manage_options' ) ) {
1418
- # wp_die( __( 'Cheatin&#8217; huh?', 'woocommerce' ) );
1419
- # }
1420
 
1421
- msgid "Cheatin&#8217; huh?"
1422
  msgstr ""
1423
 
1424
- # <p>
1425
- # <strong><?php _e('Prepare your WooCommerce store to run multilingual!', 'woocommerce-multilingual'); ?></strong><br />
1426
- # <?php _e('We need to help you with a few steps to turn your WooCommerce store multilingual. These steps include:', 'woocommerce-multilingual'); ?>
1427
 
1428
- msgid "Prepare your WooCommerce store to run multilingual!"
1429
  msgstr ""
1430
 
1431
- # <strong><?php _e('Prepare your WooCommerce store to run multilingual!', 'woocommerce-multilingual'); ?></strong><br />
1432
- # <?php _e('We need to help you with a few steps to turn your WooCommerce store multilingual. These steps include:', 'woocommerce-multilingual'); ?>
1433
- # <ul class="wcml-notice-list">
1434
 
1435
- msgid "We need to help you with a few steps to turn your WooCommerce store multilingual. These steps include:"
1436
  msgstr ""
1437
 
1438
- # <ul class="wcml-notice-list">
1439
- # <li><?php _e("Translating the 'store' pages", 'woocommerce-multilingual'); ?></li>
1440
- # <li><?php _e("Choosing which attributes to make translatable", 'woocommerce-multilingual'); ?></li>
1441
 
1442
- msgid "Translating the 'store' pages"
1443
  msgstr ""
1444
 
1445
- # <li><?php _e("Translating the 'store' pages", 'woocommerce-multilingual'); ?></li>
1446
- # <li><?php _e("Choosing which attributes to make translatable", 'woocommerce-multilingual'); ?></li>
1447
- # <li><?php _e("Choosing if you need multiple currencies", 'woocommerce-multilingual'); ?></li>
1448
 
1449
- msgid "Choosing which attributes to make translatable"
1450
  msgstr ""
1451
 
1452
- # <li><?php _e("Choosing which attributes to make translatable", 'woocommerce-multilingual'); ?></li>
1453
- # <li><?php _e("Choosing if you need multiple currencies", 'woocommerce-multilingual'); ?></li>
1454
- # </ul>
1455
 
1456
- msgid "Choosing if you need multiple currencies"
1457
  msgstr ""
1458
 
1459
- # <p class="submit">
1460
- # <a href="<?php echo esc_url( admin_url('admin.php?page=wcml-setup') ); ?>" class="button-primary"><?php _e('Start the Setup Wizard', 'woocommerce-multilingual') ?></a>
1461
- # <a href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wcml-setup-skip', 1 ), 'wcml_setup_skip_nonce', '_wcml_setup_nonce' ) ); ?>" class="button-secondary skip"><?php _e('Skip', 'woocommerce-multilingual') ?></a>
1462
 
1463
- msgid "Start the Setup Wizard"
1464
  msgstr ""
1465
 
1466
- # <a href="<?php echo esc_url( admin_url('admin.php?page=wcml-setup') ); ?>" class="button-primary"><?php _e('Start the Setup Wizard', 'woocommerce-multilingual') ?></a>
1467
- # <a href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wcml-setup-skip', 1 ), 'wcml_setup_skip_nonce', '_wcml_setup_nonce' ) ); ?>" class="button-secondary skip"><?php _e('Skip', 'woocommerce-multilingual') ?></a>
1468
- # </p>
1469
 
1470
- msgid "Skip"
1471
  msgstr ""
1472
 
1473
- # <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
1474
- # <title><?php _e( 'WooCommerce Multilingual &rsaquo; Setup Wizard', 'woocommerce-multilingual' ); ?></title>
1475
- # <?php wp_print_scripts( 'wcml-setup' ); ?>
1476
 
1477
- msgid "WooCommerce Multilingual &rsaquo; Setup Wizard"
1478
  msgstr ""
1479
 
1480
- # $link = admin_url('admin.php?page=wpml-wcml');
1481
- # $name = __('Translate WooCommerce products', 'woocommerce-multilingual');
1482
- # wp_enqueue_style( 'wcml-pointers');
1483
 
1484
- msgid "Translate WooCommerce products"
1485
  msgstr ""
1486
 
1487
- # $link = admin_url('admin.php?page=wpml-wcml&tab=product_shipping_class');
1488
- # $name = __('Translate shipping classes', 'woocommerce-multilingual');
1489
- # wp_enqueue_style( 'wcml-pointers');
1490
 
1491
- msgid "Translate shipping classes"
 
1492
  msgstr ""
1493
 
1494
- # $link = admin_url('admin.php?page=wpml-wcml&tab=multi-currency');
1495
- # $name = __('Configure multi-currency for multilingual sites', 'woocommerce-multilingual');
1496
- # wp_enqueue_style( 'wcml-pointers');
1497
 
1498
- msgid "Configure multi-currency for multilingual sites"
 
1499
  msgstr ""
1500
 
1501
- # $link = admin_url('admin.php?page=wpml-wcml&tab=slugs');
1502
- # $name = __('Translate endpoints', 'woocommerce-multilingual');
1503
- # wp_enqueue_style( 'wcml-pointers');
1504
 
1505
- msgid "Translate endpoints"
1506
  msgstr ""
1507
 
1508
- # 'strings' => array(
1509
- # 'conf' => __( 'Configuration Warnings', 'woocommerce-multilingual' ),
1510
- # 'report' => __( 'Reporting miscelaneous configuration issues that can make WooCommerce Multilingual not run normally', 'woocommerce-multilingual' ),
1511
 
1512
- msgid "Configuration Warnings"
1513
  msgstr ""
1514
 
1515
- # 'conf' => __( 'Configuration Warnings', 'woocommerce-multilingual' ),
1516
- # 'report' => __( 'Reporting miscelaneous configuration issues that can make WooCommerce Multilingual not run normally', 'woocommerce-multilingual' ),
1517
- # 'base_not_trnsl' => __( 'Your product permalink base is not translated to:', 'woocommerce-multilingual' ),
1518
 
1519
- msgid "Reporting miscelaneous configuration issues that can make WooCommerce Multilingual not run normally"
1520
  msgstr ""
1521
 
1522
- # 'report' => __( 'Reporting miscelaneous configuration issues that can make WooCommerce Multilingual not run normally', 'woocommerce-multilingual' ),
1523
- # 'base_not_trnsl' => __( 'Your product permalink base is not translated to:', 'woocommerce-multilingual' ),
1524
- # 'trsl_urls' => __( 'Translate URLs', 'woocommerce-multilingual' ),
1525
 
1526
- msgid "Your product permalink base is not translated to:"
1527
  msgstr ""
1528
 
1529
- # 'base_not_trnsl' => __( 'Your product permalink base is not translated to:', 'woocommerce-multilingual' ),
1530
- # 'trsl_urls' => __( 'Translate URLs', 'woocommerce-multilingual' ),
1531
- # 'def_and_st_not_en' => __( "Your site's default language is not English and the strings language is also not English.", 'woocommerce-multilingual' ),
1532
 
1533
- msgid "Translate URLs"
1534
  msgstr ""
1535
 
1536
- # 'trsl_urls' => __( 'Translate URLs', 'woocommerce-multilingual' ),
1537
- # 'def_and_st_not_en' => __( "Your site's default language is not English and the strings language is also not English.", 'woocommerce-multilingual' ),
1538
- # 'run_not_en' => __( 'Running WooCommerce multilingual with default language other than English.', 'woocommerce-multilingual' ),
1539
 
1540
- msgid "Your site's default language is not English and the strings language is also not English."
1541
  msgstr ""
1542
 
1543
- # 'def_and_st_not_en' => __( "Your site's default language is not English and the strings language is also not English.", 'woocommerce-multilingual' ),
1544
- # 'run_not_en' => __( 'Running WooCommerce multilingual with default language other than English.', 'woocommerce-multilingual' ),
1545
- # 'url_problems' => __( 'This may cause problems with URLs in different languages.', 'woocommerce-multilingual' ),
1546
 
1547
- msgid "Running WooCommerce multilingual with default language other than English."
1548
  msgstr ""
1549
 
1550
- # 'run_not_en' => __( 'Running WooCommerce multilingual with default language other than English.', 'woocommerce-multilingual' ),
1551
- # 'url_problems' => __( 'This may cause problems with URLs in different languages.', 'woocommerce-multilingual' ),
1552
- # 'change_def_lang' => __( 'Change default language', 'woocommerce-multilingual' ),
1553
 
1554
- msgid "This may cause problems with URLs in different languages."
1555
  msgstr ""
1556
 
1557
- # 'url_problems' => __( 'This may cause problems with URLs in different languages.', 'woocommerce-multilingual' ),
1558
- # 'change_def_lang' => __( 'Change default language', 'woocommerce-multilingual' ),
1559
- # 'def_not_en' => __( "Your site's default language is not English.", 'woocommerce-multilingual' ),
1560
 
1561
- msgid "Change default language"
1562
  msgstr ""
1563
 
1564
- # 'change_def_lang' => __( 'Change default language', 'woocommerce-multilingual' ),
1565
- # 'def_not_en' => __( "Your site's default language is not English.", 'woocommerce-multilingual' ),
1566
- # 'attent_sett' => __( 'There are some settings that require careful attention.', 'woocommerce-multilingual' ),
1567
 
1568
- msgid "Your site's default language is not English."
1569
  msgstr ""
1570
 
1571
- # 'def_not_en' => __( "Your site's default language is not English.", 'woocommerce-multilingual' ),
1572
- # 'attent_sett' => __( 'There are some settings that require careful attention.', 'woocommerce-multilingual' ),
1573
- # 'over_sett' => __( 'Some settings from the WooCommerce Multilingual wpml-config.xml file have been overwritten.', 'woocommerce-multilingual' ),
1574
 
1575
- msgid "There are some settings that require careful attention."
1576
  msgstr ""
1577
 
1578
- # 'attent_sett' => __( 'There are some settings that require careful attention.', 'woocommerce-multilingual' ),
1579
- # 'over_sett' => __( 'Some settings from the WooCommerce Multilingual wpml-config.xml file have been overwritten.', 'woocommerce-multilingual' ),
1580
- # 'check_conf' => __( 'You should check WPML configuration files added by other plugins or manual settings on the %s section.', 'woocommerce-multilingual' ),
1581
 
1582
- msgid "Some settings from the WooCommerce Multilingual wpml-config.xml file have been overwritten."
 
1583
  msgstr ""
1584
 
1585
- # 'over_sett' => __( 'Some settings from the WooCommerce Multilingual wpml-config.xml file have been overwritten.', 'woocommerce-multilingual' ),
1586
- # 'check_conf' => __( 'You should check WPML configuration files added by other plugins or manual settings on the %s section.', 'woocommerce-multilingual' ),
1587
- # 'cont_set' => '<a href="' . admin_url( 'admin.php?page=' . WPML_TM_FOLDER . '/menu/main.php&sm=mcsetup' ) . '">'. __( 'Multilingual Content Setup', 'woocommerce-multilingual' ) .'</a>'
1588
 
1589
- msgid "You should check WPML configuration files added by other plugins or manual settings on the %s section."
1590
  msgstr ""
1591
 
1592
- # 'check_conf' => __( 'You should check WPML configuration files added by other plugins or manual settings on the %s section.', 'woocommerce-multilingual' ),
1593
- # 'cont_set' => '<a href="' . admin_url( 'admin.php?page=' . WPML_TM_FOLDER . '/menu/main.php&sm=mcsetup' ) . '">'. __( 'Multilingual Content Setup', 'woocommerce-multilingual' ) .'</a>'
1594
  # ),
1595
 
1596
- msgid "Multilingual Content Setup"
1597
  msgstr ""
1598
 
1599
- # 'strings' => array(
1600
- # 'status' => __( 'Plugins Status', 'woocommerce-multilingual' ),
1601
- # 'inst_active' => __( '%s is installed and active.', 'woocommerce-multilingual' ),
1602
 
1603
- msgid "Plugins Status"
1604
  msgstr ""
1605
 
1606
- # 'status' => __( 'Plugins Status', 'woocommerce-multilingual' ),
1607
- # 'inst_active' => __( '%s is installed and active.', 'woocommerce-multilingual' ),
1608
- # 'is_setup' => __( '%s is set up.', 'woocommerce-multilingual' ),
1609
 
1610
- msgid "%s is installed and active."
1611
  msgstr ""
1612
 
1613
- # 'inst_active' => __( '%s is installed and active.', 'woocommerce-multilingual' ),
1614
- # 'is_setup' => __( '%s is set up.', 'woocommerce-multilingual' ),
1615
- # 'not_setup' => __( '%s is not set up.', 'woocommerce-multilingual' ),
1616
 
1617
- msgid "%s is set up."
1618
  msgstr ""
1619
 
1620
- # 'is_setup' => __( '%s is set up.', 'woocommerce-multilingual' ),
1621
- # 'not_setup' => __( '%s is not set up.', 'woocommerce-multilingual' ),
1622
- # 'wpml' => '<strong>WPML</strong>',
1623
 
1624
- msgid "%s is not set up."
1625
  msgstr ""
1626
 
1627
- # 'wc' => '<strong>WooCommerce</strong>',
1628
- # 'depends' => __( 'WooCommerce Multilingual depends on several plugins to work. If any required plugin is missing, you should install and activate it.', 'woocommerce-multilingual' )
1629
- # )
1630
 
1631
- msgid "WooCommerce Multilingual depends on several plugins to work. If any required plugin is missing, you should install and activate it."
1632
  msgstr ""
1633
 
1634
- # 'strings' => array(
1635
- # 'store_pages' => __( 'WooCommerce Store Pages', 'woocommerce-multilingual' ),
1636
- # 'pages_trnsl' => __( 'To run a multilingual e-commerce site, you need to have the WooCommerce shop pages translated to all the site\'s languages. Once all the pages are installed you can add the translations for them from this menu.', 'woocommerce-multilingual' ),
1637
 
1638
- msgid "WooCommerce Store Pages"
1639
  msgstr ""
1640
 
1641
- # 'store_pages' => __( 'WooCommerce Store Pages', 'woocommerce-multilingual' ),
1642
- # 'pages_trnsl' => __( 'To run a multilingual e-commerce site, you need to have the WooCommerce shop pages translated to all the site\'s languages. Once all the pages are installed you can add the translations for them from this menu.', 'woocommerce-multilingual' ),
1643
- # 'store_pages' => __( 'WooCommerce Store Pages', 'woocommerce-multilingual' ),
1644
 
1645
- msgid "To run a multilingual e-commerce site, you need to have the WooCommerce shop pages translated to all the site's languages. Once all the pages are installed you can add the translations for them from this menu."
1646
  msgstr ""
1647
 
1648
- # 'store_pages' => __( 'WooCommerce Store Pages', 'woocommerce-multilingual' ),
1649
- # 'not_created' => __( 'One or more WooCommerce pages have not been created.', 'woocommerce-multilingual' ),
1650
- # 'install' => __( 'Install WooCommerce Pages', 'woocommerce-multilingual' ),
1651
 
1652
- msgid "One or more WooCommerce pages have not been created."
1653
  msgstr ""
1654
 
1655
- # 'not_created' => __( 'One or more WooCommerce pages have not been created.', 'woocommerce-multilingual' ),
1656
- # 'install' => __( 'Install WooCommerce Pages', 'woocommerce-multilingual' ),
1657
- # 'not_exist' => __( 'WooCommerce store pages do not exist for these languages:', 'woocommerce-multilingual' ),
1658
 
1659
- msgid "Install WooCommerce Pages"
1660
  msgstr ""
1661
 
1662
- # 'install' => __( 'Install WooCommerce Pages', 'woocommerce-multilingual' ),
1663
- # 'not_exist' => __( 'WooCommerce store pages do not exist for these languages:', 'woocommerce-multilingual' ),
1664
- # 'create_transl' => __( 'Create missing translations', 'woocommerce-multilingual' ),
1665
 
1666
- msgid "WooCommerce store pages do not exist for these languages:"
1667
  msgstr ""
1668
 
1669
- # 'not_exist' => __( 'WooCommerce store pages do not exist for these languages:', 'woocommerce-multilingual' ),
1670
- # 'create_transl' => __( 'Create missing translations', 'woocommerce-multilingual' ),
1671
- # 'translated_wpml' => __( 'These pages are currently being translated by translators via WPML: ', 'woocommerce-multilingual' ),
1672
 
1673
- msgid "Create missing translations"
1674
  msgstr ""
1675
 
1676
- # 'create_transl' => __( 'Create missing translations', 'woocommerce-multilingual' ),
1677
- # 'translated_wpml' => __( 'These pages are currently being translated by translators via WPML: ', 'woocommerce-multilingual' ),
1678
- # 'translated' => __( 'WooCommerce store pages are translated to all the site\'s languages.', 'woocommerce-multilingual' )
1679
 
1680
- msgid "These pages are currently being translated by translators via WPML: "
1681
  msgstr ""
1682
 
1683
- # 'translated_wpml' => __( 'These pages are currently being translated by translators via WPML: ', 'woocommerce-multilingual' ),
1684
- # 'translated' => __( 'WooCommerce store pages are translated to all the site\'s languages.', 'woocommerce-multilingual' )
1685
  # ),
 
 
1686
 
1687
- msgid "WooCommerce store pages are translated to all the site's languages."
1688
  msgstr ""
1689
 
1690
- # 'strings' => array(
1691
- # 'troubl' => __( 'Troubleshooting page', 'woocommerce-multilingual' )
1692
- # )
1693
 
1694
- msgid "Troubleshooting page"
1695
  msgstr ""
1696
 
1697
  # 'strings' => array(
1698
- # 'products_missing' => __( 'Products Missing Translations', 'woocommerce-multilingual' ),
1699
- # 'miss_trnsl_one' => __( '%d %s translation missing.', 'woocommerce-multilingual' ),
1700
 
1701
- msgid "Products Missing Translations"
1702
  msgstr ""
1703
 
1704
- # 'products_missing' => __( 'Products Missing Translations', 'woocommerce-multilingual' ),
1705
- # 'miss_trnsl_one' => __( '%d %s translation missing.', 'woocommerce-multilingual' ),
1706
- # 'miss_trnsl_more' => __( '%d %s translations missing.', 'woocommerce-multilingual' ),
1707
 
1708
- msgid "%d %s translation missing."
1709
  msgstr ""
1710
 
1711
- # 'miss_trnsl_one' => __( '%d %s translation missing.', 'woocommerce-multilingual' ),
1712
- # 'miss_trnsl_more' => __( '%d %s translations missing.', 'woocommerce-multilingual' ),
1713
- # 'transl' => __( 'Translate Products', 'woocommerce-multilingual' ),
1714
 
1715
- msgid "%d %s translations missing."
1716
  msgstr ""
1717
 
1718
- # 'miss_trnsl_more' => __( '%d %s translations missing.', 'woocommerce-multilingual' ),
1719
- # 'transl' => __( 'Translate Products', 'woocommerce-multilingual' ),
1720
- # 'not_to_trnsl' => __( 'Right now, there are no products needing translation.', 'woocommerce-multilingual' )
1721
 
1722
- msgid "Translate Products"
1723
  msgstr ""
1724
 
1725
- # 'transl' => __( 'Translate Products', 'woocommerce-multilingual' ),
1726
- # 'not_to_trnsl' => __( 'Right now, there are no products needing translation.', 'woocommerce-multilingual' )
1727
- # )
1728
 
1729
- msgid "Right now, there are no products needing translation."
1730
  msgstr ""
1731
 
1732
- # 'strings' => array(
1733
- # 'mc_missing' => __( 'Multi-currency', 'woocommerce-multilingual' ),
1734
- # 'no_secondary' => __( "You haven't added any secondary currencies.", 'woocommerce-multilingual' ),
1735
 
1736
- msgid "Multi-currency"
1737
  msgstr ""
1738
 
1739
- # 'no_secondary' => __( "You haven't added any secondary currencies.", 'woocommerce-multilingual' ),
1740
- # 'sec_currencies' => __( 'Secondary currencies: %s', 'woocommerce-multilingual' ),
1741
- # 'not_enabled' => __( 'Multi-currency is not enabled.', 'woocommerce-multilingual' ),
1742
 
1743
- msgid "Secondary currencies: %s"
1744
  msgstr ""
1745
 
1746
- # 'sec_currencies' => __( 'Secondary currencies: %s', 'woocommerce-multilingual' ),
1747
- # 'not_enabled' => __( 'Multi-currency is not enabled.', 'woocommerce-multilingual' ),
1748
- # 'add_cur' => __( 'Add Currencies', 'woocommerce-multilingual' )
1749
 
1750
- msgid "Multi-currency is not enabled."
1751
  msgstr ""
1752
 
1753
- # 'not_enabled' => __( 'Multi-currency is not enabled.', 'woocommerce-multilingual' ),
1754
- # 'add_cur' => __( 'Add Currencies', 'woocommerce-multilingual' )
1755
- # )
1756
 
1757
- msgid "Add Currencies"
1758
  msgstr ""
1759
 
1760
- # 'strings' => array(
1761
- # 'tax_missing' => __( 'Taxonomies Missing Translations', 'woocommerce-multilingual' ),
1762
- # 'run_site' => __( 'To run a fully translated site, you should translate all taxonomy terms. Some store elements, such as variations, depend on taxonomy translation.', 'woocommerce-multilingual' ),
1763
 
1764
- msgid "Taxonomies Missing Translations"
1765
  msgstr ""
1766
 
1767
- # 'tax_missing' => __( 'Taxonomies Missing Translations', 'woocommerce-multilingual' ),
1768
- # 'run_site' => __( 'To run a fully translated site, you should translate all taxonomy terms. Some store elements, such as variations, depend on taxonomy translation.', 'woocommerce-multilingual' ),
1769
- # 'not_req_trnsl' => __( '%s do not require translation.', 'woocommerce-multilingual' ),
1770
 
1771
- msgid "To run a fully translated site, you should translate all taxonomy terms. Some store elements, such as variations, depend on taxonomy translation."
1772
  msgstr ""
1773
 
1774
- # 'not_req_trnsl' => __( '%s do not require translation.', 'woocommerce-multilingual' ),
1775
- # 'req_trnsl' => __( 'This taxonomy requires translation.', 'woocommerce-multilingual' ),
1776
- # 'incl_trnsl' => __( 'Include in translation', 'woocommerce-multilingual' ),
1777
 
1778
- msgid "This taxonomy requires translation."
1779
  msgstr ""
1780
 
1781
- # 'req_trnsl' => __( 'This taxonomy requires translation.', 'woocommerce-multilingual' ),
1782
- # 'incl_trnsl' => __( 'Include in translation', 'woocommerce-multilingual' ),
1783
- # 'miss_trnsl_one' => __( '%d %s is missing translations.', 'woocommerce-multilingual' ),
1784
 
1785
- msgid "Include in translation"
1786
  msgstr ""
1787
 
1788
- # 'incl_trnsl' => __( 'Include in translation', 'woocommerce-multilingual' ),
1789
- # 'miss_trnsl_one' => __( '%d %s is missing translations.', 'woocommerce-multilingual' ),
1790
- # 'miss_trnsl_more' => __( '%d %s are missing translations.', 'woocommerce-multilingual' ),
1791
 
1792
- msgid "%d %s is missing translations."
1793
  msgstr ""
1794
 
1795
- # 'trnsl' => __( 'Translate %s', 'woocommerce-multilingual' ),
1796
- # 'doesnot_req_trnsl' => __( 'This taxonomy does not require translation.', 'woocommerce-multilingual' ),
1797
- # 'exclude' => __( 'Exclude from translation', 'woocommerce-multilingual' ),
1798
 
1799
- msgid "This taxonomy does not require translation."
1800
  msgstr ""
1801
 
1802
- # 'all_trnsl' => __( 'All %s are translated.', 'woocommerce-multilingual' ),
1803
- # 'not_to_trnsl' => __( 'Right now, there are no taxonomy terms needing translation.', 'woocommerce-multilingual' )
1804
  # ),
1805
 
1806
- msgid "Right now, there are no taxonomy terms needing translation."
1807
  msgstr ""
1808
 
1809
  # 'strings' => array(
1810
- # 'heading' => __( 'Enable Multiple Currencies', 'woocommerce-multilingual' ),
1811
- # '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' ),
1812
 
1813
- msgid "Enable Multiple Currencies"
1814
  msgstr ""
1815
 
1816
- # 'heading' => __( 'Enable Multiple Currencies', 'woocommerce-multilingual' ),
1817
- # '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' ),
1818
- # 'label_mco' => __( 'Enable the multi-currency mode', 'woocommerce-multilingual' ),
1819
 
1820
- msgid "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."
1821
  msgstr ""
1822
 
1823
- # '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' ),
1824
- # 'label_mco' => __( 'Enable the multi-currency mode', 'woocommerce-multilingual' ),
1825
- # 'continue' => __( 'Continue', 'woocommerce-multilingual' ),
1826
 
1827
- msgid "Enable the multi-currency mode"
1828
  msgstr ""
1829
 
1830
- # 'label_mco' => __( 'Enable the multi-currency mode', 'woocommerce-multilingual' ),
1831
- # 'continue' => __( 'Continue', 'woocommerce-multilingual' ),
1832
- # 'later' => __( 'Later', 'woocommerce-multilingual' )
1833
 
1834
- msgid "Continue"
1835
  msgstr ""
1836
 
1837
- # 'continue' => __( 'Continue', 'woocommerce-multilingual' ),
1838
- # 'later' => __( 'Later', 'woocommerce-multilingual' )
1839
- # ),
1840
 
1841
- msgid "Later"
1842
  msgstr ""
1843
 
1844
- # 'strings' => array(
1845
- # 'heading' => __('Setup Complete', 'woocommerce-multilingual'),
1846
- # 'description1' => __("Your multilingual shop is almost ready. Next, you should go to the different tabs in %sWooCommerce &raquo; WooCommerce Multilingual%s admin and do the final setup.", 'woocommerce-multilingual'),
1847
 
1848
- msgid "Setup Complete"
1849
  msgstr ""
1850
 
1851
- # 'heading' => __('Setup Complete', 'woocommerce-multilingual'),
1852
- # 'description1' => __("Your multilingual shop is almost ready. Next, you should go to the different tabs in %sWooCommerce &raquo; WooCommerce Multilingual%s admin and do the final setup.", 'woocommerce-multilingual'),
1853
- # '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'),
1854
 
1855
- msgid "Your multilingual shop is almost ready. Next, you should go to the different tabs in %sWooCommerce &raquo; WooCommerce Multilingual%s admin and do the final setup."
1856
  msgstr ""
1857
 
1858
- # 'description1' => __("Your multilingual shop is almost ready. Next, you should go to the different tabs in %sWooCommerce &raquo; WooCommerce Multilingual%s admin and do the final setup.", 'woocommerce-multilingual'),
1859
- # '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'),
1860
- # 'continue' => __('Close setup', 'woocommerce-multilingual'),
1861
 
1862
- msgid "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."
1863
  msgstr ""
1864
 
1865
- # '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'),
1866
- # 'continue' => __('Close setup', 'woocommerce-multilingual'),
 
 
 
 
 
 
 
1867
  # ),
1868
 
1869
- msgid "Close setup"
1870
  msgstr ""
1871
 
1872
  # 'strings' => array(
1873
- # 'heading' => __("Let's turn your WooCommerce shop multilingual", 'woocommerce-multilingual'),
1874
- # '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'),
1875
 
1876
- msgid "Let's turn your WooCommerce shop multilingual"
1877
  msgstr ""
1878
 
1879
- # 'heading' => __("Let's turn your WooCommerce shop multilingual", 'woocommerce-multilingual'),
1880
- # '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'),
1881
- # 'description2' => array(
1882
 
1883
- msgid "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."
1884
  msgstr ""
1885
 
1886
- #
1887
- # 'title' => __("We'll help you:", 'woocommerce-multilingual'),
1888
- # 'step1' => __("Translate the 'store' pages", 'woocommerce-multilingual'),
1889
 
1890
- msgid "We'll help you:"
1891
  msgstr ""
1892
 
1893
- # 'title' => __("We'll help you:", 'woocommerce-multilingual'),
1894
- # 'step1' => __("Translate the 'store' pages", 'woocommerce-multilingual'),
1895
- # 'step2' => __("Choose which attributes to make translatable", 'woocommerce-multilingual'),
1896
 
1897
- msgid "Translate the 'store' pages"
1898
  msgstr ""
1899
 
1900
- # 'step1' => __("Translate the 'store' pages", 'woocommerce-multilingual'),
1901
- # 'step2' => __("Choose which attributes to make translatable", 'woocommerce-multilingual'),
1902
- # 'step3' => __("Choose if you need multiple currencies", 'woocommerce-multilingual'),
1903
 
1904
- msgid "Choose which attributes to make translatable"
1905
  msgstr ""
1906
 
1907
- # 'step2' => __("Choose which attributes to make translatable", 'woocommerce-multilingual'),
1908
- # 'step3' => __("Choose if you need multiple currencies", 'woocommerce-multilingual'),
1909
- #
1910
 
1911
- msgid "Choose if you need multiple currencies"
1912
  msgstr ""
1913
 
1914
- # ),
1915
- # 'description3' => sprintf( __("You can make these updates now, or later from the %sWooCommerce &raquo; WooCommerce Multilingual%s menu.", 'woocommerce-multilingual'), '<strong>', '</strong>' ),
1916
- # 'continue' => __("Let's continue", 'woocommerce-multilingual'),
1917
 
1918
- msgid "You can make these updates now, or later from the %sWooCommerce &raquo; WooCommerce Multilingual%s menu."
1919
  msgstr ""
1920
 
1921
- # 'description3' => sprintf( __("You can make these updates now, or later from the %sWooCommerce &raquo; WooCommerce Multilingual%s menu.", 'woocommerce-multilingual'), '<strong>', '</strong>' ),
1922
- # 'continue' => __("Let's continue", 'woocommerce-multilingual'),
1923
- # 'later' => __("I'll do the setup later", 'woocommerce-multilingual')
1924
 
1925
- msgid "Let's continue"
1926
  msgstr ""
1927
 
1928
- # 'continue' => __("Let's continue", 'woocommerce-multilingual'),
1929
- # 'later' => __("I'll do the setup later", 'woocommerce-multilingual')
1930
- # ),
1931
 
1932
- msgid "I'll do the setup later"
1933
  msgstr ""
1934
 
1935
- #
1936
- # $store_pages_view = '<p><i class="otgs-ico-warning"></i> ' . __('One or more WooCommerce pages have not been created') . '<p>';
 
 
 
 
 
 
 
1937
  #
1938
 
1939
- msgid "One or more WooCommerce pages have not been created"
1940
  msgstr ""
1941
 
1942
- # '<label><input type="checkbox" name="install_missing_pages" value="1" checked="checked">&nbsp;' .
1943
- # __('Install missing WooCommerce pages and create translations.', 'woocommerce-multilingual') .
1944
- # '</label>';
1945
 
1946
- msgid "Install missing WooCommerce pages and create translations."
1947
  msgstr ""
1948
 
1949
- # 'strings' => array(
1950
- # 'heading' => __('Translate Store Pages', 'woocommerce-multilingual'),
1951
- # 'description' => __("All store pages must be translated in the languages configured on the site.", 'woocommerce-multilingual'),
1952
 
1953
- msgid "Translate Store Pages"
1954
  msgstr ""
1955
 
1956
- # 'heading' => __('Translate Store Pages', 'woocommerce-multilingual'),
1957
- # 'description' => __("All store pages must be translated in the languages configured on the site.", 'woocommerce-multilingual'),
1958
- # 'continue' => __('Continue', 'woocommerce-multilingual'),
1959
 
1960
- msgid "All store pages must be translated in the languages configured on the site."
1961
  msgstr ""
1962
 
1963
- # 'strings' => array(
1964
- # 'heading' => __('Select Translatable Attributes', 'woocommerce-multilingual'),
1965
- # 'no_attributes' => __('There are no attributes defined', 'woocommerce-multilingual'),
1966
 
1967
- msgid "Select Translatable Attributes"
1968
  msgstr ""
1969
 
1970
- # 'heading' => __('Select Translatable Attributes', 'woocommerce-multilingual'),
1971
- # 'no_attributes' => __('There are no attributes defined', 'woocommerce-multilingual'),
1972
- # 'continue' => __('Continue', 'woocommerce-multilingual'),
1973
 
1974
- msgid "There are no attributes defined"
1975
  msgstr ""
1976
 
1977
- # 'strings' => array(
1978
- # 'update_trnsl' => __('Update Translation', 'woocommerce-multilingual'),
1979
- # 'hide' => __('Hide This Message', 'woocommerce-multilingual'),
1980
 
1981
- msgid "Update Translation"
1982
  msgstr ""
1983
 
1984
- # 'update_trnsl' => __('Update Translation', 'woocommerce-multilingual'),
1985
- # 'hide' => __('Hide This Message', 'woocommerce-multilingual'),
1986
- # 'trnsl_available' => sprintf( __( '<strong>WooCommerce Translation Available</strong> &#8211; Install or update your <code>%s</code> translations to version <code>%s</code>.', 'woocommerce-multilingual' ), implode(', ', $this->notices ), WC_VERSION )
1987
 
1988
- msgid "Hide This Message"
1989
  msgstr ""
1990
 
1991
- # 'hide' => __('Hide This Message', 'woocommerce-multilingual'),
1992
- # 'trnsl_available' => sprintf( __( '<strong>WooCommerce Translation Available</strong> &#8211; Install or update your <code>%s</code> translations to version <code>%s</code>.', 'woocommerce-multilingual' ), implode(', ', $this->notices ), WC_VERSION )
1993
- # ),
1994
 
1995
- msgid "<strong>WooCommerce Translation Available</strong> &#8211; Install or update your <code>%s</code> translations to version <code>%s</code>."
1996
  msgstr ""
1997
 
1998
- # 'title' => __('WooCommerce Multilingual', 'woocommerce-multilingual'),
1999
- # 'untranslated_terms'=> __('You have untranslated terms!', 'woocommerce-multilingual')
2000
  # ),
2001
 
2002
- msgid "You have untranslated terms!"
2003
  msgstr ""
2004
 
2005
- # 'products' => array(
2006
- # 'title' => __('Products', 'woocommerce-multilingual'),
2007
- # 'url' => admin_url('admin.php?page=wpml-wcml'),
2008
 
2009
- msgid "Products"
2010
  msgstr ""
2011
 
2012
- # 'product_cat' => array(
2013
- # 'name' => __('Categories', 'woocommerce-multilingual'),
2014
- # 'title' => !$this->woocommerce_wpml->terms->is_fully_translated( 'product_cat' ) ? __('You have untranslated terms!', 'woocommerce-multilingual') : '',
2015
 
2016
- msgid "Categories"
2017
  msgstr ""
2018
 
2019
- # 'product_tag' => array(
2020
- # 'name' => __('Tags', 'woocommerce-multilingual'),
2021
- # 'title' => !$this->woocommerce_wpml->terms->is_fully_translated( 'product_tag' ) ? __('You have untranslated terms!', 'woocommerce-multilingual') : '',
2022
 
2023
- msgid "Tags"
2024
  msgstr ""
2025
 
2026
- # 'custom_taxonomies' => array(
2027
- # 'name' => __('Custom Taxonomies', 'woocommerce-multilingual'),
2028
- # 'active' => $current_tab == 'custom-taxonomies' ? 'nav-tab-active':'',
2029
 
2030
- msgid "Custom Taxonomies"
2031
  msgstr ""
2032
 
2033
- # 'attributes' => array(
2034
- # 'name' => __('Attributes', 'woocommerce-multilingual'),
2035
- # 'active' => $current_tab == 'product-attributes' ? 'nav-tab-active':'',
2036
 
2037
- msgid "Attributes"
2038
  msgstr ""
2039
 
2040
- # 'shipping_classes' => array(
2041
- # 'name' => __('Shipping Classes', 'woocommerce-multilingual'),
2042
- # 'title' => !$this->woocommerce_wpml->terms->is_fully_translated( 'product_shipping_class' ) ? __('You have untranslated terms!', 'woocommerce-multilingual') : '',
2043
 
2044
- msgid "Shipping Classes"
2045
  msgstr ""
2046
 
2047
- # 'settings' => array(
2048
- # 'name' => __( 'Settings', 'woocommerce-multilingual' ),
2049
- # 'active' => $current_tab == 'settings' ? 'nav-tab-active':'',
2050
 
2051
- msgid "Settings"
2052
  msgstr ""
2053
 
2054
- # 'slugs' => array(
2055
- # 'name' => __( 'Store URLs', 'woocommerce-multilingual' ),
2056
- # 'active' => $current_tab == 'slugs' ? 'nav-tab-active':'',
2057
 
2058
- msgid "Store URLs"
2059
  msgstr ""
2060
 
2061
- # 'status' => array(
2062
- # 'name' => __( 'Status', 'woocommerce-multilingual' ),
2063
- # 'active' => $current_tab == 'status' ? 'nav-tab-active':'',
2064
 
2065
- msgid "Status"
2066
  msgstr ""
2067
 
2068
- # 'troubleshooting' => array(
2069
- # 'name' => __( 'Troubleshooting', 'woocommerce-multilingual' ),
2070
- # 'active' => $current_tab == 'troubleshooting' ? 'nav-tab-active':'',
2071
 
2072
- msgid "Troubleshooting"
2073
  msgstr ""
2074
 
2075
- # 'on' => !isset( $this->woocommerce_wpml->settings['rate-block'] ),
2076
- # 'message' => sprintf(__('Thank you for using %sWooCommerce Multilingual%s! You can express your love and
2077
- # support by %s rating our plugin and saying that %sit works%s for you.', 'woocommerce_wpml'),
2078
 
2079
- msgid "Thank you for using %sWooCommerce Multilingual%s! You can express your love and\n support by %s rating our plugin and saying that %sit works%s for you."
2080
  msgstr ""
2081
 
 
 
2082
  # ),
2083
- # 'hide_text' => __('Hide','woocommerce-multilingual'),
2084
- # 'nonce' => wp_nonce_field('wcml_settings', 'wcml_settings_nonce', true, false)
2085
 
2086
- msgid "Hide"
2087
  msgstr ""
2088
 
2089
- # ?>
2090
- # <div class="wpml-loading-taxonomy"><span class="spinner is-active"></span><?php echo __( 'Loading ...', 'woocommerce-multilingual' ) ?></div>
2091
- # <div class="wpml_taxonomy_loaded" style="display:none">
2092
 
2093
- msgid "Loading ..."
2094
  msgstr ""
2095
 
2096
- # $empty_value->name = '';
2097
- # $empty_value->label = __( '--Taxonomy--', 'woocommerce-multilingual' );
2098
- # array_unshift( $this->custom_taxonomies, $empty_value );
2099
 
2100
- msgid "--Taxonomy--"
2101
  msgstr ""
2102
 
2103
- # 'strings' => array(
2104
- # 'no_taxonomies' => __( 'There are no translatable product custom taxonomies defined', 'woocommerce-multilingual' ),
2105
- # 'select_label' => __('Select the taxonomy to translate: ', 'woocommerce-multilingual'),
2106
 
2107
- msgid "There are no translatable product custom taxonomies defined"
2108
  msgstr ""
2109
 
2110
- # 'no_taxonomies' => __( 'There are no translatable product custom taxonomies defined', 'woocommerce-multilingual' ),
2111
- # 'select_label' => __('Select the taxonomy to translate: ', 'woocommerce-multilingual'),
2112
- # 'loading' => __( 'Loading ...', 'woocommerce-multilingual' )
2113
 
2114
- msgid "Select the taxonomy to translate: "
2115
  msgstr ""
2116
 
2117
- # 'strings' => array(
2118
- # 'image' => __( 'Image', 'woocommerce-multilingual' ),
2119
- # 'product' => __( 'Product', 'woocommerce-multilingual' ),
2120
 
2121
- msgid "Image"
2122
  msgstr ""
2123
 
2124
- # 'product' => __( 'Product', 'woocommerce-multilingual' ),
2125
- # 'type' => __( 'Type', 'woocommerce-multilingual' ),
2126
- # 'date' => __( 'Date', 'woocommerce-multilingual' ),
2127
 
2128
- msgid "Type"
2129
  msgstr ""
2130
 
2131
- # 'type' => __( 'Type', 'woocommerce-multilingual' ),
2132
- # 'date' => __( 'Date', 'woocommerce-multilingual' ),
2133
- # 'categories' => __( 'Categories', 'woocommerce-multilingual' ),
2134
 
2135
- msgid "Date"
2136
  msgstr ""
2137
 
2138
- # 'categories' => __( 'Categories', 'woocommerce-multilingual' ),
2139
- # 'no_products' => __( 'No products found', 'woocommerce-multilingual' ),
2140
- # 'draft' => __( 'Draft', 'woocommerce-multilingual' ),
2141
 
2142
- msgid "No products found"
2143
  msgstr ""
2144
 
2145
- # 'no_products' => __( 'No products found', 'woocommerce-multilingual' ),
2146
- # 'draft' => __( 'Draft', 'woocommerce-multilingual' ),
2147
- # 'private' => __( 'Private', 'woocommerce-multilingual' ),
2148
 
2149
- msgid "Draft"
2150
  msgstr ""
2151
 
2152
- # 'draft' => __( 'Draft', 'woocommerce-multilingual' ),
2153
- # 'private' => __( 'Private', 'woocommerce-multilingual' ),
2154
- # 'pending' => __( 'Pending', 'woocommerce-multilingual' ),
2155
 
2156
- msgid "Private"
2157
  msgstr ""
2158
 
2159
- # 'private' => __( 'Private', 'woocommerce-multilingual' ),
2160
- # 'pending' => __( 'Pending', 'woocommerce-multilingual' ),
2161
- # 'future' => __( 'Scheduled', 'woocommerce-multilingual' ),
2162
 
2163
- msgid "Pending"
2164
  msgstr ""
2165
 
2166
- # 'pending' => __( 'Pending', 'woocommerce-multilingual' ),
2167
- # 'future' => __( 'Scheduled', 'woocommerce-multilingual' ),
2168
- # 'parent' => __( 'Parent product: %s', 'woocommerce-multilingual' ),
2169
 
2170
- msgid "Scheduled"
2171
  msgstr ""
2172
 
2173
- # 'future' => __( 'Scheduled', 'woocommerce-multilingual' ),
2174
- # 'parent' => __( 'Parent product: %s', 'woocommerce-multilingual' ),
2175
- # 'edit_item' => __( 'Edit this item', 'woocommerce-multilingual' ),
2176
 
2177
- msgid "Parent product: %s"
2178
  msgstr ""
2179
 
2180
- # 'parent' => __( 'Parent product: %s', 'woocommerce-multilingual' ),
2181
- # 'edit_item' => __( 'Edit this item', 'woocommerce-multilingual' ),
2182
- # 'edit' => __( 'Edit', 'woocommerce-multilingual' ),
2183
 
2184
- msgid "Edit this item"
2185
  msgstr ""
2186
 
2187
- # 'edit_item' => __( 'Edit this item', 'woocommerce-multilingual' ),
2188
- # 'edit' => __( 'Edit', 'woocommerce-multilingual' ),
2189
- # 'view_link' => __( 'View "%s"', 'woocommerce-multilingual' ),
2190
 
2191
- msgid "Edit"
2192
  msgstr ""
2193
 
2194
- # 'edit' => __( 'Edit', 'woocommerce-multilingual' ),
2195
- # 'view_link' => __( 'View "%s"', 'woocommerce-multilingual' ),
2196
- # 'view' => __( 'View', 'woocommerce-multilingual' ),
2197
 
2198
- msgid "View \"%s\""
2199
  msgstr ""
2200
 
2201
- # 'view_link' => __( 'View "%s"', 'woocommerce-multilingual' ),
2202
- # 'view' => __( 'View', 'woocommerce-multilingual' ),
2203
- # 'published' => __( 'Published', 'woocommerce-multilingual' ),
2204
 
2205
- msgid "View"
2206
  msgstr ""
2207
 
2208
- # 'view' => __( 'View', 'woocommerce-multilingual' ),
2209
- # 'published' => __( 'Published', 'woocommerce-multilingual' ),
2210
- # 'modified' => __( 'Last Modified', 'woocommerce-multilingual' ),
2211
 
2212
- msgid "Published"
2213
  msgstr ""
2214
 
2215
- # 'published' => __( 'Published', 'woocommerce-multilingual' ),
2216
- # 'modified' => __( 'Last Modified', 'woocommerce-multilingual' ),
2217
- # ),
2218
 
2219
- msgid "Last Modified"
2220
  msgstr ""
2221
 
2222
- # 'strings' => array(
2223
- # 'all_lang' => __( 'All languages', 'woocommerce-multilingual' ),
2224
- # 'all_cats' => __( 'All categories', 'woocommerce-multilingual' ),
2225
 
2226
- msgid "All languages"
2227
  msgstr ""
2228
 
2229
- # 'all_lang' => __( 'All languages', 'woocommerce-multilingual' ),
2230
- # 'all_cats' => __( 'All categories', 'woocommerce-multilingual' ),
2231
- # 'all_trnsl_stats' => __( 'All translation statuses', 'woocommerce-multilingual' ),
2232
 
2233
- msgid "All categories"
2234
  msgstr ""
2235
 
2236
- # 'all_cats' => __( 'All categories', 'woocommerce-multilingual' ),
2237
- # 'all_trnsl_stats' => __( 'All translation statuses', 'woocommerce-multilingual' ),
2238
- # 'not_trnsl' => __( 'Not translated or needs updating', 'woocommerce-multilingual' ),
2239
 
2240
- msgid "All translation statuses"
2241
  msgstr ""
2242
 
2243
- # 'all_trnsl_stats' => __( 'All translation statuses', 'woocommerce-multilingual' ),
2244
- # 'not_trnsl' => __( 'Not translated or needs updating', 'woocommerce-multilingual' ),
2245
- # 'need_upd' => __( 'Needs updating', 'woocommerce-multilingual' ),
2246
 
2247
- msgid "Not translated or needs updating"
2248
  msgstr ""
2249
 
2250
- # 'not_trnsl' => __( 'Not translated or needs updating', 'woocommerce-multilingual' ),
2251
- # 'need_upd' => __( 'Needs updating', 'woocommerce-multilingual' ),
2252
- # 'in_progress' => __( 'Translation in progress', 'woocommerce-multilingual' ),
2253
 
2254
- msgid "Needs updating"
2255
  msgstr ""
2256
 
2257
- # 'in_progress' => __( 'Translation in progress', 'woocommerce-multilingual' ),
2258
- # 'complete' => __( 'Translation complete', 'woocommerce-multilingual' ),
2259
- # 'all_stats' => __( 'All statuses', 'woocommerce-multilingual' ),
2260
 
2261
- msgid "Translation complete"
2262
  msgstr ""
2263
 
2264
- # 'complete' => __( 'Translation complete', 'woocommerce-multilingual' ),
2265
- # 'all_stats' => __( 'All statuses', 'woocommerce-multilingual' ),
2266
- # 'filter' => __( 'Filter', 'woocommerce-multilingual' ),
2267
 
2268
- msgid "All statuses"
2269
  msgstr ""
2270
 
2271
- # 'all_stats' => __( 'All statuses', 'woocommerce-multilingual' ),
2272
- # 'filter' => __( 'Filter', 'woocommerce-multilingual' ),
2273
- # 'reset' => __( 'Reset', 'woocommerce-multilingual' ),
2274
 
2275
- msgid "Filter"
2276
  msgstr ""
2277
 
2278
- # 'filter' => __( 'Filter', 'woocommerce-multilingual' ),
2279
- # 'reset' => __( 'Reset', 'woocommerce-multilingual' ),
2280
- # 'search' => __( 'Search', 'woocommerce-multilingual' ),
2281
 
2282
- msgid "Reset"
2283
  msgstr ""
2284
 
2285
- # 'reset' => __( 'Reset', 'woocommerce-multilingual' ),
2286
- # 'search' => __( 'Search', 'woocommerce-multilingual' ),
2287
- # ),
2288
 
2289
- msgid "Search"
2290
  msgstr ""
2291
 
2292
- # 'strings' => array(
2293
- # 'items' => __( '%d items', 'woocommerce-multilingual' ),
2294
- # 'first' => __( 'Go to the first page', 'woocommerce-multilingual' ),
2295
 
2296
- msgid "%d items"
2297
  msgstr ""
2298
 
2299
- # 'items' => __( '%d items', 'woocommerce-multilingual' ),
2300
- # 'first' => __( 'Go to the first page', 'woocommerce-multilingual' ),
2301
- # 'previous' => __( 'Go to the previous page', 'woocommerce-multilingual' ),
2302
-
2303
- msgid "Go to the first page"
2304
- msgstr ""
2305
-
2306
- # 'first' => __( 'Go to the first page', 'woocommerce-multilingual' ),
2307
- # 'previous' => __( 'Go to the previous page', 'woocommerce-multilingual' ),
2308
- # 'select' => __( 'Select Page', 'woocommerce-multilingual' ),
2309
 
2310
- msgid "Go to the previous page"
2311
  msgstr ""
2312
 
2313
- # 'previous' => __( 'Go to the previous page', 'woocommerce-multilingual' ),
2314
- # 'select' => __( 'Select Page', 'woocommerce-multilingual' ),
2315
- # 'current' => __( 'Current page', 'woocommerce-multilingual' ),
2316
 
2317
- msgid "Select Page"
2318
  msgstr ""
2319
 
2320
- # 'select' => __( 'Select Page', 'woocommerce-multilingual' ),
2321
- # 'current' => __( 'Current page', 'woocommerce-multilingual' ),
2322
- # 'of' => __( 'of', 'woocommerce-multilingual' ),
2323
 
2324
- msgid "Current page"
2325
  msgstr ""
2326
 
2327
- # 'current' => __( 'Current page', 'woocommerce-multilingual' ),
2328
- # 'of' => __( 'of', 'woocommerce-multilingual' ),
2329
- # 'next' => __( 'Go to the next page', 'woocommerce-multilingual' ),
2330
 
2331
- msgid "of"
2332
  msgstr ""
2333
 
2334
- # 'of' => __( 'of', 'woocommerce-multilingual' ),
2335
- # 'next' => __( 'Go to the next page', 'woocommerce-multilingual' ),
2336
- # 'last' => __( 'Go to the last page', 'woocommerce-multilingual' ),
2337
 
2338
- msgid "Go to the next page"
2339
  msgstr ""
2340
 
2341
- # 'next' => __( 'Go to the next page', 'woocommerce-multilingual' ),
2342
- # 'last' => __( 'Go to the last page', 'woocommerce-multilingual' ),
2343
- # )
2344
 
2345
- msgid "Go to the last page"
2346
  msgstr ""
2347
 
2348
- # $empty_value->attribute_name = '';
2349
- # $empty_value->attribute_label = __( '--Attribute--', 'woocommerce-multilingual' );
2350
- # array_unshift( $product_attributes, $empty_value );
2351
 
2352
- msgid "--Attribute--"
2353
  msgstr ""
2354
 
2355
- # 'strings' => array(
2356
- # 'no_attributes' => __( 'There are no translatable product attributes defined', 'woocommerce-multilingual' ),
2357
- # 'select_label' => __('Select the attribute to translate: ', 'woocommerce-multilingual'),
2358
 
2359
- msgid "There are no translatable product attributes defined"
2360
  msgstr ""
2361
 
2362
- # 'no_attributes' => __( 'There are no translatable product attributes defined', 'woocommerce-multilingual' ),
2363
- # 'select_label' => __('Select the attribute to translate: ', 'woocommerce-multilingual'),
2364
- # 'loading' => __( 'Loading ...', 'woocommerce-multilingual' )
2365
 
2366
- msgid "Select the attribute to translate: "
2367
  msgstr ""
2368
 
2369
  # 'strings' => array(
2370
- # 'orig' => __( 'Original', 'woocommerce-multilingual' ),
2371
- # 'trnsl_to' => __( 'Translation to', 'woocommerce-multilingual' ),
2372
 
2373
- msgid "Original"
2374
  msgstr ""
2375
 
2376
- # 'orig' => __( 'Original', 'woocommerce-multilingual' ),
2377
- # 'trnsl_to' => __( 'Translation to', 'woocommerce-multilingual' ),
2378
- # 'cancel' => __( 'Cancel', 'woocommerce-multilingual' ),
2379
 
2380
- msgid "Translation to"
2381
  msgstr ""
2382
 
2383
- # 'trnsl_to' => __( 'Translation to', 'woocommerce-multilingual' ),
2384
- # 'cancel' => __( 'Cancel', 'woocommerce-multilingual' ),
2385
- # 'save' => __( 'Save', 'woocommerce-multilingual' )
2386
 
2387
- msgid "Cancel"
2388
  msgstr ""
2389
 
2390
- # 'cancel' => __( 'Cancel', 'woocommerce-multilingual' ),
2391
- # 'save' => __( 'Save', 'woocommerce-multilingual' )
2392
- # )
2393
 
2394
- msgid "Save"
2395
  msgstr ""
2396
 
2397
- # $args['original_base_value'] = urldecode(get_post($original_shop_id)->post_name);
2398
- # $args['label_name'] = __('Product Shop Base', 'woocommerce-multilingual');
2399
- # }else{
2400
 
2401
- msgid "Product Shop Base"
2402
  msgstr ""
2403
 
2404
- # 'strings' => array(
2405
- # 'notice' => __( 'This page allows you to translate all strings that are being used by WooCommerce in building different type of urls. Translating them enables you to have fully localized urls that match the language of the pages.', 'woocommerce-multilingual' ),
2406
- # 'notice_defaults' => sprintf( __( 'You can enter or edit your default values on the %sPermalinks settings%s page or, for the endpoints, on the WooCommerce %sAccount settings%s page.',
2407
 
2408
- msgid "This page allows you to translate all strings that are being used by WooCommerce in building different type of urls. Translating them enables you to have fully localized urls that match the language of the pages."
2409
  msgstr ""
2410
 
2411
- # 'notice' => __( 'This page allows you to translate all strings that are being used by WooCommerce in building different type of urls. Translating them enables you to have fully localized urls that match the language of the pages.', 'woocommerce-multilingual' ),
2412
- # 'notice_defaults' => sprintf( __( 'You can enter or edit your default values on the %sPermalinks settings%s page or, for the endpoints, on the WooCommerce %sAccount settings%s page.',
2413
- # 'woocommerce-multilingual' ),
2414
 
2415
- msgid "You can enter or edit your default values on the %sPermalinks settings%s page or, for the endpoints, on the WooCommerce %sAccount settings%s page."
2416
  msgstr ""
2417
 
 
 
2418
  # ),
2419
- # 'perm_settings' => '<a href="'.admin_url('options-permalink.php').'" >' .__( 'permalinks settings', 'woocommerce-multilingual' ).'</a>',
2420
- # 'account_settings' => '<a href="admin.php?page=wc-settings&tab=account" >'.__( 'Account settings', 'woocommerce-multilingual' ).'</a>',
2421
 
2422
- msgid "permalinks settings"
2423
  msgstr ""
2424
 
2425
- # 'perm_settings' => '<a href="'.admin_url('options-permalink.php').'" >' .__( 'permalinks settings', 'woocommerce-multilingual' ).'</a>',
2426
- # 'account_settings' => '<a href="admin.php?page=wc-settings&tab=account" >'.__( 'Account settings', 'woocommerce-multilingual' ).'</a>',
2427
- # 'slug_type' => __( 'Slug type', 'woocommerce-multilingual' ),
2428
 
2429
- msgid "Account settings"
2430
  msgstr ""
2431
 
2432
- # 'account_settings' => '<a href="admin.php?page=wc-settings&tab=account" >'.__( 'Account settings', 'woocommerce-multilingual' ).'</a>',
2433
- # 'slug_type' => __( 'Slug type', 'woocommerce-multilingual' ),
2434
- # 'orig_slug' => __( 'Original Slug', 'woocommerce-multilingual' ),
2435
 
2436
- msgid "Slug type"
2437
  msgstr ""
2438
 
2439
- # 'slug_type' => __( 'Slug type', 'woocommerce-multilingual' ),
2440
- # 'orig_slug' => __( 'Original Slug', 'woocommerce-multilingual' ),
2441
- # 'shop' => __( 'Shop page', 'woocommerce-multilingual' ),
2442
 
2443
- msgid "Original Slug"
2444
  msgstr ""
2445
 
2446
- # 'orig_slug' => __( 'Original Slug', 'woocommerce-multilingual' ),
2447
- # 'shop' => __( 'Shop page', 'woocommerce-multilingual' ),
2448
- # 'product' => __( 'Product base', 'woocommerce-multilingual' ),
2449
 
2450
- msgid "Shop page"
2451
  msgstr ""
2452
 
2453
- # 'shop' => __( 'Shop page', 'woocommerce-multilingual' ),
2454
- # 'product' => __( 'Product base', 'woocommerce-multilingual' ),
2455
- # 'category' => __( 'Product category base', 'woocommerce-multilingual' ),
2456
 
2457
- msgid "Product base"
2458
  msgstr ""
2459
 
2460
- # 'product' => __( 'Product base', 'woocommerce-multilingual' ),
2461
- # 'category' => __( 'Product category base', 'woocommerce-multilingual' ),
2462
- # 'tag' => __( 'Product tag base', 'woocommerce-multilingual' ),
2463
 
2464
- msgid "Product category base"
2465
  msgstr ""
2466
 
2467
- # 'category' => __( 'Product category base', 'woocommerce-multilingual' ),
2468
- # 'tag' => __( 'Product tag base', 'woocommerce-multilingual' ),
2469
- # 'attr' => __( 'Product attribute base', 'woocommerce-multilingual' ),
2470
 
2471
- msgid "Product tag base"
2472
  msgstr ""
2473
 
2474
- # 'tag' => __( 'Product tag base', 'woocommerce-multilingual' ),
2475
- # 'attr' => __( 'Product attribute base', 'woocommerce-multilingual' ),
2476
- # 'endpoint' => __( 'Endpoint: %s', 'woocommerce-multilingual' ),
2477
 
2478
- msgid "Product attribute base"
2479
  msgstr ""
2480
 
2481
- # 'attr' => __( 'Product attribute base', 'woocommerce-multilingual' ),
2482
- # 'endpoint' => __( 'Endpoint: %s', 'woocommerce-multilingual' ),
2483
- # 'attribute_slug' => __( 'Attribute slug: %s', 'woocommerce-multilingual' ),
2484
 
2485
- msgid "Endpoint: %s"
2486
  msgstr ""
2487
 
2488
- # 'endpoint' => __( 'Endpoint: %s', 'woocommerce-multilingual' ),
2489
- # 'attribute_slug' => __( 'Attribute slug: %s', 'woocommerce-multilingual' ),
2490
- # ),
2491
 
2492
- msgid "Attribute slug: %s"
2493
  msgstr ""
2494
 
2495
- # 'strings' => array(
2496
- # 'sync_update' => __('Synchronize attributes and update product variations', 'woocommerce-multilingual'),
2497
- # 'auto_generate' => __('This will automatically generate variations for translated products corresponding to recently translated attributes.', 'woocommerce-multilingual'),
2498
 
2499
- msgid "Synchronize attributes and update product variations"
2500
  msgstr ""
2501
 
2502
- # 'sync_update' => __('Synchronize attributes and update product variations', 'woocommerce-multilingual'),
2503
- # 'auto_generate' => __('This will automatically generate variations for translated products corresponding to recently translated attributes.', 'woocommerce-multilingual'),
2504
- # 'vars_to_create' => __('Currently, there are %s variations that need to be created.', 'woocommerce-multilingual'),
2505
 
2506
- msgid "This will automatically generate variations for translated products corresponding to recently translated attributes."
2507
  msgstr ""
2508
 
2509
- # 'auto_generate' => __('This will automatically generate variations for translated products corresponding to recently translated attributes.', 'woocommerce-multilingual'),
2510
- # 'vars_to_create' => __('Currently, there are %s variations that need to be created.', 'woocommerce-multilingual'),
2511
- # 'sync_in_cont' => __('Synchronize %s assignment in content', 'woocommerce-multilingual'),
2512
 
2513
- msgid "Currently, there are %s variations that need to be created."
2514
  msgstr ""
2515
 
2516
- # 'vars_to_create' => __('Currently, there are %s variations that need to be created.', 'woocommerce-multilingual'),
2517
- # 'sync_in_cont' => __('Synchronize %s assignment in content', 'woocommerce-multilingual'),
2518
- # 'auto_apply' => __('This action lets you automatically apply the %s taxonomy to your content in different languages. It will scan the original content and apply the same taxonomy to translated content.', 'woocommerce-multilingual'),
2519
 
2520
- msgid "Synchronize %s assignment in content"
2521
  msgstr ""
2522
 
2523
- # 'sync_in_cont' => __('Synchronize %s assignment in content', 'woocommerce-multilingual'),
2524
- # 'auto_apply' => __('This action lets you automatically apply the %s taxonomy to your content in different languages. It will scan the original content and apply the same taxonomy to translated content.', 'woocommerce-multilingual'),
2525
- # 'untranslated_warn' => __( 'You have untranslated terms!', 'woocommerce-multilingual' )
2526
 
2527
- msgid "This action lets you automatically apply the %s taxonomy to your content in different languages. It will scan the original content and apply the same taxonomy to translated content."
2528
  msgstr ""
2529
 
2530
- # 'translation_interface' => array(
2531
- # 'heading' => __('Product Translation Interface','woocommerce-multilingual'),
2532
- # 'tip' => __( 'The recommended way is using the WPML Translation Editor. It is streamlined for making the translation process much easier while also providing a much better integration with various WooCommerce extensions.',
2533
 
2534
- msgid "Product Translation Interface"
2535
  msgstr ""
2536
 
2537
- # 'heading' => __('Product Translation Interface','woocommerce-multilingual'),
2538
- # 'tip' => __( 'The recommended way is using the WPML Translation Editor. It is streamlined for making the translation process much easier while also providing a much better integration with various WooCommerce extensions.',
2539
- # 'woocommerce-multilingual' ),
2540
 
2541
- msgid "The recommended way is using the WPML Translation Editor. It is streamlined for making the translation process much easier while also providing a much better integration with various WooCommerce extensions."
2542
  msgstr ""
2543
 
2544
- # 'wcml' => array(
2545
- # 'label' => __('WPML Translation Editor', 'woocommerce-multilingual'),
2546
- #
2547
 
2548
- msgid "WPML Translation Editor"
2549
  msgstr ""
2550
 
2551
- # 'native' => array(
2552
- # 'label' => __('Native WooCommerce product editing screen' , 'woocommerce-multilingual'),
2553
- #
2554
 
2555
- msgid "Native WooCommerce product editing screen"
2556
  msgstr ""
2557
 
2558
- # 'synchronization' => array(
2559
- # 'heading' => __('Products synchronization', 'woocommerce-multilingual'),
2560
- # 'tip' => __( 'Configure specific product properties that should be synced to translations.', 'woocommerce-multilingual' ),
2561
 
2562
- msgid "Products synchronization"
2563
  msgstr ""
2564
 
2565
- # 'heading' => __('Products synchronization', 'woocommerce-multilingual'),
2566
- # 'tip' => __( 'Configure specific product properties that should be synced to translations.', 'woocommerce-multilingual' ),
2567
- # 'sync_date' => array(
2568
 
2569
- msgid "Configure specific product properties that should be synced to translations."
2570
  msgstr ""
2571
 
2572
- # 'value' => $this->woocommerce_wpml->settings['products_sync_date'],
2573
- # 'label' => __('Sync publishing date for translated products.', 'woocommerce-multilingual')
2574
- # ),
2575
 
2576
- msgid "Sync publishing date for translated products."
2577
  msgstr ""
2578
 
2579
- # 'value' => $this->woocommerce_wpml->settings['products_sync_order'],
2580
- # 'label' => __('Sync products and product taxonomies order.', 'woocommerce-multilingual')
2581
- # ),
2582
 
2583
- msgid "Sync products and product taxonomies order."
2584
  msgstr ""
2585
 
2586
- # 'file_sync' => array(
2587
- # 'heading' => __('Products Download Files', 'woocommerce-multilingual'),
2588
- # 'tip' => __( 'If you are using downloadable products, you can choose to have their paths
2589
 
2590
- msgid "Products Download Files"
2591
  msgstr ""
2592
 
2593
- # 'heading' => __('Products Download Files', 'woocommerce-multilingual'),
2594
- # 'tip' => __( 'If you are using downloadable products, you can choose to have their paths
2595
- # synchronized, or seperate for each language.', 'woocommerce-multilingual' ),
2596
 
2597
- msgid "If you are using downloadable products, you can choose to have their paths\n synchronized, or seperate for each language."
2598
  msgstr ""
2599
 
2600
- # 'value' => $this->woocommerce_wpml->settings['file_path_sync'],
2601
- # 'label_same' => __('Use the same files for translations', 'woocommerce-multilingual'),
2602
- # 'label_diff' => __('Add separate download files for translations', 'woocommerce-multilingual'),
2603
-
2604
- msgid "Use the same files for translations"
2605
  msgstr ""
2606
 
2607
- # 'label_same' => __('Use the same files for translations', 'woocommerce-multilingual'),
2608
- # 'label_diff' => __('Add separate download files for translations', 'woocommerce-multilingual'),
2609
  # ),
2610
 
2611
- msgid "Add separate download files for translations"
2612
  msgstr ""
2613
 
2614
- # 'nonce' => wp_nonce_field('wcml_save_settings_nonce', 'wcml_nonce', true, false),
2615
- # 'save_label' => __( 'Save changes', 'woocommerce-multilingual' ),
2616
- #
2617
 
2618
- msgid "Save changes"
2619
  msgstr ""
2620
 
2621
- # 'headers' => array(
2622
- # 'enable_disable' => __( 'Enable/disable', 'woocommerce-multilingual' ),
2623
- # 'currencies' => __( 'Currencies', 'woocommerce-multilingual' ),
2624
 
2625
- msgid "Enable/disable"
2626
  msgstr ""
2627
 
2628
- # 'enable_disable' => __( 'Enable/disable', 'woocommerce-multilingual' ),
2629
- # 'currencies' => __( 'Currencies', 'woocommerce-multilingual' ),
2630
- # ),
2631
 
2632
- msgid "Currencies"
2633
  msgstr ""
2634
 
2635
- # ),
2636
- # 'add_currency_button' => __( 'Add currency', 'woocommerce-multilingual' ),
2637
- # 'currencies_table' => array(
2638
 
2639
- msgid "Add currency"
2640
  msgstr ""
2641
 
2642
- # 'currencies_table' => array(
2643
- # 'head_currency' => __('Currency', 'woocommerce-multilingual'),
2644
- # 'head_rate' => __('Rate', 'woocommerce-multilingual'),
2645
 
2646
- msgid "Currency"
2647
  msgstr ""
2648
 
2649
- # 'head_currency' => __('Currency', 'woocommerce-multilingual'),
2650
- # 'head_rate' => __('Rate', 'woocommerce-multilingual'),
2651
- # 'default' => __( 'default', 'woocommerce-multilingual' ),
2652
 
2653
- msgid "Rate"
2654
  msgstr ""
2655
 
2656
- # 'head_rate' => __('Rate', 'woocommerce-multilingual'),
2657
- # 'default' => __( 'default', 'woocommerce-multilingual' ),
2658
- # 'edit' => __( 'Edit', 'woocommerce-multilingual' ),
2659
 
2660
- msgid "default"
2661
  msgstr ""
2662
 
2663
- # 'edit' => __( 'Edit', 'woocommerce-multilingual' ),
2664
- # 'default_currency' => __( 'Default currency', 'woocommerce-multilingual' ),
2665
- # 'default_cur_tip' => __( 'Switch to this currency when switching language in the front-end', 'woocommerce-multilingual' ),
2666
 
2667
- msgid "Default currency"
2668
  msgstr ""
2669
 
2670
- # 'default_currency' => __( 'Default currency', 'woocommerce-multilingual' ),
2671
- # 'default_cur_tip' => __( 'Switch to this currency when switching language in the front-end', 'woocommerce-multilingual' ),
2672
- # 'keep_currency' => __( 'Keep', 'woocommerce-multilingual' ),
2673
 
2674
- msgid "Switch to this currency when switching language in the front-end"
2675
  msgstr ""
2676
 
2677
- # 'default_cur_tip' => __( 'Switch to this currency when switching language in the front-end', 'woocommerce-multilingual' ),
2678
- # 'keep_currency' => __( 'Keep', 'woocommerce-multilingual' ),
2679
- # 'delete' => __( 'Delete', 'woocommerce-multilingual' ),
2680
 
2681
- msgid "Keep"
2682
  msgstr ""
2683
 
2684
- # 'keep_currency' => __( 'Keep', 'woocommerce-multilingual' ),
2685
- # 'delete' => __( 'Delete', 'woocommerce-multilingual' ),
2686
- # 'help_title' => __( 'Currencies to display for each language', 'woocommerce-multilingual' ),
2687
 
2688
- msgid "Delete"
2689
  msgstr ""
2690
 
2691
- # 'delete' => __( 'Delete', 'woocommerce-multilingual' ),
2692
- # 'help_title' => __( 'Currencies to display for each language', 'woocommerce-multilingual' ),
2693
- # 'enable_for' => __('Enable %s for %s', 'woocommerce-multilingual'),
2694
 
2695
- msgid "Currencies to display for each language"
2696
  msgstr ""
2697
 
2698
- # 'help_title' => __( 'Currencies to display for each language', 'woocommerce-multilingual' ),
2699
- # 'enable_for' => __('Enable %s for %s', 'woocommerce-multilingual'),
2700
- # 'disable_for' => __('Disable %s for %s', 'woocommerce-multilingual')
2701
 
2702
- msgid "Enable %s for %s"
2703
  msgstr ""
2704
 
2705
- # 'enable_for' => __('Enable %s for %s', 'woocommerce-multilingual'),
2706
- # 'disable_for' => __('Disable %s for %s', 'woocommerce-multilingual')
2707
- # )
2708
 
2709
- msgid "Disable %s for %s"
2710
  msgstr ""
2711
 
2712
- # 'wc_currencies' => $this->wc_currencies,
2713
- # 'positioned_price' => sprintf( __( ' (%s)', 'woocommerce-multilingual' ), $this->get_positioned_price( $this->wc_currency ) ) ,
2714
  #
2715
 
2716
- msgid " (%s)"
2717
  msgstr ""
2718
 
2719
  #
2720
- # 'wc_currency_empty_warn' => sprintf(__('The multi-currency mode cannot be enabled as a specific currency was not set. Go to the %sWooCommerce settings%s page and select the default currency for your store.',
2721
- # 'woocommerce-multilingual'), '<a href="' . admin_url('admin.php?page=wc-settings') . '">', '</a>'),
2722
 
2723
- msgid "The multi-currency mode cannot be enabled as a specific currency was not set. Go to the %sWooCommerce settings%s page and select the default currency for your store."
2724
  msgstr ""
2725
 
2726
- # 'label_mco_learn_url' => WCML_Links::generate_tracking_link( 'https://wpml.org/documentation/related-projects/woocommerce-multilingual/multi-currency-support-woocommerce/', 'multi-currency-support-woocommerce', 'documentation' ),
2727
- # 'label_mco_learn_txt' => __( 'Learn more', 'woocommerce-multilingual' ),
2728
- # 'update_currency_lang_nonce'=> wp_create_nonce( 'wcml_update_currency_lang' ),
2729
 
2730
- msgid "Learn more"
2731
  msgstr ""
2732
 
2733
- # 'checked' => $this->woocommerce_wpml->settings['display_custom_prices'] == 1,
2734
- # 'label' => __( 'Show only products with custom prices in secondary currencies', 'woocommerce-multilingual' ),
2735
- # 'tip' => __( 'When this option is on, when you switch to a secondary currency on the front end, only the products with custom prices in that currency are being displayed. Products with prices determined based on the exchange rate are hidden.', 'woocommerce-multilingual' )
2736
 
2737
- msgid "Show only products with custom prices in secondary currencies"
2738
  msgstr ""
2739
 
2740
- # 'label' => __( 'Show only products with custom prices in secondary currencies', 'woocommerce-multilingual' ),
2741
- # 'tip' => __( 'When this option is on, when you switch to a secondary currency on the front end, only the products with custom prices in that currency are being displayed. Products with prices determined based on the exchange rate are hidden.', 'woocommerce-multilingual' )
2742
- # ),
2743
 
2744
- msgid "When this option is on, when you switch to a secondary currency on the front end, only the products with custom prices in that currency are being displayed. Products with prices determined based on the exchange rate are hidden."
2745
  msgstr ""
2746
 
2747
- # 'submit' => __( 'Save changes', 'woocommerce-multilingual' ),
2748
- # 'navigate_warn' => __( 'The changes you made will be lost if you navigate away from this page.', 'woocommerce-multilingual' ),
2749
- # 'cur_lang_warn' => __( 'At least one currency must be enabled for this language!', 'woocommerce-multilingual' )
2750
 
2751
- msgid "The changes you made will be lost if you navigate away from this page."
2752
  msgstr ""
2753
 
2754
- # 'navigate_warn' => __( 'The changes you made will be lost if you navigate away from this page.', 'woocommerce-multilingual' ),
2755
- # 'cur_lang_warn' => __( 'At least one currency must be enabled for this language!', 'woocommerce-multilingual' )
2756
- #
2757
 
2758
- msgid "At least one currency must be enabled for this language!"
2759
  msgstr ""
2760
 
2761
- # 'headers' => array(
2762
- # 'main' => __('Currency switcher options', 'woocommerce-multilingual'),
2763
- # 'style' => __('Currency switcher style', 'woocommerce-multilingual'),
2764
 
2765
- msgid "Currency switcher options"
2766
  msgstr ""
2767
 
2768
- # 'main' => __('Currency switcher options', 'woocommerce-multilingual'),
2769
- # 'style' => __('Currency switcher style', 'woocommerce-multilingual'),
2770
- # 'order' => __( 'Currency order', 'woocommerce-multilingual' ),
2771
 
2772
- msgid "Currency switcher style"
2773
  msgstr ""
2774
 
2775
- # 'style' => __('Currency switcher style', 'woocommerce-multilingual'),
2776
- # 'order' => __( 'Currency order', 'woocommerce-multilingual' ),
2777
- # 'parameters' => __( 'Available parameters', 'woocommerce-multilingual' ),
2778
 
2779
- msgid "Currency order"
2780
  msgstr ""
2781
 
2782
- # 'order' => __( 'Currency order', 'woocommerce-multilingual' ),
2783
- # 'parameters' => __( 'Available parameters', 'woocommerce-multilingual' ),
2784
- # 'parameters_list' => '%code%, %symbol%, %name%, %subtotal%',
2785
 
2786
- msgid "Available parameters"
2787
  msgstr ""
2788
 
2789
- # 'parameters_list' => '%code%, %symbol%, %name%, %subtotal%',
2790
- # 'template' => __( 'Template for currency switcher', 'woocommerce-multilingual' ),
2791
- # 'visibility' => __('Visibility', 'woocommerce-multilingual')
2792
 
2793
- msgid "Template for currency switcher"
2794
  msgstr ""
2795
 
2796
- # 'template' => __( 'Template for currency switcher', 'woocommerce-multilingual' ),
2797
- # 'visibility' => __('Visibility', 'woocommerce-multilingual')
2798
- # ),
2799
 
2800
- msgid "Visibility"
2801
  msgstr ""
2802
 
2803
- # 'preview' => $this->woocommerce_wpml->multi_currency->currency_switcher->wcml_currency_switcher( array('echo' => false) ),
2804
- # 'preview_text' => __( 'Currency switcher preview', 'woocommerce-multilingual' ),
2805
- # 'style' => isset($this->woocommerce_wpml->settings['currency_switcher_style']) ? $this->woocommerce_wpml->settings['currency_switcher_style'] : false,
2806
 
2807
- msgid "Currency switcher preview"
2808
  msgstr ""
2809
 
2810
- # 'options' => array(
2811
- # 'dropdown' => __('Drop-down menu', 'woocommerce-multilingual'),
2812
- # 'list' => __('List of currencies', 'woocommerce-multilingual'),
2813
 
2814
- msgid "Drop-down menu"
2815
  msgstr ""
2816
 
2817
- # 'dropdown' => __('Drop-down menu', 'woocommerce-multilingual'),
2818
- # 'list' => __('List of currencies', 'woocommerce-multilingual'),
2819
- # 'vertical' => __('Vertical', 'woocommerce-multilingual'),
2820
 
2821
- msgid "List of currencies"
2822
  msgstr ""
2823
 
2824
- # 'list' => __('List of currencies', 'woocommerce-multilingual'),
2825
- # 'vertical' => __('Vertical', 'woocommerce-multilingual'),
2826
- # 'horizontal' => __('Horizontal', 'woocommerce-multilingual'),
2827
 
2828
- msgid "Vertical"
2829
  msgstr ""
2830
 
2831
- # 'vertical' => __('Vertical', 'woocommerce-multilingual'),
2832
- # 'horizontal' => __('Horizontal', 'woocommerce-multilingual'),
2833
- # 'allowed_tags' => __('Allowed HTML tags: <img> <span> <u> <strong> <em>', 'woocommerce-multilingual')
2834
 
2835
- msgid "Horizontal"
2836
- msgstr ""
2837
-
2838
- # 'horizontal' => __('Horizontal', 'woocommerce-multilingual'),
2839
- # 'allowed_tags' => __('Allowed HTML tags: <img> <span> <u> <strong> <em>', 'woocommerce-multilingual')
2840
- # ),
2841
-
2842
- msgid "Allowed HTML tags: <img> <span> <u> <strong> <em>"
2843
- msgstr ""
2844
-
2845
- # 'order_nonce' => wp_create_nonce( 'set_currencies_order_nonce' ),
2846
- # 'order_tip' => __( 'Drag the currencies to change their order', 'woocommerce-multilingual' ),
2847
- # 'parameters_tip' => __( '%name%, %symbol%, %code%', 'woocommerce-multilingual' ),
2848
-
2849
- msgid "Drag the currencies to change their order"
2850
- msgstr ""
2851
-
2852
- # 'order_tip' => __( 'Drag the currencies to change their order', 'woocommerce-multilingual' ),
2853
- # 'parameters_tip' => __( '%name%, %symbol%, %code%', 'woocommerce-multilingual' ),
2854
- # 'template' => isset($this->woocommerce_wpml->settings['wcml_curr_template']) ?
2855
-
2856
- msgid "%name%, %symbol%, %code%"
2857
- msgstr ""
2858
-
2859
- # $this->woocommerce_wpml->settings['wcml_curr_template'] : '',
2860
- # 'template_tip' => __( 'Default: %name% (%symbol%) - %code%', 'woocommerce-multilingual' ),
2861
- # 'template_default' => '%name% (%symbol%) - %code%',
2862
-
2863
- msgid "Default: %name% (%symbol%) - %code%"
2864
- msgstr ""
2865
-
2866
- # 'template_default' => '%name% (%symbol%) - %code%',
2867
- # 'visibility_label' => __('Show a currency selector on the product page template', 'woocommerce-multilingual'),
2868
- # 'visibility_on' => isset($this->woocommerce_wpml->settings['currency_switcher_product_visibility']) ?
2869
-
2870
- msgid "Show a currency selector on the product page template"
2871
- msgstr ""
2872
-
2873
- # $this->custom_prices_fields = apply_filters( 'wcml_custom_prices_fields', array( '_regular_price', '_sale_price' ), $product_id );
2874
- # $this->custom_prices_fields_labels = apply_filters( 'wcml_custom_prices_fields_labels', array( '_regular_price' => __( 'Regular Price', 'woocommerce-multilingual' ), '_sale_price' => __( 'Sale Price', 'woocommerce-multilingual' ) ), $product_id );
2875
- #
2876
-
2877
- msgid "Regular Price"
2878
- msgstr ""
2879
-
2880
- # $this->custom_prices_fields = apply_filters( 'wcml_custom_prices_fields', array( '_regular_price', '_sale_price' ), $product_id );
2881
- # $this->custom_prices_fields_labels = apply_filters( 'wcml_custom_prices_fields_labels', array( '_regular_price' => __( 'Regular Price', 'woocommerce-multilingual' ), '_sale_price' => __( 'Sale Price', 'woocommerce-multilingual' ) ), $product_id );
2882
- #
2883
-
2884
- msgid "Sale Price"
2885
- msgstr ""
2886
-
2887
- # 'strings' => apply_filters( 'wcml_custom_prices_strings', array(
2888
- # 'not_set' => sprintf( __( 'Multi-currency is enabled but no secondary currencies have been set. %sAdd secondary currencies%s.',
2889
- # 'woocommerce-multilingual' ), '<a href="' . admin_url('admin.php?page=wpml-wcml&tab=multi-currency') . '">', '</a>' ),
2890
-
2891
- msgid "Multi-currency is enabled but no secondary currencies have been set. %sAdd secondary currencies%s."
2892
- msgstr ""
2893
-
2894
- # 'woocommerce-multilingual' ), '<a href="' . admin_url('admin.php?page=wpml-wcml&tab=multi-currency') . '">', '</a>' ),
2895
- # 'calc_auto' => __( 'Calculate prices in other currencies automatically', 'woocommerce-multilingual' ),
2896
- # 'see_prices' => __( 'Click to see the prices in the other currencies as they are currently shown on the front end.', 'woocommerce-multilingual' ),
2897
-
2898
- msgid "Calculate prices in other currencies automatically"
2899
- msgstr ""
2900
-
2901
- # 'calc_auto' => __( 'Calculate prices in other currencies automatically', 'woocommerce-multilingual' ),
2902
- # 'see_prices' => __( 'Click to see the prices in the other currencies as they are currently shown on the front end.', 'woocommerce-multilingual' ),
2903
- # 'show' => __( 'Show', 'woocommerce-multilingual' ),
2904
-
2905
- msgid "Click to see the prices in the other currencies as they are currently shown on the front end."
2906
- msgstr ""
2907
-
2908
- # 'see_prices' => __( 'Click to see the prices in the other currencies as they are currently shown on the front end.', 'woocommerce-multilingual' ),
2909
- # 'show' => __( 'Show', 'woocommerce-multilingual' ),
2910
- # 'hide' => __( 'Hide', 'woocommerce-multilingual' ),
2911
-
2912
- msgid "Show"
2913
  msgstr ""
2914
 
2915
  # 'hide' => __( 'Hide', 'woocommerce-multilingual' ),
@@ -2989,326 +3075,270 @@ msgstr ""
2989
  msgid "Please enter in a value less than the regular price"
2990
  msgstr ""
2991
 
2992
- # 'form' => array(
2993
- # 'select' => __( 'Select currency', 'woocommerce-multilingual' ),
2994
- # 'rate' => array(
2995
 
2996
- msgid "Select currency"
2997
  msgstr ""
2998
 
2999
- # 'rate' => array(
3000
- # 'label' => __( 'Exchange Rate', 'woocommerce-multilingual' ),
3001
- # 'only_numeric' => __( 'Only numeric', 'woocommerce-multilingual' ),
3002
 
3003
- msgid "Exchange Rate"
3004
  msgstr ""
3005
 
3006
- # 'label' => __( 'Exchange Rate', 'woocommerce-multilingual' ),
3007
- # 'only_numeric' => __( 'Only numeric', 'woocommerce-multilingual' ),
3008
- # 'set_on' => empty($this->args['currency']['updated'] ) ? '' :
3009
 
3010
- msgid "Only numeric"
3011
  msgstr ""
3012
 
3013
- # 'set_on' => empty($this->args['currency']['updated'] ) ? '' :
3014
- # sprintf( __( 'Set on %s', 'woocommerce-multilingual' ),
3015
- # date( 'F j, Y, H:i', strtotime( $this->args['currency']['updated'] ) ) )
3016
 
3017
- msgid "Set on %s"
3018
  msgstr ""
3019
 
3020
- # 'preview' => array(
3021
- # 'label' => __( 'Currency Preview', 'woocommerce-multilingual' ),
3022
- # 'value' => $this->get_price_preview( $current_currency )
3023
 
3024
- msgid "Currency Preview"
3025
  msgstr ""
3026
 
3027
- # 'position' => array(
3028
- # 'label' => __( 'Currency Position', 'woocommerce-multilingual' ),
3029
- # 'left' => __( 'Left', 'woocommerce-multilingual' ),
3030
 
3031
- msgid "Currency Position"
3032
  msgstr ""
3033
 
3034
- # 'label' => __( 'Currency Position', 'woocommerce-multilingual' ),
3035
- # 'left' => __( 'Left', 'woocommerce-multilingual' ),
3036
- # 'right' => __( 'Right', 'woocommerce-multilingual' ),
3037
 
3038
- msgid "Left"
3039
  msgstr ""
3040
 
3041
- # 'left' => __( 'Left', 'woocommerce-multilingual' ),
3042
- # 'right' => __( 'Right', 'woocommerce-multilingual' ),
3043
- # 'left_space' => __( 'Left with space', 'woocommerce-multilingual' ),
3044
 
3045
- msgid "Right"
3046
  msgstr ""
3047
 
3048
- # 'right' => __( 'Right', 'woocommerce-multilingual' ),
3049
- # 'left_space' => __( 'Left with space', 'woocommerce-multilingual' ),
3050
- # 'right_space' => __( 'Right with space', 'woocommerce-multilingual' ),
3051
 
3052
- msgid "Left with space"
3053
  msgstr ""
3054
 
3055
- # 'left_space' => __( 'Left with space', 'woocommerce-multilingual' ),
3056
- # 'right_space' => __( 'Right with space', 'woocommerce-multilingual' ),
3057
- # ),
3058
 
3059
- msgid "Right with space"
3060
  msgstr ""
3061
 
3062
- # 'thousand_sep' => array(
3063
- # 'label' => __( 'Thousand Separator', 'woocommerce-multilingual' )
3064
- # ),
3065
 
3066
- msgid "Thousand Separator"
3067
  msgstr ""
3068
 
3069
- # 'decimal_sep' => array(
3070
- # 'label' =>__( 'Decimal Separator', 'woocommerce-multilingual' )
3071
- # ),
3072
 
3073
- msgid "Decimal Separator"
3074
  msgstr ""
3075
 
3076
- # 'num_decimals' => array(
3077
- # 'label' => __( 'Number of Decimals', 'woocommerce-multilingual' ),
3078
- # 'only_numeric' => __( 'Only numeric', 'woocommerce-multilingual' )
3079
 
3080
- msgid "Number of Decimals"
3081
  msgstr ""
3082
 
3083
- # 'rounding' => array(
3084
- # 'label' => __( 'Rounding to the nearest integer', 'woocommerce-multilingual' ),
3085
- # 'disabled' => __( 'Disabled', 'woocommerce-multilingual' ),
3086
 
3087
- msgid "Rounding to the nearest integer"
3088
  msgstr ""
3089
 
3090
- # 'label' => __( 'Rounding to the nearest integer', 'woocommerce-multilingual' ),
3091
- # 'disabled' => __( 'Disabled', 'woocommerce-multilingual' ),
3092
- # 'up' => __( 'Up', 'woocommerce-multilingual' ),
3093
 
3094
- msgid "Disabled"
3095
  msgstr ""
3096
 
3097
- # 'disabled' => __( 'Disabled', 'woocommerce-multilingual' ),
3098
- # 'up' => __( 'Up', 'woocommerce-multilingual' ),
3099
- # 'down' => __( 'Down', 'woocommerce-multilingual' ),
3100
 
3101
- msgid "Up"
3102
  msgstr ""
3103
 
3104
- # 'up' => __( 'Up', 'woocommerce-multilingual' ),
3105
- # 'down' => __( 'Down', 'woocommerce-multilingual' ),
3106
- # 'nearest' => __( 'Nearest', 'woocommerce-multilingual' ),
3107
 
3108
- msgid "Down"
3109
  msgstr ""
3110
 
3111
- # 'down' => __( 'Down', 'woocommerce-multilingual' ),
3112
- # 'nearest' => __( 'Nearest', 'woocommerce-multilingual' ),
3113
- # 'increment' => __( 'Increment for nearest integer', 'woocommerce-multilingual' ),
3114
 
3115
- msgid "Nearest"
3116
  msgstr ""
3117
 
3118
- # 'nearest' => __( 'Nearest', 'woocommerce-multilingual' ),
3119
- # 'increment' => __( 'Increment for nearest integer', 'woocommerce-multilingual' ),
3120
- #
3121
 
3122
- msgid "Increment for nearest integer"
3123
  msgstr ""
3124
 
 
 
3125
  #
3126
- # 'rounding_tooltip' => sprintf( __("Round the converted price to the closest integer. %se.g. 15.78 becomes 16.00", 'woocommerce-multilingual'), '<br />' ),
3127
- # 'increment_tooltip' => sprintf( __('The resulting price will be an increment of this value after initial rounding.%se.g.:', 'woocommerce-multilingual'), '<br>' ) . '<br />' .
3128
 
3129
- msgid "Round the converted price to the closest integer. %se.g. 15.78 becomes 16.00"
3130
  msgstr ""
3131
 
3132
- # 'rounding_tooltip' => sprintf( __("Round the converted price to the closest integer. %se.g. 15.78 becomes 16.00", 'woocommerce-multilingual'), '<br />' ),
3133
- # 'increment_tooltip' => sprintf( __('The resulting price will be an increment of this value after initial rounding.%se.g.:', 'woocommerce-multilingual'), '<br>' ) . '<br />' .
3134
- # __('1454.07 &raquo; 1454 when set to 1', 'woocommerce-multilingual') . '<br />' .
3135
 
3136
- msgid "The resulting price will be an increment of this value after initial rounding.%se.g.:"
3137
  msgstr ""
3138
 
3139
- # 'increment_tooltip' => sprintf( __('The resulting price will be an increment of this value after initial rounding.%se.g.:', 'woocommerce-multilingual'), '<br>' ) . '<br />' .
3140
- # __('1454.07 &raquo; 1454 when set to 1', 'woocommerce-multilingual') . '<br />' .
3141
- # __('1454.07 &raquo; 1450 when set to 10', 'woocommerce-multilingual') . '<br />'.
3142
 
3143
- msgid "1454.07 &raquo; 1454 when set to 1"
3144
  msgstr ""
3145
 
3146
- # __('1454.07 &raquo; 1454 when set to 1', 'woocommerce-multilingual') . '<br />' .
3147
- # __('1454.07 &raquo; 1450 when set to 10', 'woocommerce-multilingual') . '<br />'.
3148
- # __('1454.07 &raquo; 1500 when set to 100', 'woocommerce-multilingual') . '<br />',
3149
 
3150
- msgid "1454.07 &raquo; 1450 when set to 10"
3151
  msgstr ""
3152
 
3153
- # __('1454.07 &raquo; 1450 when set to 10', 'woocommerce-multilingual') . '<br />'.
3154
- # __('1454.07 &raquo; 1500 when set to 100', 'woocommerce-multilingual') . '<br />',
3155
- # 'autosubtract_tooltip'=> __('The value to be subtracted from the amount obtained previously.', 'woocommerce-multilingual') . '<br /><br />' .
3156
-
3157
- msgid "1454.07 &raquo; 1500 when set to 100"
3158
- msgstr ""
3159
-
3160
- # __('1454.07 &raquo; 1500 when set to 100', 'woocommerce-multilingual') . '<br />',
3161
- # 'autosubtract_tooltip'=> __('The value to be subtracted from the amount obtained previously.', 'woocommerce-multilingual') . '<br /><br />' .
3162
- # __('For 1454.07, when the increment for the nearest integer is 100 and the auto-subtract amount is 1, the resulting amount is 1499.', 'woocommerce-multilingual')
3163
-
3164
- msgid "The value to be subtracted from the amount obtained previously."
3165
- msgstr ""
3166
-
3167
- # 'autosubtract_tooltip'=> __('The value to be subtracted from the amount obtained previously.', 'woocommerce-multilingual') . '<br /><br />' .
3168
- # __('For 1454.07, when the increment for the nearest integer is 100 and the auto-subtract amount is 1, the resulting amount is 1499.', 'woocommerce-multilingual')
3169
- # ),
3170
-
3171
- msgid "For 1454.07, when the increment for the nearest integer is 100 and the auto-subtract amount is 1, the resulting amount is 1499."
3172
- msgstr ""
3173
-
3174
- # 'autosubtract' => array(
3175
- # 'label' => __( 'Autosubtract amount', 'woocommerce-multilingual' ),
3176
- # 'only_numeric' => __( 'Only numeric', 'woocommerce-multilingual' )
3177
-
3178
- msgid "Autosubtract amount"
3179
- msgstr ""
3180
-
3181
- # 'currency_converter_url' => 'https://www.google.com/finance/converter?a=1&from=%s&to=%s',
3182
- # 'currency_converter_label' => __('Get exchange rates', 'woocommerce-multilingual'),
3183
- # 'currency_converter_title' => __('Check real-time exchange rates, online, from Google Finance Currency Converter', 'woocommerce-multilingual'),
3184
-
3185
- msgid "Get exchange rates"
3186
- msgstr ""
3187
-
3188
- # 'currency_converter_label' => __('Get exchange rates', 'woocommerce-multilingual'),
3189
- # 'currency_converter_title' => __('Check real-time exchange rates, online, from Google Finance Currency Converter', 'woocommerce-multilingual'),
3190
- #
3191
-
3192
- msgid "Check real-time exchange rates, online, from Google Finance Currency Converter"
3193
- msgstr ""
3194
-
3195
- # 'strings' => array(
3196
- # 'label' => __( 'Translatable?', 'woocommerce-multilingual' ),
3197
- # 'description' => __( 'Enable this if you want to translate attribute values with Woocommerce Multilingual', 'woocommerce-multilingual' ),
3198
-
3199
- msgid "Translatable?"
3200
- msgstr ""
3201
-
3202
- # 'label' => __( 'Translatable?', 'woocommerce-multilingual' ),
3203
- # 'description' => __( 'Enable this if you want to translate attribute values with Woocommerce Multilingual', 'woocommerce-multilingual' ),
3204
- # 'notice' => __( 'Existing translations and variations associated will be deleted.', 'woocommerce-multilingual' )
3205
-
3206
- msgid "Enable this if you want to translate attribute values with Woocommerce Multilingual"
3207
- msgstr ""
3208
-
3209
- # 'description' => __( 'Enable this if you want to translate attribute values with Woocommerce Multilingual', 'woocommerce-multilingual' ),
3210
- # 'notice' => __( 'Existing translations and variations associated will be deleted.', 'woocommerce-multilingual' )
3211
- # )
3212
 
3213
- msgid "Existing translations and variations associated will be deleted."
3214
  msgstr ""
3215
 
3216
- # 'strings' => array(
3217
- # 'use_custom' => __( 'Use custom settings for translations download files', 'woocommerce-multilingual' ),
3218
- # 'use_same' => __( 'Use the same files for translations', 'woocommerce-multilingual' ),
3219
 
3220
- msgid "Use custom settings for translations download files"
3221
  msgstr ""
3222
 
3223
- # 'title' => __('WooCommerce Multilingual', 'woocommerce-multilingual'),
3224
- # 'required'=> __('Required plugins', 'woocommerce-multilingual'),
3225
- # 'plugins'=> __('Plugins Status', 'woocommerce-multilingual'),
3226
 
3227
- msgid "Required plugins"
3228
  msgstr ""
3229
 
3230
- # 'depends'=> __('WooCommerce Multilingual depends on several plugins to work. If any required plugin is missing, you should install and activate it.', 'woocommerce-multilingual'),
3231
- # 'old_wpml_link'=> sprintf( __( 'WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href="%s">WPML</a> versions prior 2.0.5.', 'woocommerce-multilingual' ), WCML_Links::generate_tracking_link( 'https://wpml.org/' ) ),
3232
- # 'update_wpml'=> __( 'Update WPML', 'woocommerce-multilingual' ),
3233
 
3234
- msgid "WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href=\"%s\">WPML</a> versions prior 2.0.5."
3235
  msgstr ""
3236
 
3237
- # 'old_wpml_link'=> sprintf( __( 'WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href="%s">WPML</a> versions prior 2.0.5.', 'woocommerce-multilingual' ), WCML_Links::generate_tracking_link( 'https://wpml.org/' ) ),
3238
- # 'update_wpml'=> __( 'Update WPML', 'woocommerce-multilingual' ),
3239
- # 'upgrade_wpml'=> __( 'Upgrade WPML', 'woocommerce-multilingual' ),
3240
 
3241
- msgid "Update WPML"
3242
  msgstr ""
3243
 
3244
- # 'update_wpml'=> __( 'Update WPML', 'woocommerce-multilingual' ),
3245
- # 'upgrade_wpml'=> __( 'Upgrade WPML', 'woocommerce-multilingual' ),
3246
- # 'get_wpml'=> __( 'Get WPML', 'woocommerce-multilingual' ),
3247
 
3248
- msgid "Upgrade WPML"
3249
  msgstr ""
3250
 
3251
- # 'upgrade_wpml'=> __( 'Upgrade WPML', 'woocommerce-multilingual' ),
3252
- # 'get_wpml'=> __( 'Get WPML', 'woocommerce-multilingual' ),
3253
- # 'get_wpml_media'=> __( 'Get WPML Media', 'woocommerce-multilingual' ),
3254
 
3255
- msgid "Get WPML"
3256
  msgstr ""
3257
 
3258
- # 'get_wpml'=> __( 'Get WPML', 'woocommerce-multilingual' ),
3259
- # 'get_wpml_media'=> __( 'Get WPML Media', 'woocommerce-multilingual' ),
3260
- # 'get_wpml_tm'=> __( 'Get WPML Translation Management', 'woocommerce-multilingual' ),
3261
 
3262
- msgid "Get WPML Media"
3263
  msgstr ""
3264
 
3265
- # 'get_wpml_media'=> __( 'Get WPML Media', 'woocommerce-multilingual' ),
3266
- # 'get_wpml_tm'=> __( 'Get WPML Translation Management', 'woocommerce-multilingual' ),
3267
- # 'get_wpml_st'=> __( 'Get WPML String Translation', 'woocommerce-multilingual' ),
3268
 
3269
- msgid "Get WPML Translation Management"
3270
  msgstr ""
3271
 
3272
- # 'get_wpml_tm'=> __( 'Get WPML Translation Management', 'woocommerce-multilingual' ),
3273
- # 'get_wpml_st'=> __( 'Get WPML String Translation', 'woocommerce-multilingual' ),
3274
- # 'new_design_wpml_link'=> sprintf( __( 'You are using WooCommerce Multilingual %s. This version includes an important UI redesign for the configuration screens and it requires <a href="%s">WPML %s</a> or higher. Everything still works on the front end now but, in order to configure options for WooCommerce Multilingual, you need to upgrade WPML.', 'woocommerce-multilingual' ), WCML_VERSION, WCML_Links::generate_tracking_link( 'https://wpml.org/' ), '3.4' ),
3275
 
3276
- msgid "Get WPML String Translation"
3277
  msgstr ""
3278
 
3279
- # 'get_wpml_st'=> __( 'Get WPML String Translation', 'woocommerce-multilingual' ),
3280
- # 'new_design_wpml_link'=> sprintf( __( 'You are using WooCommerce Multilingual %s. This version includes an important UI redesign for the configuration screens and it requires <a href="%s">WPML %s</a> or higher. Everything still works on the front end now but, in order to configure options for WooCommerce Multilingual, you need to upgrade WPML.', 'woocommerce-multilingual' ), WCML_VERSION, WCML_Links::generate_tracking_link( 'https://wpml.org/' ), '3.4' ),
3281
- # 'wpml' => '<strong>WPML</strong>',
3282
 
3283
- msgid "You are using WooCommerce Multilingual %s. This version includes an important UI redesign for the configuration screens and it requires <a href=\"%s\">WPML %s</a> or higher. Everything still works on the front end now but, in order to configure options for WooCommerce Multilingual, you need to upgrade WPML."
3284
  msgstr ""
3285
 
3286
- # 'not_setup' => __( '%s is not set up.', 'woocommerce-multilingual' ),
3287
- # 'not_inst' => __( '%s is either not installed or not active.', 'woocommerce-multilingual' ),
3288
- # 'wpml_not_inst' => sprintf( __( '%s is either not installed or not active.', 'woocommerce-multilingual' ),'<strong><a title="' . esc_attr__('The WordPress Multilingual Plugin', 'woocommerce-multilingual') .'" href="' . WCML_Links::generate_tracking_link( 'https://wpml.org/' ) . '">WPML</a></strong>' ),
3289
 
3290
- msgid "%s is either not installed or not active."
3291
  msgstr ""
3292
 
3293
- # 'wpml_not_inst' => sprintf( __( '%s is either not installed or not active.', 'woocommerce-multilingual' ),'<strong><a title="' . esc_attr__('The WordPress Multilingual Plugin', 'woocommerce-multilingual') .'" href="' . WCML_Links::generate_tracking_link( 'https://wpml.org/' ) . '">WPML</a></strong>' ),
3294
- # 'old_wc' => sprintf( __( '%1$s is installed, but with incorrect version. You need %1$s %2$s or higher. ', 'woocommerce-multilingual' ), '<strong>WooCommerce</strong>', '2.0' ),
3295
- # 'download_wc' => __( 'Download WooCommerce', 'woocommerce-multilingual' ),
3296
 
3297
- msgid "%1$s is installed, but with incorrect version. You need %1$s %2$s or higher. "
3298
  msgstr ""
3299
 
3300
- # 'old_wc' => sprintf( __( '%1$s is installed, but with incorrect version. You need %1$s %2$s or higher. ', 'woocommerce-multilingual' ), '<strong>WooCommerce</strong>', '2.0' ),
3301
- # 'download_wc' => __( 'Download WooCommerce', 'woocommerce-multilingual' ),
3302
- # )
3303
 
3304
- msgid "Download WooCommerce"
3305
  msgstr ""
3306
 
3307
- # 'not_inst' => __( '%s is either not installed or not active.', 'woocommerce-multilingual' ),
3308
- # 'wpml_not_inst' => sprintf( __( '%s is either not installed or not active.', 'woocommerce-multilingual' ),'<strong><a title="' . esc_attr__('The WordPress Multilingual Plugin', 'woocommerce-multilingual') .'" href="' . WCML_Links::generate_tracking_link( 'https://wpml.org/' ) . '">WPML</a></strong>' ),
3309
- # 'old_wc' => sprintf( __( '%1$s is installed, but with incorrect version. You need %1$s %2$s or higher. ', 'woocommerce-multilingual' ), '<strong>WooCommerce</strong>', '2.0' ),
3310
 
3311
- msgid "The WordPress Multilingual Plugin"
3312
  msgstr ""
3313
 
3314
  # 'troubl' => __( 'Troubleshooting', 'woocommerce-multilingual' ),
@@ -3376,296 +3406,784 @@ msgstr ""
3376
 
3377
  # 'dup_terms' => __( 'Duplicate terms ( please select attribute ):', 'woocommerce-multilingual' ),
3378
  # 'none' => __( 'none', 'woocommerce-multilingual' ),
3379
- # 'start' => __( 'Start', 'woocommerce-multilingual' )
3380
 
3381
  msgid "none"
3382
  msgstr ""
3383
 
3384
  # 'none' => __( 'none', 'woocommerce-multilingual' ),
3385
- # 'start' => __( 'Start', 'woocommerce-multilingual' )
3386
- # ),
3387
 
3388
  msgid "Start"
3389
  msgstr ""
3390
 
3391
- # <p>
3392
- # <?php printf(__("You've successfully installed %sWooCommerce Multilingual%s. Would you like to see a quick overview?", 'woocommerce-multilingual'), '<strong>', '</strong>'); ?>
3393
- # </p>
3394
 
3395
- msgid "You've successfully installed %sWooCommerce Multilingual%s. Would you like to see a quick overview?"
3396
  msgstr ""
3397
 
3398
- # <a class="button-primary align-right" href="<?php echo WCML_Links::generate_tracking_link('https://wpml.org/documentation/related-projects/woocommerce-multilingual/','woocommerce-multilingual','documentation'); ?>" target="_blank">
3399
- # <?php _e('Learn how to turn your e-commerce site multilingual', 'woocommerce-multilingual') ?>
3400
- # </a>
3401
 
3402
- msgid "Learn how to turn your e-commerce site multilingual"
3403
  msgstr ""
3404
 
3405
- # if ( !isset($active_languages[$lang]) && $lang != 'all' ) {
3406
- # throw new WC_API_Exception( '404', sprintf( __( 'Invalid language parameter: %s' ), $lang ), '404' );
3407
- # }
3408
 
3409
- msgid "Invalid language parameter: %s"
3410
  msgstr ""
3411
 
3412
- # if( empty($trid) ){
3413
- # throw new WC_API_Exception( '404', sprintf( __( 'Source product id not found: %s' ), $data['translation_of'] ), '404' );
3414
- # }
3415
 
3416
- msgid "Source product id not found: %s"
3417
  msgstr ""
3418
 
3419
- # $slug = $this->get_woocommerce_product_base();
3420
- # $return['name'] = __('Product Base', 'woocommerce-multilingual');
3421
- # break;
3422
 
3423
- msgid "Product Base"
3424
  msgstr ""
3425
 
3426
- # $slug = !empty( $this->wc_permalinks['tag_base'] ) ? trim( $this->wc_permalinks['tag_base'], '/' ) : 'product-tag';
3427
- # $return['name'] = __('Product Tag Base', 'woocommerce-multilingual');
3428
- # break;
3429
 
3430
- msgid "Product Tag Base"
3431
  msgstr ""
3432
 
3433
- # $slug = !empty( $this->wc_permalinks['category_base'] ) ? trim( $this->wc_permalinks['category_base'], '/' ) : 'product-category';
3434
- # $return['name'] = __('Product Category Base', 'woocommerce-multilingual');
3435
- # break;
3436
 
3437
- msgid "Product Category Base"
3438
  msgstr ""
3439
 
3440
- # $slug = trim( $this->wc_permalinks['attribute_base'], '/' );
3441
- # $return['name'] = __('Product Attribute Base', 'woocommerce-multilingual');
3442
- # break;
3443
 
3444
- msgid "Product Attribute Base"
3445
  msgstr ""
3446
 
3447
- # case 'attribute_slug':
3448
- # $return['name'] = __('Attribute Slug', 'woocommerce-multilingual');
3449
- # $string_id = icl_get_string_id( $slug, $this->url_strings_context(), $this->url_string_name( $base, $slug ) );
3450
 
3451
- msgid "Attribute Slug"
3452
  msgstr ""
3453
 
3454
- # $this->default_product_tag_base = 'product-tag';
3455
- # $this->default_product_category_gettext_base = _x( 'product-category', 'slug', 'woocommerce' );
3456
- # $this->default_product_tag_gettext_base = _x( 'product-tag', 'slug', 'woocommerce' );
3457
 
3458
- msgctxt "slug"
3459
- msgid "product-category"
3460
  msgstr ""
3461
 
3462
- # $this->default_product_category_gettext_base = _x( 'product-category', 'slug', 'woocommerce' );
3463
- # $this->default_product_tag_gettext_base = _x( 'product-tag', 'slug', 'woocommerce' );
3464
- #
3465
 
3466
- msgctxt "slug"
3467
- msgid "product-tag"
3468
  msgstr ""
3469
 
3470
- # 'name' => 'language',
3471
- # 'label' => __( 'Language', 'woo_ce' ),
3472
- # 'default' => 1
3473
 
3474
- msgid "Language"
3475
  msgstr ""
3476
 
3477
- # 'name' => 'translation_of',
3478
- # 'label' => __( 'Translation of', 'woo_ce' ),
3479
- # 'default' => 1
3480
 
3481
- msgid "Translation of"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3482
  msgstr ""
3483
 
3484
- #
3485
- # $composite_section = new WPML_Editor_UI_Field_Section( __( 'Composite Products ( Components )', 'woocommerce-multilingual' ) );
3486
- # end( $composite_data );
3487
 
3488
- msgid "Composite Products ( Components )"
3489
  msgstr ""
3490
 
3491
- # $group->add_field( $composite_field );
3492
- # $composite_field = new WPML_Editor_UI_Single_Line_Field( 'composite_'.$component_id.'_description' , __( 'Description', 'woocommerce-multilingual' ), $data, false );
3493
- # $group->add_field( $composite_field );
3494
 
3495
- msgid "Description"
3496
  msgstr ""
3497
 
3498
- #
3499
- # $composite_scenarios = new WPML_Editor_UI_Field_Section( __( 'Composite Products ( Scenarios )', 'woocommerce-multilingual' ) );
3500
- # end( $composite_scenarios_meta );
3501
 
3502
- msgid "Composite Products ( Scenarios )"
3503
  msgstr ""
3504
 
3505
- # if( $this->is_subscriptions_product( $product_id ) || $this->new_subscription ){
3506
- # $labels[ '_regular_price' ] = __( 'Subscription Price', 'woocommerce-multilingual' );
3507
- # $labels[ '_subscription_sign_up_fee' ] = __( 'Sign-up Fee', 'woocommerce-multilingual' );
3508
 
3509
- msgid "Subscription Price"
3510
  msgstr ""
3511
 
3512
- # $labels[ '_regular_price' ] = __( 'Subscription Price', 'woocommerce-multilingual' );
3513
- # $labels[ '_subscription_sign_up_fee' ] = __( 'Sign-up Fee', 'woocommerce-multilingual' );
3514
- # }
3515
 
3516
- msgid "Sign-up Fee"
3517
  msgstr ""
3518
 
3519
- #
3520
- # $bundles_section = new WPML_Editor_UI_Field_Section( __( 'Product Bundles', 'woocommerce-multilingual' ) );
3521
- # end( $product_bundles );
3522
 
3523
- msgid "Product Bundles"
3524
  msgstr ""
3525
 
3526
- # 'label' => get_woocommerce_currency_symbol( $currency_code ),
3527
- # 'description' => __( 'One-off cost for the booking as a whole.', 'woocommerce-bookings' ),
3528
- # 'value' => get_post_meta( $post_id, '_wc_booking_cost_' . $currency_code, true ),
3529
 
3530
- msgid "One-off cost for the booking as a whole."
3531
  msgstr ""
3532
 
3533
- # 'label' => get_woocommerce_currency_symbol( $currency_code ),
3534
- # 'description' => __( 'This is the cost per block booked. All other costs (for resources and persons) are added to this.', 'woocommerce-bookings' ),
3535
- # 'value' => get_post_meta( $post_id, '_wc_booking_base_cost_' . $currency_code, true ),
3536
 
3537
- msgid "This is the cost per block booked. All other costs (for resources and persons) are added to this."
3538
  msgstr ""
3539
 
3540
- # 'label' => get_woocommerce_currency_symbol( $currency_code ),
3541
- # 'description' => __( 'The cost is displayed to the user on the frontend. Leave blank to have it calculated for you. If a booking has varying costs, this will be prefixed with the word "from:".', 'woocommerce-bookings' ),
3542
- # 'value' => get_post_meta( $post_id, '_wc_display_cost_' . $currency_code, true ),
3543
 
3544
- msgid "The cost is displayed to the user on the frontend. Leave blank to have it calculated for you. If a booking has varying costs, this will be prefixed with the word \"from:\"."
3545
  msgstr ""
3546
 
3547
- # echo '<input type="radio" name="_wcml_custom_costs" id="wcml_custom_costs_auto" value="0" class="wcml_custom_costs_input" ' . $checked . ' />';
3548
- # echo '<label for="wcml_custom_costs_auto">' . __( 'Calculate costs in other currencies automatically', 'woocommerce-multilingual' ) . '</label>';
3549
- #
3550
 
3551
- msgid "Calculate costs in other currencies automatically"
3552
  msgstr ""
3553
 
3554
- # echo '<input type="radio" name="_wcml_custom_costs" value="1" id="wcml_custom_costs_manually" class="wcml_custom_costs_input" ' . $checked . ' />';
3555
- # echo '<label for="wcml_custom_costs_manually">' . __( 'Set costs in other currencies manually', 'woocommerce-multilingual' ) . '</label>';
3556
- #
3557
 
3558
- msgid "Set costs in other currencies manually"
3559
  msgstr ""
3560
 
3561
- #
3562
- # $bookings_section = new WPML_Editor_UI_Field_Section( __( 'Bookings', 'woocommerce-multilingual' ) );
3563
- #
3564
 
3565
- msgid "Bookings"
3566
  msgstr ""
3567
 
3568
- # $group = new WPML_Editor_UI_Field_Group( '', true );
3569
- # $booking_field = new WPML_Editor_UI_Single_Line_Field( '_wc_booking_resouce_label', __( 'Resources Label', 'woocommerce-multilingual' ), $data, true );
3570
- # $group->add_field( $booking_field );
3571
 
3572
- msgid "Resources Label"
3573
  msgstr ""
3574
 
3575
- # if ( $orig_resources ) {
3576
- # $group = new WPML_Editor_UI_Field_Group( __( 'Resources', 'woocommerce-multilingual' ) );
3577
- # $group_title = __( 'Resources', 'woocommerce-multilingual' );
3578
 
3579
- msgid "Resources"
3580
  msgstr ""
3581
 
3582
- # $divider = true;
3583
- # $group_title = __( 'Person Types', 'woocommerce-multilingual' );
3584
- # foreach ( $original_persons as $person_id ) {
3585
 
3586
- msgid "Person Types"
3587
  msgstr ""
3588
 
3589
- #
3590
- # $person_field = new WPML_Editor_UI_Single_Line_Field( 'bookings-person_' . $person_id . '_title', __( 'Person Type Name', 'woocommerce-multilingual' ), $data, false );
3591
- # $group->add_field( $person_field );
3592
 
3593
- msgid "Person Type Name"
3594
  msgstr ""
3595
 
3596
- # if ( $meta_key == '_wc_booking_resouce_label' ) {
3597
- # return __( 'Resources label', 'woocommerce-multilingual' );
3598
  # }
3599
 
3600
- msgid "Resources label"
3601
  msgstr ""
3602
 
3603
- # <tr valign="top">
3604
- # <th scope="row"><?php _e( 'Booking currency', 'woocommerce-multilingual' ); ?></th>
3605
- # <td>
3606
 
3607
- msgid "Booking currency"
3608
  msgstr ""
3609
 
3610
- #
3611
- # $tabs_section = new WPML_Editor_UI_Field_Section( __( 'Product tabs', 'woocommerce-multilingual' ) );
3612
  #
3613
 
3614
- msgid "Product tabs"
3615
  msgstr ""
3616
 
3617
- # $group->add_field( $tab_field );
3618
- # $tab_field = new WPML_Editor_UI_Single_Line_Field( 'coretab_' . $prod_tab['id'].'_heading' , __( 'Heading', 'woocommerce-multilingual' ), $data, false );
3619
- # $group->add_field( $tab_field );
3620
 
3621
- msgid "Heading"
3622
  msgstr ""
3623
 
3624
- # $message = '<div><p class="icl_cyan_box">';
3625
- # $message .= sprintf( __( 'To translate Add-ons strings please save Add-ons and go to the <b><a href="%s">String Translation interface</a></b>', 'woocommerce-multilingual' ), admin_url( 'admin.php?page='.WPML_ST_FOLDER.'/menu/string-translation.php&context=wc_product_addons_strings' ) );
3626
- # $message .= '</p></div>';
3627
 
3628
- msgid "To translate Add-ons strings please save Add-ons and go to the <b><a href=\"%s\">String Translation interface</a></b>"
3629
  msgstr ""
3630
 
3631
  #
3632
- # $addons_section = new WPML_Editor_UI_Field_Section( sprintf( __( 'Product Add-ons Group "%s"', 'woocommerce-multilingual' ), $product_addon['name'] ) );
3633
- #
3634
 
3635
- msgid "Product Add-ons Group \"%s\""
3636
  msgstr ""
3637
 
3638
- #
3639
- # $labels_group = new WPML_Editor_UI_Field_Group( __( 'Options', 'woocommerce-multilingual' ) , true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3640
  #
3641
 
3642
- msgid "Options"
3643
  msgstr ""
3644
 
3645
- # foreach ( $product_addon['options'] as $option_id => $option ) {
3646
- # $option_label_field = new WPML_Editor_UI_Single_Line_Field( 'addon_'.$addon_id.'_option_'.$option_id.'_label', __( 'Label', 'woocommerce-multilingual' ), $data, false );
3647
- # $labels_group->add_field( $option_label_field );
3648
 
3649
- msgid "Label"
3650
  msgstr ""
3651
 
3652
- # $message = '<div><p class="icl_cyan_box">';
3653
- # $message .= sprintf(__('To translate Extra Options strings please save %s and go to the <b><a href="%s">String Translation interface</a></b>', 'woocommerce-multilingual'), $text, admin_url('admin.php?page='.WPML_ST_FOLDER.'/menu/string-translation.php&context=wc_extra_product_options'));
3654
- # $message .= '</p></div>';
3655
 
3656
- msgid "To translate Extra Options strings please save %s and go to the <b><a href=\"%s\">String Translation interface</a></b>"
3657
  msgstr ""
3658
 
3659
- #
3660
- # $tour_section = new WPML_Editor_UI_Field_Section( __('Tour Data', 'woocommerce-multilingual'));
3661
- #
3662
 
3663
- msgid "Tour Data"
3664
  msgstr ""
3665
 
3666
- # $group->add_field($composite_field);
3667
- # $composite_field = new WPML_Editor_UI_Single_Line_Field('adventure_tour_' . $tour_tab_id . '_content', __('Content', 'woocommerce-multilingual'), $data, false);
3668
- # $group->add_field($composite_field);
3669
 
3670
- msgid "Content"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3671
  msgstr ""
13
  "Language:en\n"
14
  "MIME-Version: 1.0\n"
15
 
16
+ # 'label' => get_woocommerce_currency_symbol( $currency_code ),
17
+ # 'description' => __( 'One-off cost for the booking as a whole.', 'woocommerce-bookings' ),
18
+ # 'value' => get_post_meta( $post_id, '_wc_booking_cost_' . $currency_code, true ),
 
 
 
 
 
 
 
19
 
20
+ msgid "One-off cost for the booking as a whole."
21
  msgstr ""
22
 
23
+ # 'label' => get_woocommerce_currency_symbol( $currency_code ),
24
+ # 'description' => __( 'This is the cost per block booked. All other costs (for resources and persons) are added to this.', 'woocommerce-bookings' ),
25
+ # 'value' => get_post_meta( $post_id, '_wc_booking_base_cost_' . $currency_code, true ),
26
 
27
+ msgid "This is the cost per block booked. All other costs (for resources and persons) are added to this."
28
  msgstr ""
29
 
30
+ # 'label' => get_woocommerce_currency_symbol( $currency_code ),
31
+ # 'description' => __( 'The cost is displayed to the user on the frontend. Leave blank to have it calculated for you. If a booking has varying costs, this will be prefixed with the word "from:".', 'woocommerce-bookings' ),
32
+ # 'value' => get_post_meta( $post_id, '_wc_display_cost_' . $currency_code, true ),
33
 
34
+ msgid "The cost is displayed to the user on the frontend. Leave blank to have it calculated for you. If a booking has varying costs, this will be prefixed with the word \"from:\"."
35
  msgstr ""
36
 
37
+ # echo '<input type="radio" name="_wcml_custom_costs" id="wcml_custom_costs_auto" value="0" class="wcml_custom_costs_input" ' . $checked . ' />';
38
+ # echo '<label for="wcml_custom_costs_auto">' . __( 'Calculate costs in other currencies automatically', 'woocommerce-multilingual' ) . '</label>';
39
+ #
40
 
41
+ msgid "Calculate costs in other currencies automatically"
42
  msgstr ""
43
 
44
+ # echo '<input type="radio" name="_wcml_custom_costs" value="1" id="wcml_custom_costs_manually" class="wcml_custom_costs_input" ' . $checked . ' />';
45
+ # echo '<label for="wcml_custom_costs_manually">' . __( 'Set costs in other currencies manually', 'woocommerce-multilingual' ) . '</label>';
46
+ #
47
 
48
+ msgid "Set costs in other currencies manually"
49
  msgstr ""
50
 
51
+ # if ( ! $nonce || ! wp_verify_nonce( $nonce, 'booking_set_currency' ) ) {
52
+ # echo json_encode( array( 'error' => __( 'Invalid nonce', 'woocommerce-multilingual' ) ) );
53
+ # die();
54
 
55
+ msgid "Invalid nonce"
56
  msgstr ""
57
 
58
+ #
59
+ # $bookings_section = new WPML_Editor_UI_Field_Section( __( 'Bookings', 'woocommerce-multilingual' ) );
60
+ #
61
 
62
+ msgid "Bookings"
63
  msgstr ""
64
 
65
+ # $group = new WPML_Editor_UI_Field_Group( '', true );
66
+ # $booking_field = new WPML_Editor_UI_Single_Line_Field( '_wc_booking_resouce_label', __( 'Resources Label', 'woocommerce-multilingual' ), $data, true );
67
+ # $group->add_field( $booking_field );
68
 
69
+ msgid "Resources Label"
70
  msgstr ""
71
 
72
+ # if ( $orig_resources ) {
73
+ # $group = new WPML_Editor_UI_Field_Group( __( 'Resources', 'woocommerce-multilingual' ) );
74
+ # $group_title = __( 'Resources', 'woocommerce-multilingual' );
75
 
76
+ msgid "Resources"
77
  msgstr ""
78
 
 
 
79
  #
80
+ # $resource_field = new WPML_Editor_UI_Single_Line_Field( 'bookings-resource_' . $resource_id . '_title', __( 'Title', 'woocommerce-multilingual' ), $data, true );
81
+ # $group->add_field( $resource_field );
82
 
83
+ msgid "Title"
84
  msgstr ""
85
 
86
+ # $divider = true;
87
+ # $group_title = __( 'Person Types', 'woocommerce-multilingual' );
88
+ # foreach ( $original_persons as $person_id ) {
89
 
90
+ msgid "Person Types"
91
  msgstr ""
92
 
93
  #
94
+ # $person_field = new WPML_Editor_UI_Single_Line_Field( 'bookings-person_' . $person_id . '_title', __( 'Person Type Name', 'woocommerce-multilingual' ), $data, false );
95
+ # $group->add_field( $person_field );
96
 
97
+ msgid "Person Type Name"
98
  msgstr ""
99
 
100
+ # $group->add_field( $person_field );
101
+ # $person_field = new WPML_Editor_UI_Single_Line_Field( 'bookings-person_' . $person_id . '_description', __( 'Description', 'woocommerce-multilingual' ), $data, false );
102
+ # $group->add_field( $person_field );
103
 
104
+ msgid "Description"
105
  msgstr ""
106
 
107
+ # if ( $meta_key == '_wc_booking_resouce_label' ) {
108
+ # return __( 'Resources label', 'woocommerce-multilingual' );
109
  # }
110
 
111
+ msgid "Resources label"
112
  msgstr ""
113
 
114
+ # $pointer_ui = new WCML_Pointer_UI(
115
+ # sprintf( __( 'You can translate the titles of your custom Resources on the %sWooCommerce product translation page%s', 'woocommerce-multilingual' ), '<a href="'.admin_url('admin.php?page=wpml-wcml').'">', '</a>' ),
116
+ # 'https://wpml.org/documentation/woocommerce-extensions-compatibility/translating-woocommerce-bookings-woocommerce-multilingual/',
117
 
118
+ msgid "You can translate the titles of your custom Resources on the %sWooCommerce product translation page%s"
119
  msgstr ""
120
 
121
+ # $pointer_ui = new WCML_Pointer_UI(
122
+ # sprintf( __( 'You can translate the Person Type Name and Description on the %sWooCommerce product translation page%s', 'woocommerce-multilingual' ), '<a href="'.admin_url('admin.php?page=wpml-wcml').'">', '</a>' ),
123
+ # 'https://wpml.org/documentation/woocommerce-extensions-compatibility/translating-woocommerce-bookings-woocommerce-multilingual/',
124
 
125
+ msgid "You can translate the Person Type Name and Description on the %sWooCommerce product translation page%s"
126
  msgstr ""
127
 
128
+ # <tr valign="top">
129
+ # <th scope="row"><?php _e( 'Booking currency', 'woocommerce-multilingual' ); ?></th>
130
+ # <td>
131
 
132
+ msgid "Booking currency"
133
  msgstr ""
134
 
135
+ # $message = '<div><p class="icl_cyan_box">';
136
+ # $message .= sprintf(__('To translate Extra Options strings please save %s and go to the <b><a href="%s">String Translation interface</a></b>', 'woocommerce-multilingual'), $text, admin_url('admin.php?page='.WPML_ST_FOLDER.'/menu/string-translation.php&context=wc_extra_product_options'));
137
+ # $message .= '</p></div>';
138
 
139
+ msgid "To translate Extra Options strings please save %s and go to the <b><a href=\"%s\">String Translation interface</a></b>"
140
  msgstr ""
141
 
142
+ # $pointer_ui = new WCML_Pointer_UI(
143
+ # sprintf( __( 'You can translate this method title on the %sWPML String Translation page%s. Use the search on the top of that page to find the method title string.', 'woocommerce-multilingual' ), '<a href="'.admin_url('admin.php?page='.WPML_ST_FOLDER.'/menu/string-translation.php').'">', '</a>' ),
144
+ # 'https://wpml.org/documentation/woocommerce-extensions-compatibility/translating-woocommerce-table-rate-shipping-woocommerce-multilingual/',
145
 
146
+ msgid "You can translate this method title on the %sWPML String Translation page%s. Use the search on the top of that page to find the method title string."
147
  msgstr ""
148
 
149
+ # $pointer_ui = new WCML_Pointer_UI(
150
+ # sprintf( __( 'You can translate the labels of your table rates on the %sWPML String Translation page%s. Use the search on the top of that page to find the labels strings.', 'woocommerce-multilingual' ), '<a href="'.admin_url('admin.php?page='.WPML_ST_FOLDER.'/menu/string-translation.php').'">', '</a>' ),
151
+ # 'https://wpml.org/documentation/woocommerce-extensions-compatibility/translating-woocommerce-table-rate-shipping-woocommerce-multilingual/',
152
 
153
+ msgid "You can translate the labels of your table rates on the %sWPML String Translation page%s. Use the search on the top of that page to find the labels strings."
154
  msgstr ""
155
 
156
  #
157
+ # $composite_section = new WPML_Editor_UI_Field_Section( __( 'Composite Products ( Components )', 'woocommerce-multilingual' ) );
158
+ # end( $composite_data );
159
 
160
+ msgid "Composite Products ( Components )"
161
  msgstr ""
162
 
163
+ # $group = new WPML_Editor_UI_Field_Group( '', $divider );
164
+ # $composite_field = new WPML_Editor_UI_Single_Line_Field( 'composite_'.$component_id.'_title', __( 'Name', 'woocommerce-multilingual' ), $data, false );
165
+ # $group->add_field( $composite_field );
166
 
167
+ msgid "Name"
168
  msgstr ""
169
 
170
+ #
171
+ # $composite_scenarios = new WPML_Editor_UI_Field_Section( __( 'Composite Products ( Scenarios )', 'woocommerce-multilingual' ) );
172
+ # end( $composite_scenarios_meta );
173
 
174
+ msgid "Composite Products ( Scenarios )"
175
  msgstr ""
176
 
177
+ #
178
+ # $bundles_section = new WPML_Editor_UI_Field_Section( __( 'Product Bundles', 'woocommerce-multilingual' ) );
179
+ # end( $product_bundles );
180
 
181
+ msgid "Product Bundles"
182
  msgstr ""
183
 
184
+ # $pointer_ui = new WCML_Pointer_UI(
185
+ # sprintf( __( 'You can translate strings related to global add-ons on the %sWPML String Translation page%s. Use the search on the top of that page to find the strings.', 'woocommerce-multilingual' ), '<a href="'.admin_url('admin.php?page='.WPML_ST_FOLDER.'/menu/string-translation.php&context=wc_product_addons_strings').'">', '</a>' ),
186
+ # 'https://wpml.org/documentation/woocommerce-extensions-compatibility/translating-woocommerce-product-add-ons-woocommerce-multilingual/',
187
 
188
+ msgid "You can translate strings related to global add-ons on the %sWPML String Translation page%s. Use the search on the top of that page to find the strings."
189
  msgstr ""
190
 
191
+ #
192
+ # $addons_section = new WPML_Editor_UI_Field_Section( sprintf( __( 'Product Add-ons Group "%s"', 'woocommerce-multilingual' ), $product_addon['name'] ) );
193
+ #
194
 
195
+ msgid "Product Add-ons Group \"%s\""
196
  msgstr ""
197
 
198
+ #
199
+ # $labels_group = new WPML_Editor_UI_Field_Group( __( 'Options', 'woocommerce-multilingual' ) , true );
200
+ #
201
 
202
+ msgid "Options"
203
  msgstr ""
204
 
205
+ # foreach ( $product_addon['options'] as $option_id => $option ) {
206
+ # $option_label_field = new WPML_Editor_UI_Single_Line_Field( 'addon_'.$addon_id.'_option_'.$option_id.'_label', __( 'Label', 'woocommerce-multilingual' ), $data, false );
207
+ # $labels_group->add_field( $option_label_field );
208
 
209
+ msgid "Label"
210
  msgstr ""
211
 
212
+ # $pointer_ui = new WCML_Pointer_UI(
213
+ # sprintf( __( 'You can translate the Group Name, Group Description and every Option Label of your product add-on on the %sWooCommerce product translation page%s', 'woocommerce-multilingual' ), '<a href="'.admin_url('admin.php?page=wpml-wcml').'">', '</a>' ),
214
+ # 'https://wpml.org/documentation/woocommerce-extensions-compatibility/translating-woocommerce-product-add-ons-woocommerce-multilingual/',
215
 
216
+ msgid "You can translate the Group Name, Group Description and every Option Label of your product add-on on the %sWooCommerce product translation page%s"
217
  msgstr ""
218
 
219
+ # 'name' => 'language',
220
+ # 'label' => __( 'Language', 'woo_ce' ),
221
+ # 'default' => 1
222
 
223
+ msgid "Language"
224
  msgstr ""
225
 
226
+ # 'name' => 'translation_of',
227
+ # 'label' => __( 'Translation of', 'woo_ce' ),
228
+ # 'default' => 1
229
 
230
+ msgid "Translation of"
231
  msgstr ""
232
 
233
+ #
234
+ # $tour_section = new WPML_Editor_UI_Field_Section( __('Tour Data', 'woocommerce-multilingual'));
235
+ #
236
 
237
+ msgid "Tour Data"
238
  msgstr ""
239
 
240
+ # $group->add_field($composite_field);
241
+ # $composite_field = new WPML_Editor_UI_Single_Line_Field('adventure_tour_' . $tour_tab_id . '_content', __('Content', 'woocommerce-multilingual'), $data, false);
242
+ # $group->add_field($composite_field);
243
 
244
+ msgid "Content"
245
  msgstr ""
246
 
247
+ # if( $this->is_subscriptions_product( $product_id ) || $this->new_subscription ){
248
+ # $labels[ '_regular_price' ] = __( 'Subscription Price', 'woocommerce-multilingual' );
249
+ # $labels[ '_subscription_sign_up_fee' ] = __( 'Sign-up Fee', 'woocommerce-multilingual' );
250
 
251
+ msgid "Subscription Price"
252
  msgstr ""
253
 
254
+ # $labels[ '_regular_price' ] = __( 'Subscription Price', 'woocommerce-multilingual' );
255
+ # $labels[ '_subscription_sign_up_fee' ] = __( 'Sign-up Fee', 'woocommerce-multilingual' );
256
+ # }
257
 
258
+ msgid "Sign-up Fee"
259
  msgstr ""
260
 
261
+ # $pointer_ui = new WCML_Pointer_UI(
262
+ # sprintf( __( 'You can translate strings related to subscription products on the %sWPML String Translation page%s. Use the search on the top of that page to find the strings.', 'woocommerce-multilingual' ), '<a href="'.admin_url('admin.php?page='.WPML_ST_FOLDER.'/menu/string-translation.php&context=woocommerce_subscriptions').'">', '</a>' ),
263
+ # 'https://wpml.org/documentation/woocommerce-extensions-compatibility/translating-woocommerce-subscriptions-woocommerce-multilingual/',
264
 
265
+ msgid "You can translate strings related to subscription products on the %sWPML String Translation page%s. Use the search on the top of that page to find the strings."
266
  msgstr ""
267
 
268
+ #
269
+ # $tabs_section = new WPML_Editor_UI_Field_Section( __( 'Product tabs', 'woocommerce-multilingual' ) );
270
+ #
271
 
272
+ msgid "Product tabs"
 
 
 
 
 
 
 
273
  msgstr ""
274
 
275
+ # $group->add_field( $tab_field );
276
+ # $tab_field = new WPML_Editor_UI_Single_Line_Field( 'coretab_' . $prod_tab['id'].'_heading' , __( 'Heading', 'woocommerce-multilingual' ), $data, false );
277
+ # $group->add_field( $tab_field );
278
 
279
+ msgid "Heading"
280
  msgstr ""
281
 
282
+ # $pointer_ui = new WCML_Pointer_UI(
283
+ # sprintf( __( 'You can translate your custom product tabs on the %sWooCommerce product translation page%s', 'woocommerce-multilingual' ), '<a href="'.admin_url('admin.php?page=wpml-wcml').'">', '</a>' ),
284
+ # 'https://wpml.org/documentation/woocommerce-extensions-compatibility/translating-woocommerce-tab-manager-woocommerce-multilingual/',
285
 
286
+ msgid "You can translate your custom product tabs on the %sWooCommerce product translation page%s"
287
  msgstr ""
288
 
289
+ # }
290
+ # wp_send_json_error( __( 'Notice does not exists.', 'sitepress' ) );
291
+ # }
292
 
293
+ msgid "Notice does not exists."
294
  msgstr ""
295
 
296
+ # }
297
+ # wp_send_json_error( __( 'Group does not exist.', 'sitepress' ) );
298
+ # }
299
 
300
+ msgid "Group does not exist."
301
  msgstr ""
302
 
303
+ # if ( $this->hide_html_added || $notice->can_be_hidden() ) {
304
+ # $result .= ' data-hide-text="' . __( 'Hide', 'sitepress' ) . '" ';
305
+ # }
306
 
307
+ msgid "Hide"
308
  msgstr ""
309
 
310
+ # } else {
311
+ # $hide_html .= esc_html__( 'Hide this notice.', 'sitepress' );
312
+ # }
313
 
314
+ msgid "Hide this notice."
315
  msgstr ""
316
 
317
+ # } else {
318
+ # $dismiss_html .= esc_html__( 'Dismiss this notice.', 'sitepress' );
319
+ # }
320
 
321
+ msgid "Dismiss this notice."
322
  msgstr ""
323
 
324
+ # $notice->get_collapsed_text(),
325
+ # $localized_text ? esc_html( $localized_text ) : esc_html__( 'Show this notice.', 'sitepress' ),
326
+ # $notice->get_text()
327
 
328
+ msgid "Show this notice."
329
  msgstr ""
330
 
331
+ # $this->admin_notice = '<div class="error wpml-admin-notice">';
332
+ # $this->admin_notice .= '<h3>' . __( 'WPML Update is Incomplete', 'sitepress' ) . '</h3>';
333
+ # $this->admin_notice .= '<p>' . implode( '</p><p>', $notice_paragraphs ) . '</p>';
334
 
335
+ msgid "WPML Update is Incomplete"
336
  msgstr ""
337
 
338
+ # if ( count( $this->valid_plugins ) === 1 ) {
339
+ # $paragraph = __( 'You are running updated %s, but the following component is not updated:', 'sitepress' );
340
+ # $paragraph = sprintf( $paragraph, '<strong>' . $this->valid_plugins[0] . '</strong>' );
341
 
342
+ msgid "You are running updated %s, but the following component is not updated:"
343
  msgstr ""
344
 
345
+ # } else {
346
+ # $paragraph = __( 'You are running updated %s and %s, but the following components are not updated:', 'sitepress' );
347
+ # $first_valid_plugins = implode( ', ', array_slice( $this->valid_plugins, 0, - 1 ) );
348
 
349
+ msgid "You are running updated %s and %s, but the following components are not updated:"
350
  msgstr ""
351
 
352
+ # } else {
353
+ # $paragraph = __( 'The following components are not updated:', 'sitepress' );
354
+ # }
355
 
356
+ msgid "The following components are not updated:"
357
  msgstr ""
358
 
359
+ # private function get_invalid_plugins_report_footer() {
360
+ # $wpml_org_url = '<a href="https://wpml.org/account/" title="WPML.org account">' . __( 'WPML.org account', 'sitepress' ) . '</a>';
361
+ #
362
 
363
+ msgid "WPML.org account"
364
  msgstr ""
365
 
366
  #
367
+ # $notice_paragraph = __( 'Your site will not work as it should in this configuration', 'sitepress' );
368
+ # $notice_paragraph .= ' ';
369
 
370
+ msgid "Your site will not work as it should in this configuration"
371
  msgstr ""
372
 
373
+ # $notice_paragraph .= ' ';
374
+ # $notice_paragraph .= __( 'Please update all components which you are using.', 'sitepress' );
375
+ # $notice_paragraph .= ' ';
376
 
377
+ msgid "Please update all components which you are using."
378
  msgstr ""
379
 
380
+ # $notice_paragraph .= ' ';
381
+ # $notice_paragraph .= sprintf( __( 'For WPML components you can receive updates from your %s or automatically, after you register WPML.', 'sitepress' ), $wpml_org_url );
382
+ #
383
 
384
+ msgid "For WPML components you can receive updates from your %s or automatically, after you register WPML."
385
  msgstr ""
386
 
387
+ # if ( false !== strpos( $e->getMessage(), 'create' ) ) {
388
+ # $text = sprintf( __( 'WPML could not create a cache directory in %s', 'sitepress' ), $this->cache_directory );
389
+ # } else {
390
 
391
+ msgid "WPML could not create a cache directory in %s"
392
  msgstr ""
393
 
394
+ # } else {
395
+ # $text = sprintf( __( 'WPML could not write in the cache directory: %s', 'sitepress' ), $this->cache_directory );
396
+ # }
397
 
398
+ msgid "WPML could not write in the cache directory: %s"
399
  msgstr ""
400
 
401
+ # $translation_array = array(
402
+ # 'installing' => __( 'Installing %s', 'installer' ),
403
+ # 'updating' => __( 'Updating %s', 'installer' ),
404
 
405
+ msgid "Installing %s"
406
  msgstr ""
407
 
408
+ # 'installing' => __( 'Installing %s', 'installer' ),
409
+ # 'updating' => __( 'Updating %s', 'installer' ),
410
+ # 'activating' => __( 'Activating %s', 'installer' )
411
 
412
+ msgid "Updating %s"
413
  msgstr ""
414
 
415
+ # 'updating' => __( 'Updating %s', 'installer' ),
416
+ # 'activating' => __( 'Activating %s', 'installer' )
417
+ # );
418
 
419
+ msgid "Activating %s"
420
  msgstr ""
421
 
422
+ # $this->menu_multisite_redirect();
423
+ # add_options_page(__('Installer', 'installer'), __('Installer', 'installer'), 'manage_options', 'installer', array($this, 'show_products')) ;
424
+ # }else{
425
 
426
+ msgid "Installer"
427
  msgstr ""
428
 
429
+ # public function plugins_action_links_registered($links){
430
+ # $links[] = '<a href="' . $this->menu_url() . '">' . __('Registered', 'installer') . '</a>';
431
+ # return $links;
432
 
433
+ msgid "Registered"
434
  msgstr ""
435
 
436
+ # public function plugins_action_links_not_registered($links){
437
+ # $links[] = '<a href="' . $this->menu_url() . '">' . __('Register', 'installer') . '</a>';
438
+ # return $links;
439
 
440
+ msgid "Register"
441
  msgstr ""
442
 
443
+ # 'type' => 'error',
444
+ # 'text' => sprintf( __( 'You are using an invalid site key defined as the constant %s (most likely in wp-config.php).
445
+ # Please remove it or use the correct value in order to be able to register correctly.', 'installer' ), 'OTGS_INSTALLER_SITE_KEY_' . strtoupper( $repository_id ) )
446
 
447
+ msgid "You are using an invalid site key defined as the constant %s (most likely in wp-config.php). \r\n Please remove it or use the correct value in order to be able to register correctly."
448
  msgstr ""
449
 
450
+ # echo '<div class="updated error otgs-is-dismissible"><p>';
451
+ # printf(__("To get automatic updates, you need to register %s for this site. %sRegister %s%s", 'sitepress'),
452
+ # $nag['product_name'], '<a class="button-primary" href="' . $this->menu_url() . '">', $nag['product_name'], '</a>');
453
 
454
+ msgid "To get automatic updates, you need to register %s for this site. %sRegister %s%s"
455
  msgstr ""
456
 
457
+ # echo '</p>';
458
+ # echo '<span class="installer-dismiss-nag notice-dismiss" data-repository="' . $nag['repository_id'] . '"><span class="screen-reader-text">' . __('Dismiss', 'sitepress') . '</span></span>';
459
+ # echo '</div>';
460
 
461
+ msgid "Dismiss"
462
  msgstr ""
463
 
464
  #
465
+ # $tabs['commercial'] = __('Commercial', 'installer');
466
+ #
467
 
468
+ msgid "Commercial"
469
  msgstr ""
470
 
471
+ #
472
+ # $error = sprintf(__("Installer cannot display the products information because the automatic updating for %s was explicitly disabled with the configuration below (usually in wp-config.php):", 'installer'), strtoupper( join(', ', $repository_names) ));
473
+ # $error .= '<br /><br /><code>define("OTGS_DISABLE_AUTO_UPDATES", true);</code><br /><br />';
474
 
475
+ msgid "Installer cannot display the products information because the automatic updating for %s was explicitly disabled with the configuration below (usually in wp-config.php):"
476
  msgstr ""
477
 
478
+ # $error .= '<br /><br /><code>define("OTGS_DISABLE_AUTO_UPDATES", true);</code><br /><br />';
479
+ # $error .= sprintf(__("In order to see the products information, please run the %smanual updates check%s to initialize the products list or (temporarily) remove the above code.", 'installer'), '<a href="' . admin_url('update-core.php') . '">', '</a>');
480
+ #
481
 
482
+ msgid "In order to see the products information, please run the %smanual updates check%s to initialize the products list or (temporarily) remove the above code."
483
  msgstr ""
484
 
485
+ #
486
+ # $error = sprintf(__("Installer cannot contact our updates server to get information about the available products and check for new versions. If you are seeing this message for the first time, you can ignore it, as it may be a temporary communication problem. If the problem persists and your WordPress admin is slowing down, you can disable automated version checks. Add the following line to your wp-config.php file:", 'installer'), strtoupper($id));
487
+ # $error .= '<br /><br /><code>define("OTGS_DISABLE_AUTO_UPDATES", true);</code>';
488
 
489
+ msgid "Installer cannot contact our updates server to get information about the available products and check for new versions. If you are seeing this message for the first time, you can ignore it, as it may be a temporary communication problem. If the problem persists and your WordPress admin is slowing down, you can disable automated version checks. Add the following line to your wp-config.php file:"
490
  msgstr ""
491
 
492
+ #
493
+ # echo '<center>' . __('No repositories defined.', 'installer') . '</center>';
494
+ #
495
 
496
+ msgid "No repositories defined."
497
  msgstr ""
498
 
499
+ # } else {
500
+ # $error = __( 'Invalid site key for the current site.', 'installer' )
501
+ # . '<br /><div class="installer-footnote">' . __('Please note that the site key is case sensitive.', 'installer') . '</div>';
502
 
503
+ msgid "Invalid site key for the current site."
504
  msgstr ""
505
 
506
+ # $error = __( 'Invalid site key for the current site.', 'installer' )
507
+ # . '<br /><div class="installer-footnote">' . __('Please note that the site key is case sensitive.', 'installer') . '</div>';
508
+ # }
509
 
510
+ msgid "Please note that the site key is case sensitive."
511
  msgstr ""
512
 
513
+ # if( preg_match('#Could not resolve host: (.*)#', $error, $matches) || preg_match('#Couldn\'t resolve host \'(.*)\'#', $error, $matches) ){
514
+ # $error = sprintf(__("%s cannot access %s to register. Try again to see if it's a temporary problem. If the problem continues, make sure that this site has access to the Internet. You can still use the plugin without registration, but you will not receive automated updates.", 'installer'),
515
+ # '<strong><i>' . $this->get_generic_product_name($repository_id) . '</i></strong>',
516
 
517
+ msgid "%s cannot access %s to register. Try again to see if it's a temporary problem. If the problem continues, make sure that this site has access to the Internet. You can still use the plugin without registration, but you will not receive automated updates."
518
  msgstr ""
519
 
520
+ # unset($this->settings['repositories'][$repository_id]['subscription']);
521
+ # $error = __( 'Invalid site key for the current site. If the error persists, try to unregister first and then register again with the same site key.', 'installer' );
522
  # }
523
 
524
+ msgid "Invalid site key for the current site. If the error persists, try to unregister first and then register again with the same site key."
525
  msgstr ""
526
 
527
+ # $days = 30;
528
+ # $message = __('You will have to renew your subscription in order to continue getting the updates and support.', 'installer');
529
  #
530
 
531
+ msgid "You will have to renew your subscription in order to continue getting the updates and support."
532
  msgstr ""
533
 
534
+ # echo $this->_plugins_renew_warnings[$plugin_file]. ' ';
535
+ # printf(__('%sRenew here%s.', 'installer'),
536
+ # '<a href="' . $this->menu_url() . '">', '</a>');
537
 
538
+ msgid "%sRenew here%s."
539
  msgstr ""
540
 
541
+ # $ret = false;
542
+ # $message = __('Your subscription appears to no longer be valid. Please try to register again using a valid site key.', 'installer');
543
+ # }
544
 
545
+ msgid "Your subscription appears to no longer be valid. Please try to register again using a valid site key."
546
  msgstr ""
547
 
548
+ # <p class="installer-q-icon">
549
+ # <?php printf( __('You must have a valid subscription in order to get upgrades or support for this plugin. %sPurchase a subscription or enter an existing site key%s.', 'installer'),
550
+ # '<a href="' . $this->menu_url() . '">', '</a>'); ?>
551
 
552
+ msgid "You must have a valid subscription in order to get upgrades or support for this plugin. %sPurchase a subscription or enter an existing site key%s."
553
  msgstr ""
554
 
 
 
555
  #
556
+ # $error_message = sprintf(__("%s cannot update because your site's registration is not valid. Please %sregister %s%s again for this site first.", 'installer'),
557
+ # '<strong>' . $plugin_name . '</strong>', '<a target="_top" href="' . $this->menu_url() . '&validate_repository=' . $plugin_repository .
558
 
559
+ msgid "%s cannot update because your site's registration is not valid. Please %sregister %s%s again for this site first."
560
  msgstr ""
561
 
562
+ # echo '<div class="wrap">';
563
+ # echo '<h2>' . __( 'Update Plugin', 'installer' ) . '</h2>';
564
+ # echo '<a href="' . admin_url('plugins.php') . '">' . __( 'Return to the plugins page', 'installer' ) . '</a>';
565
 
566
+ msgid "Update Plugin"
567
  msgstr ""
568
 
569
+ # echo '<h2>' . __( 'Update Plugin', 'installer' ) . '</h2>';
570
+ # echo '<a href="' . admin_url('plugins.php') . '">' . __( 'Return to the plugins page', 'installer' ) . '</a>';
571
+ # echo '</div>';
572
 
573
+ msgid "Return to the plugins page"
574
  msgstr ""
575
 
576
+ # echo '<div><p class="installer-warn-box">' .
577
+ # sprintf(_n('Your subscription expires in %d day.', 'Your subscription expires in %d days.', $days_to_expiration, 'installer'), $days_to_expiration) .
578
+ # '<br />' . $message .
579
 
580
+ msgid "Your subscription expires in %d day."
581
  msgstr ""
582
 
583
+ # echo '<div><p class="installer-warn-box">' .
584
+ # sprintf(_n('Your subscription expires in %d day.', 'Your subscription expires in %d days.', $days_to_expiration, 'installer'), $days_to_expiration) .
585
+ # '<br />' . $message .
586
 
587
+ msgid "Your subscription expires in %d days."
588
  msgstr ""
589
 
590
+ # public function win_paths_exception_message(){
591
+ # return __('Downloading is not possible. WordPress cannot create required folders because of the
592
+ # 256 characters limitation of the current Windows environment.', 'installer');
593
 
594
+ msgid "Downloading is not possible. WordPress cannot create required folders because of the\r\n 256 characters limitation of the current Windows environment."
595
  msgstr ""
596
 
597
+ # echo '<div class="wrap">';
598
+ # echo '<h2>' . __('Update Plugin') . '</h2>';
599
+ # echo '<a href="' . admin_url('update-core.php') . '">' . __('Return to the updates page', 'installer') . '</a>';
600
 
601
+ msgid "Update Plugin"
602
  msgstr ""
603
 
604
+ # echo '<h2>' . __('Update Plugin') . '</h2>';
605
+ # echo '<a href="' . admin_url('update-core.php') . '">' . __('Return to the updates page', 'installer') . '</a>';
606
+ # echo '</div>';
607
 
608
+ msgid "Return to the updates page"
609
  msgstr ""
610
 
611
+ # $theme_repo_name = $this->installer_theme_get_repo_product_name( $frontend_tab_selected );;
612
+ # $response['unregistered_messages'] = sprintf( __( 'To install and update %s, please %sregister%s %s for this site.', 'installer' ),
613
+ # $theme_repo_name, '<a href="' . $registration_url . '">', '</a>', $theme_repo_name );
614
 
615
+ msgid "To install and update %s, please %sregister%s %s for this site."
616
  msgstr ""
617
 
618
+ # if(empty($args['repository']) || empty($args['package']) || empty($args['product'])){
619
+ # echo __('Incorrect setup', 'installer');
620
+ # return;
621
 
622
+ msgid "Incorrect setup"
623
  msgstr ""
624
 
625
+ # if(!$product){
626
+ # echo __('Invalid product', 'installer');
627
+ # return;
628
 
629
+ msgid "Invalid product"
630
  msgstr ""
631
 
632
+ # }else{
633
+ # echo __('Unknown repository', 'installer');
634
+ # return;
635
 
636
+ msgid "Unknown repository"
637
  msgstr ""
638
 
639
+ # if($subscription_type != $product['subscription_type'] && !$this->have_superior_subscription($subscription_type, $product) && $site_key){
640
+ # $subscription_no_match = sprintf(__(' Your current site key (%s) does not match the selected product (%s).', 'installer'), $site_key, $product['name']);
641
+ # }
642
 
643
+ msgid " Your current site key (%s) does not match the selected product (%s)."
644
  msgstr ""
645
 
646
  #
647
+ # <a class="button-primary" href="<?php echo $this->append_parameters_to_buy_url($product['url'], $repository_id, $args) ?>"><?php printf(__('Buy %s', 'installer'), $args['product_name']) ?></a>
648
  #
649
 
650
+ msgid "Buy %s"
651
  msgstr ""
652
 
653
+ # <br />
654
+ # <?php printf(__('Already bought %s?', 'installer'), $args['product_name']) ?>
655
+ # <a class="enter_site_key_js<?php if( WP_Installer::get_repository_hardcoded_site_key( $repository_id ) ): ?> disabled<?php endif ?>" href="#"
656
 
657
+ msgid "Already bought %s?"
658
  msgstr ""
659
 
660
+ # <li>
661
+ # <a href="<?php echo $this->append_parameters_to_buy_url($renewal['url'], $repository_id, $args) ?>"><?php printf(__('Renew %s', 'installer'), $args['product_name']) ?></a>
662
+ # </li>
663
 
664
+ msgid "Renew %s"
665
  msgstr ""
666
 
667
+ # >
668
+ # <?php printf(__("Remove current site key (%s)", 'installer'), $site_key) ?>
669
+ # </a>
670
 
671
+ msgid "Remove current site key (%s)"
672
  msgstr ""
673
 
674
+ # <?php if($support_link): ?>
675
+ # <p><a href="<?php echo $support_link ?>" target="_blank"><?php printf(__('%s support on wpml.org', 'installer'), $args['name'] ) ?></a></p>
676
+ #
677
 
678
+ msgid "%s support on wpml.org"
679
+ msgstr ""
680
+
681
+ # disabled="disabled"
682
+ # title="<?php printf( esc_attr__("Site-key was set by %s, most likely in wp-config.php. Please remove the constant before attempting to register.", 'installer'), 'OTGS_INSTALLER_SITE_KEY_' . strtoupper($repository_id) ) ?>"
683
+ # <?php endif; ?>
684
+
685
+ msgid "Site-key was set by %s, most likely in wp-config.php. Please remove the constant before attempting to register."
686
+ msgstr ""
687
+
688
+ # disabled="disabled"
689
+ # title="<?php printf( esc_attr__("Site-key was set by %s, most likely in wp-config.php. Please remove the constant before attempting to unregister.", 'installer'), 'OTGS_INSTALLER_SITE_KEY_' . strtoupper($repository_id) ) ?>"
690
+ # <?php endif; ?>
691
+
692
+ msgid "Site-key was set by %s, most likely in wp-config.php. Please remove the constant before attempting to unregister."
693
+ msgstr ""
694
+
695
+ # >
696
+ # <?php _e('Enter site key', 'installer') ?>
697
+ # </a>&nbsp;&nbsp;
698
+
699
+ msgid "Enter site key"
700
  msgstr ""
701
 
702
  #
703
+ # <div><p class="installer-warn-box"><?php _e('Subscription is expired.', 'installer') ?></p></div>
704
  #
705
 
706
+ msgid "Subscription is expired."
707
  msgstr ""
708
 
709
+ # <input type="text" size="10" name="site_key_<?php echo $repository_id ?>" />
710
+ # <input class="button-secondary" type="submit" value="<?php esc_attr_e('Add', 'installer') ?>" />
711
+ # </form>
712
 
713
+ msgid "Add"
714
  msgstr ""
715
 
716
+ # <a class="remove_site_key_js" href="#" data-repository=<?php echo $repository_id ?>
717
+ # data-confirmation="<?php esc_attr_e('Are you sure you want to remove this site key?', 'installer') ?>"
718
+ # data-nonce="<?php echo wp_create_nonce('remove_site_key_' . $repository_id) ?>"
719
 
720
+ msgid "Are you sure you want to remove this site key?"
721
  msgstr ""
722
 
723
+ # <?php if( !WP_Installer()->dependencies->is_uploading_allowed() ): ?>
724
+ # <p><?php printf(__('Downloading is not possible because WordPress cannot write into the plugins folder. %sHow to fix%s.', 'installer'),
725
+ # '<a href="http://codex.wordpress.org/Changing_File_Permissions">', '</a>') ?></p>
726
 
727
+ msgid "Downloading is not possible because WordPress cannot write into the plugins folder. %sHow to fix%s."
728
  msgstr ""
729
 
730
+ # <br clear="all" /><br />
731
+ # <strong><?php _e('Downloads:', 'installer') ?></strong>
732
+ #
733
 
734
+ msgid "Downloads:"
735
  msgstr ""
736
 
737
+ # <th>&nbsp;</th>
738
+ # <th><?php _e('Plugin', 'installer') ?></th>
739
+ # <th><?php _e('Current version', 'installer') ?></th>
740
 
741
+ msgid "Plugin"
742
  msgstr ""
743
 
744
+ # <th><?php _e('Plugin', 'installer') ?></th>
745
+ # <th><?php _e('Current version', 'installer') ?></th>
746
+ # <th><?php _e('Released', 'installer') ?></th>
747
 
748
+ msgid "Current version"
749
  msgstr ""
750
 
751
+ # <th><?php _e('Current version', 'installer') ?></th>
752
+ # <th><?php _e('Released', 'installer') ?></th>
753
+ # <th><?php _e('Installed version', 'installer') ?></th>
754
 
755
+ msgid "Released"
756
  msgstr ""
757
 
758
+ # <th><?php _e('Released', 'installer') ?></th>
759
+ # <th><?php _e('Installed version', 'installer') ?></th>
760
+ # <th>&nbsp;</th>
761
 
762
+ msgid "Installed version"
763
  msgstr ""
764
 
765
+ # <span class="<?php echo $class ?>"><?php echo $v; ?></span>
766
+ # <?php if($this->plugin_is_embedded_version($download['name'], $download['slug'])): ?>&nbsp;<?php _e('(embedded)', 'installer'); ?><?php endif; ?>
767
+ # <?php endif; ?>
768
 
769
+ msgid "(embedded)"
770
  msgstr ""
771
 
772
+ # <td>
773
+ # <span class="installer-status-installing"><?php _e('installing...', 'installer') ?></span>
774
+ # <span class="installer-status-updating"><?php _e('updating...', 'installer') ?></span>
775
 
776
+ msgid "installing..."
777
  msgstr ""
778
 
779
+ # <span class="installer-status-installing"><?php _e('installing...', 'installer') ?></span>
780
+ # <span class="installer-status-updating"><?php _e('updating...', 'installer') ?></span>
781
+ # <span class="installer-status-installed" data-fail="<?php _e('failed!', 'installer') ?>"><?php _e('installed', 'installer') ?></span>
782
 
783
+ msgid "updating..."
784
  msgstr ""
785
 
786
+ # <span class="installer-status-updating"><?php _e('updating...', 'installer') ?></span>
787
+ # <span class="installer-status-installed" data-fail="<?php _e('failed!', 'installer') ?>"><?php _e('installed', 'installer') ?></span>
788
+ # <span class="installer-status-updated" data-fail="<?php _e('failed!', 'installer') ?>"><?php _e('updated', 'installer') ?></span>
789
 
790
+ msgid "failed!"
791
  msgstr ""
792
 
793
+ # <span class="installer-status-updating"><?php _e('updating...', 'installer') ?></span>
794
+ # <span class="installer-status-installed" data-fail="<?php _e('failed!', 'installer') ?>"><?php _e('installed', 'installer') ?></span>
795
+ # <span class="installer-status-updated" data-fail="<?php _e('failed!', 'installer') ?>"><?php _e('updated', 'installer') ?></span>
796
 
797
+ msgid "installed"
798
  msgstr ""
799
 
800
+ # <span class="installer-status-installed" data-fail="<?php _e('failed!', 'installer') ?>"><?php _e('installed', 'installer') ?></span>
801
+ # <span class="installer-status-updated" data-fail="<?php _e('failed!', 'installer') ?>"><?php _e('updated', 'installer') ?></span>
802
+ # </td>
803
 
804
+ msgid "updated"
805
  msgstr ""
806
 
807
+ # <td>
808
+ # <span class="installer-status-activating"><?php _e('activating', 'installer') ?></span>
809
+ # <span class="installer-status-activated"><?php _e('activated', 'installer') ?></span>
810
 
811
+ msgid "activating"
812
  msgstr ""
813
 
814
+ # <span class="installer-status-activating"><?php _e('activating', 'installer') ?></span>
815
+ # <span class="installer-status-activated"><?php _e('activated', 'installer') ?></span>
816
+ # </td>
817
 
818
+ msgid "activated"
819
  msgstr ""
820
 
821
+ # &nbsp;
822
+ # <label><input name="activate" type="checkbox" value="1" disabled="disabled" />&nbsp;<?php _e('Activate after download', 'installer') ?></label>
823
  #
824
 
825
+ msgid "Activate after download"
826
  msgstr ""
827
 
828
  #
829
+ # <div class="installer-status-success"><?php _e('Operation complete!', 'installer') ?></div>
830
  #
831
 
832
+ msgid "Operation complete!"
833
  msgstr ""
834
 
835
  #
836
+ # <span class="installer-revalidate-message hidden"><?php _e("Download failed!\n\nPlease refresh the page and try again.", 'installer') ?></span>
837
+ # </form>
838
 
839
+ msgid "Download failed!\n\nPlease refresh the page and try again."
840
  msgstr ""
841
 
842
+ #
843
+ # <input type="submit" class="button-secondary" value="<?php esc_attr_e('Download', 'installer') ?>" disabled="disabled" />
844
+ # &nbsp;
845
 
846
+ msgid "Download"
847
+ msgstr ""
848
+
849
+ # >
850
+ # <?php printf(__('Register %s', 'installer'), $generic_product_name); ?>
851
+ # </a>&nbsp;&nbsp;
852
+
853
+ msgid "Register %s"
854
  msgstr ""
855
 
856
  #
857
+ # <div class="alignleft" style="margin-top:6px;"><?php printf(__('1. Go to your %s%s account%s and add this site URL: %s', 'installer'),
858
+ # '<a href="' . $this->settings['repositories'][$repository_id]['data']['site_keys_management_url'] . '?add='.urlencode($this->get_installer_site_url( $repository_id )).'">',
859
 
860
+ msgid "1. Go to your %s%s account%s and add this site URL: %s"
861
  msgstr ""
862
 
863
+ # >
864
+ # <?php printf(__("Unregister %s from this site", 'installer'), $generic_product_name) ?></a>&nbsp;
865
+ # <a class="update_site_key_js button-secondary" href="#" data-repository=<?php echo $repository_id ?>
866
 
867
+ msgid "Unregister %s from this site"
868
  msgstr ""
869
 
870
+ # <?php if($expires = $this->settings['repositories'][$repository_id]['subscription']['data']->expires): ?>
871
+ # <?php printf(__('%s is registered on this site. You will receive automatic updates until %s', 'installer'), $generic_product_name, date_i18n('F j, Y', strtotime($expires))); ?>
872
+ # <?php else: ?>
873
 
874
+ msgid "%s is registered on this site. You will receive automatic updates until %s"
875
  msgstr ""
876
 
877
+ # <?php else: ?>
878
+ # <?php printf(__('%s is registered on this site. Your Lifetime account gives you updates for life.', 'installer'), $generic_product_name); ?>
879
+ # <?php endif; ?>
880
 
881
+ msgid "%s is registered on this site. Your Lifetime account gives you updates for life."
882
  msgstr ""
883
 
884
  #
885
+ # <p><i><?php printf(__('This page lets you install plugins and update existing plugins. To remove any of these plugins, go to the %splugins%s page and if you have the permission to remove plugins you should be able to do this.', 'installer'), '<a href="' . admin_url('plugins.php') . '">' , '</a>'); ?></i></p>
886
  #
887
 
888
+ msgid "This page lets you install plugins and update existing plugins. To remove any of these plugins, go to the %splugins%s page and if you have the permission to remove plugins you should be able to do this."
889
  msgstr ""
890
 
891
+ # <div style="text-align: right;">
892
+ # <span><?php _e('Already bought?', 'installer'); ?>&nbsp;</span>
893
+ # <a class="enter_site_key_js button-primary<?php if( WP_Installer::get_repository_hardcoded_site_key( $repository_id ) ): ?> disabled<?php endif ?>" href="#"
894
 
895
+ msgid "Already bought?"
896
  msgstr ""
897
 
898
+ # <input type="hidden" name="repository_id" value="<?php echo $repository_id ?>">
899
+ # <?php _e('2. Enter your site key', 'installer'); ?>
900
+ # <input type="text" size="10" name="site_key_<?php echo $repository_id ?>" placeholder="<?php echo esc_attr('site key') ?>" />
901
 
902
+ msgid "2. Enter your site key"
903
  msgstr ""
904
 
905
+ # <p class="installer-warn-box">
906
+ # <?php _e('Subscription expired. You need to either purchase a new subscription or upgrade if available.', 'installer') ?>
907
+ # <span class="alignright">
908
 
909
+ msgid "Subscription expired. You need to either purchase a new subscription or upgrade if available."
910
  msgstr ""
911
 
912
+ # <a class="update_site_key_js button-secondary" href="#" data-repository=<?php echo $repository_id ?> data-nonce="<?php echo wp_create_nonce('update_site_key_' . $repository_id) ?>">
913
+ # <?php _e('Revalidate subscription', 'installer'); ?>
914
+ # </a>
915
 
916
+ msgid "Revalidate subscription"
917
  msgstr ""
918
 
919
+ # <br />
920
+ # <span class="details"><?php _e("If you have already purchased or renewed your subscription and you can still see this message, please revalidate your subscription", 'installer') ?></span>
921
+ # </p>
922
 
923
+ msgid "If you have already purchased or renewed your subscription and you can still see this message, please revalidate your subscription"
924
  msgstr ""
925
 
926
+ # data-nonce="<?php echo wp_create_nonce('update_site_key_' . $repository_id) ?>">
927
+ # <?php _e('Check for updates', 'installer'); ?>
928
+ # </a>
929
 
930
+ msgid "Check for updates"
931
  msgstr ""
932
 
933
+ # <?php if($subpackages_expandable): ?>
934
+ # <h5><a class="installer_expand_button" href="#" title="<?php esc_attr_e('Click to see individual components options.', 'installer') ?>"><?php _e('Individual components', 'installer') ?></a></h5>
935
+ # <?php endif; ?>
936
 
937
+ msgid "Individual components"
938
  msgstr ""
939
 
940
+ # <input type="text" size="10" name="site_key_<?php echo $repository_id ?>" placeholder="<?php echo esc_attr('site key') ?>" />
941
+ # <input class="button-primary" type="submit" value="<?php esc_attr_e('OK', 'installer') ?>" />
942
+ # <input class="button-secondary cancel_site_key_js" type="button" value="<?php esc_attr_e('Cancel', 'installer') ?>" />
943
 
944
+ msgid "OK"
945
  msgstr ""
946
 
947
+ # <input class="button-primary" type="submit" value="<?php esc_attr_e('OK', 'installer') ?>" />
948
+ # <input class="button-secondary cancel_site_key_js" type="button" value="<?php esc_attr_e('Cancel', 'installer') ?>" />
949
  #
 
 
950
 
951
+ msgid "Cancel"
952
  msgstr ""
953
 
954
+ # <a class="remove_site_key_js button-secondary" href="#" data-repository=<?php echo $repository_id ?>
955
+ # data-confirmation="<?php esc_attr_e('Are you sure you want to unregister?', 'installer') ?>"
956
+ # data-nonce="<?php echo wp_create_nonce('remove_site_key_' . $repository_id) ?>"
957
 
958
+ msgid "Are you sure you want to unregister?"
959
  msgstr ""
960
 
961
+ # <?php if($subpackages_expandable): ?>
962
+ # <h5><a class="installer_expand_button" href="#" title="<?php esc_attr_e('Click to see individual components options.', 'installer') ?>"><?php _e('Individual components', 'installer') ?></a></h5>
963
+ # <?php endif; ?>
964
 
965
+ msgid "Click to see individual components options."
966
  msgstr ""
967
 
968
+ # <td class="twelve">
969
+ # <div class="installer-status-downloading"><?php _e('downloading...', 'installer') ?></div>
970
+ # <div class="installer-status-downloaded" data-fail="<?php _e('failed!', 'installer') ?>"><?php _e('downloaded', 'installer') ?></div>
971
 
972
+ msgid "downloading..."
973
  msgstr ""
974
 
975
+ # <div class="installer-status-downloading"><?php _e('downloading...', 'installer') ?></div>
976
+ # <div class="installer-status-downloaded" data-fail="<?php _e('failed!', 'installer') ?>"><?php _e('downloaded', 'installer') ?></div>
977
+ # </td>
978
 
979
+ msgid "downloaded"
980
  msgstr ""
981
 
 
 
982
  #
983
+ # <span class="installer-revalidate-message hidden"><?php _e("Download failed!\n\nClick OK to revalidate your subscription or CANCEL to try again.", 'installer') ?></span>
984
+ # </form>
985
 
986
+ msgid "Download failed!\n\nClick OK to revalidate your subscription or CANCEL to try again."
987
  msgstr ""
988
 
989
+ # <th><?php _e('Plugin', 'installer') ?></th>
990
+ # <th><img src="<?php echo $this->plugin_url() ?>/res/img/globe.png" alt="<?php esc_attr_e('Available', 'installer') ?>" width="16" height="16"></th>
991
+ # <th><img src="<?php echo $this->plugin_url() ?>/res/img/computer.png" alt="<?php esc_attr_e('Installed', 'installer') ?>" width="16" height="16"></th>
992
 
993
+ msgid "Available"
994
  msgstr ""
995
 
996
+ # <th><img src="<?php echo $this->plugin_url() ?>/res/img/globe.png" alt="<?php esc_attr_e('Available', 'installer') ?>" width="16" height="16"></th>
997
+ # <th><img src="<?php echo $this->plugin_url() ?>/res/img/computer.png" alt="<?php esc_attr_e('Installed', 'installer') ?>" width="16" height="16"></th>
998
+ # <th><img src="<?php echo $this->plugin_url() ?>/res/img/dn2.gif" alt="<?php esc_attr_e('Downloading', 'installer') ?>" width="16" height="16"></th>
999
 
1000
+ msgid "Installed"
1001
  msgstr ""
1002
 
1003
+ # <th><img src="<?php echo $this->plugin_url() ?>/res/img/computer.png" alt="<?php esc_attr_e('Installed', 'installer') ?>" width="16" height="16"></th>
1004
+ # <th><img src="<?php echo $this->plugin_url() ?>/res/img/dn2.gif" alt="<?php esc_attr_e('Downloading', 'installer') ?>" width="16" height="16"></th>
1005
+ # <th><img src="<?php echo $this->plugin_url() ?>/res/img/on.png" alt="<?php esc_attr_e('Activate', 'installer') ?>" width="16" height="16"></th>
1006
 
1007
+ msgid "Downloading"
1008
  msgstr ""
1009
 
1010
+ # <th><img src="<?php echo $this->plugin_url() ?>/res/img/dn2.gif" alt="<?php esc_attr_e('Downloading', 'installer') ?>" width="16" height="16"></th>
1011
+ # <th><img src="<?php echo $this->plugin_url() ?>/res/img/on.png" alt="<?php esc_attr_e('Activate', 'installer') ?>" width="16" height="16"></th>
1012
+ # </tr>
1013
 
1014
+ msgid "Activate"
1015
  msgstr ""
1016
 
1017
+ # $taxonomy_obj = get_taxonomy($taxonomy);
1018
+ # $message = sprintf(__('To translate %s please use the %s translation%s page, inside the %sWooCommerce Multilingual admin%s.', 'woocommerce-multilingual'),
1019
+ # $taxonomy_obj->labels->name,
1020
 
1021
+ msgid "To translate %s please use the %s translation%s page, inside the %sWooCommerce Multilingual admin%s."
1022
  msgstr ""
1023
 
1024
+ #
1025
+ # $response['progress'] = $response['go'] ? sprintf(__('%d products left', 'woocommerce-multilingual'), count($post_ids) - $posts_processed) : __('Synchronization complete!', 'woocommerce-multilingual');
1026
+ #
1027
 
1028
+ msgid "%d products left"
1029
  msgstr ""
1030
 
1031
+ #
1032
+ # $response['progress'] = $response['go'] ? sprintf(__('%d products left', 'woocommerce-multilingual'), count($post_ids) - $posts_processed) : __('Synchronization complete!', 'woocommerce-multilingual');
1033
+ #
1034
 
1035
+ msgid "Synchronization complete!"
1036
  msgstr ""
1037
 
1038
+ # }else{
1039
+ # $errors = sprintf(__('Invalid taxonomy %s', 'woocommerce-multilingual'), $_POST['taxonomy']);
1040
  # }
1041
 
1042
+ msgid "Invalid taxonomy %s"
1043
  msgstr ""
1044
 
1045
+ # $out .= '<input type="hidden" name="taxonomy" value="' . $taxonomy . '" />';
1046
+ # $out .= sprintf(__('Some translated %s have different %s assignments.', 'woocommerce-multilingual'),
1047
+ # '<strong>' . mb_strtolower($wp_post_types[$object_type]->labels->name) . '</strong>',
1048
 
1049
+ msgid "Some translated %s have different %s assignments."
1050
  msgstr ""
1051
 
1052
+ # '<strong>' . mb_strtolower($wp_taxonomies[$taxonomy]->labels->name) . '</strong>');
1053
+ # $out .= '&nbsp;<a class="submit button-secondary" href="#">' . sprintf(__('Update %s for all translated %s', 'woocommerce-multilingual'),
1054
+ # '<strong>' . mb_strtolower($wp_taxonomies[$taxonomy]->labels->name) . '</strong>',
1055
 
1056
+ msgid "Update %s for all translated %s"
1057
  msgstr ""
1058
 
1059
+ # }else{
1060
+ # $out .= sprintf(__('All %s have the same %s assignments.', 'woocommerce-multilingual'),
1061
+ # '<strong>' . mb_strtolower($wp_taxonomies[$taxonomy]->labels->name) . '</strong>',
1062
 
1063
+ msgid "All %s have the same %s assignments."
1064
  msgstr ""
1065
 
1066
+ #
1067
+ # $out .= sprintf(__('Successfully updated %s for all translated %s.', 'woocommerce-multilingual'), $wp_taxonomies[$taxonomy]->labels->name, $wp_post_types[$object_type]->labels->name);
1068
+ #
1069
 
1070
+ msgid "Successfully updated %s for all translated %s."
1071
  msgstr ""
1072
 
1073
+ # 'id' => 'wcml-settings-saved',
1074
+ # 'text' => __('Your settings have been saved.', 'woocommerce-multilingual' ),
1075
+ # 'group' => 'wcml-multi-currency',
1076
 
1077
+ msgid "Your settings have been saved."
1078
  msgstr ""
1079
 
1080
+ #
1081
+ # $args['title'] = empty($_POST['currency']) ? __('Add new currency', 'woocommerce-multilingual') : __('Update currency', 'woocommerce-multilingual');
1082
+ #
1083
 
1084
+ msgid "Add new currency"
1085
  msgstr ""
1086
 
1087
+ #
1088
+ # $args['title'] = empty($_POST['currency']) ? __('Add new currency', 'woocommerce-multilingual') : __('Update currency', 'woocommerce-multilingual');
1089
+ #
1090
+
1091
+ msgid "Update currency"
1092
  msgstr ""
1093
 
1094
  #
1095
+ # $args['title'] = sprintf( __( 'Update settings for %s', 'woocommerce-multilingual' ),
1096
+ # '<strong>' . $args['currency_name'] . ' (' . $args['currency_symbol'] . ')</strong>' );
1097
 
1098
+ msgid "Update settings for %s"
1099
  msgstr ""
1100
 
1101
+ # 'id' => $message_id,
1102
+ # 'text' => sprintf(__('The default currency was changed. In order to show accurate prices in all currencies, you need to update the exchange rates under the %sMulti-currency%s configuration.',
1103
+ # 'woocommerce-multilingual'), '<a href="' . admin_url('admin.php?page=wpml-wcml&tab=multi-currency') . '">', '</a>'),
1104
 
1105
+ msgid "The default currency was changed. In order to show accurate prices in all currencies, you need to update the exchange rates under the %sMulti-currency%s configuration."
1106
  msgstr ""
1107
 
1108
+ # 'interval' => $interval,
1109
+ # 'display' => sprintf( __( 'Monthly on the %s', 'woocommerce-multilingual' ), $month_day ),
1110
+ # );
1111
+
1112
+ msgid "Monthly on the %s"
1113
+ msgstr ""
1114
+
1115
+ # 'interval' => 604800,
1116
+ # 'display' => sprintf( __( 'Weekly on %s', 'woocommerce-multilingual' ), $week_day ),
1117
+ # );
1118
+
1119
+ msgid "Weekly on %s"
1120
+ msgstr ""
1121
+
1122
+ # if( strpos( $json->error->info, 'You have not supplied an API Access Key' ) !== false ){
1123
+ # $error = __('You have entered an incorrect API Access Key', 'woocommerce-multilingual');
1124
+ # }else{
1125
+
1126
+ msgid "You have entered an incorrect API Access Key"
1127
+ msgstr ""
1128
+
1129
+ # } else{
1130
+ # $error = __( 'Cannot get exchange rates. Connection failed.', 'woocommerce-multilingual' );
1131
+ # }
1132
+
1133
+ msgid "Cannot get exchange rates. Connection failed."
1134
+ msgstr ""
1135
+
1136
+ # if( !is_numeric( $rate ) ){
1137
+ # $error = sprintf( __("Error reading the exchange rate for %s. Please try again. If the error persist, try selecting a different exchange rate service.", 'woocommerce-multilingual' ), $to );
1138
+ # parent::save_last_error( $error );
1139
+
1140
+ msgid "Error reading the exchange rate for %s. Please try again. If the error persist, try selecting a different exchange rate service."
1141
+ msgstr ""
1142
+
1143
+ # <?php if(empty($orders_currencies)): ?>
1144
+ # <option value=""><?php _e('Currency - no orders found', 'woocommerce-multilingual') ?></option>
1145
+ # <?php else: ?>
1146
+
1147
+ msgid "Currency - no orders found"
1148
+ msgstr ""
1149
+
1150
+ # $woocommerce_wpml->update_settings();
1151
+ # echo json_encode( array('message' => __( 'Currencies order updated', 'woocommerce-multilingual' )) );
1152
+ # die;
1153
+
1154
+ msgid "Currencies order updated"
1155
+ msgstr ""
1156
+
1157
+ #
1158
+ # $preview = '<i>' . __("You haven't added any secondary currencies.", 'woocommerce-multilingual') . '</i>';
1159
  #
1160
 
1161
+ msgid "You haven't added any secondary currencies."
1162
  msgstr ""
1163
 
1164
+ #
1165
+ # parent::__construct( 'currency_sel_widget', __('Currency switcher', 'woocommerce-multilingual'), __('Currency switcher', 'woocommerce-multilingual'));
1166
+ # }
1167
 
1168
+ msgid "Currency switcher"
1169
  msgstr ""
1170
 
1171
  #
1172
+ # printf('<p><a href="%s">%s</a></p>',admin_url('admin.php?page=wpml-wcml&tab=multi-currency#currency-switcher'),__('Configure options', 'woocommerce-multilingual'));
1173
+ # return;
1174
+
1175
+ msgid "Configure options"
1176
+ msgstr ""
1177
+
1178
  #
1179
+ # if(confirm('" . esc_js(__("All the products will be removed from the current order in order to change the currency", 'woocommerce-multilingual')). "')){
1180
+ # jQuery.ajax({
1181
 
1182
+ msgid "All the products will be removed from the current order in order to change the currency"
1183
  msgstr ""
1184
 
1185
+ # <select id="dropdown_shop_order_currency" name="_order_currency">
1186
+ # <option value=""><?php _e( 'Show all currencies', 'woocommerce-multilingual' ) ?></option>
1187
+ # <?php foreach($order_currencies as $currency => $count): ?>
1188
 
1189
+ msgid "Show all currencies"
1190
  msgstr ""
1191
 
1192
+ # <li class="wide">
1193
+ # <label><?php _e('Order currency:', 'woocommerce-multilingual'); ?></label>
1194
+ # <select id="dropdown_shop_order_currency" name="wcml_shop_order_currency">
1195
+
1196
+ msgid "Order currency:"
1197
+ msgstr ""
1198
+
1199
+ # 'strings' => array(
1200
+ # 'choose' => __( 'Choose a file', 'woocommerce_multilingual' ),
1201
+ # 'save_tooltip' => __( 'At least one of these fields is required: title, content or excerpt', 'woocommerce_multilingual' ),
1202
+
1203
+ msgid "Choose a file"
1204
+ msgstr ""
1205
+
1206
+ # 'choose' => __( 'Choose a file', 'woocommerce_multilingual' ),
1207
+ # 'save_tooltip' => __( 'At least one of these fields is required: title, content or excerpt', 'woocommerce_multilingual' ),
1208
+ # 'resign_tooltip'=> __( 'This translation job will no longer be assigned to you. Other translators will be able take it and continue the translation.', 'woocommerce-multilingual')
1209
+
1210
+ msgid "At least one of these fields is required: title, content or excerpt"
1211
+ msgstr ""
1212
+
1213
+ # 'save_tooltip' => __( 'At least one of these fields is required: title, content or excerpt', 'woocommerce_multilingual' ),
1214
+ # 'resign_tooltip'=> __( 'This translation job will no longer be assigned to you. Other translators will be able take it and continue the translation.', 'woocommerce-multilingual')
1215
+ # ),
1216
+
1217
+ msgid "This translation job will no longer be assigned to you. Other translators will be able take it and continue the translation."
1218
+ msgstr ""
1219
+
1220
+ # echo '<img src="' . WCML_PLUGIN_URL . '/res/images/locked.png" class="wcml_lock_img wcml_lock_icon" alt="' .
1221
+ # __( 'This field is locked for editing because WPML will copy its value from the original language.', 'woocommerce-multilingual' ) .
1222
+ # '" title="' . __( 'This field is locked for editing because WPML will copy its value from the original language.', 'woocommerce-multilingual' ) .
1223
+
1224
+ msgid "This field is locked for editing because WPML will copy its value from the original language."
1225
+ msgstr ""
1226
+
1227
+ # echo '<h3 class="wcml_prod_hidden_notice">' .
1228
+ # sprintf( __( "This is a translation of %s. Some of the fields are not editable. It's recommended to use the %s for translating products.",
1229
+ # 'woocommerce-multilingual' ),
1230
+
1231
+ msgid "This is a translation of %s. Some of the fields are not editable. It's recommended to use the %s for translating products."
1232
+ msgstr ""
1233
+
1234
+ # '<a data-action="product-translation-dialog" class="js-wcml-dialog-trigger" data-id="' . $original_id . '" data-job_id="" data-language="' . $language . '">' .
1235
+ # __( 'WooCommerce Multilingual products translator', 'woocommerce-multilingual' ) . '</a>' ) . '</h3>';
1236
  # }
1237
 
1238
+ msgid "WooCommerce Multilingual products translator"
1239
  msgstr ""
1240
 
1241
+ # $widget_opt = array(
1242
+ # 'description' => __( 'Shows a list of the products that existed in the cart before the cart is reset on the front end after switching the language or the currency. It will be hidden when there are no products to show.', 'woocommerce-multilingual' ),
1243
+ # );
1244
+
1245
+ msgid "Shows a list of the products that existed in the cart before the cart is reset on the front end after switching the language or the currency. It will be hidden when there are no products to show."
1246
+ msgstr ""
1247
+
1248
+ # 'wcml_cart_deleted_items',
1249
+ # __( 'Products before cart reset', 'woocommerce-multilingual' ),
1250
+ # $widget_opt
1251
+
1252
+ msgid "Products before cart reset"
1253
+ msgstr ""
1254
+
1255
+ #
1256
+ # $dialog_title = __( 'Switching currency?', 'woocommerce-multilingual');
1257
+ # $confirmation_message = __( 'Your cart is not empty! After you switched the currency, all items from the cart will be removed and you have to add them again.', 'woocommerce-multilingual');
1258
+
1259
+ msgid "Switching currency?"
1260
+ msgstr ""
1261
+
1262
+ # $dialog_title = __( 'Switching currency?', 'woocommerce-multilingual');
1263
+ # $confirmation_message = __( 'Your cart is not empty! After you switched the currency, all items from the cart will be removed and you have to add them again.', 'woocommerce-multilingual');
1264
+ # $stay_in = sprintf( __( 'Keep using %s', 'woocommerce-multilingual'), $current_currency );
1265
+
1266
+ msgid "Your cart is not empty! After you switched the currency, all items from the cart will be removed and you have to add them again."
1267
+ msgstr ""
1268
+
1269
+ # $confirmation_message = __( 'Your cart is not empty! After you switched the currency, all items from the cart will be removed and you have to add them again.', 'woocommerce-multilingual');
1270
+ # $stay_in = sprintf( __( 'Keep using %s', 'woocommerce-multilingual'), $current_currency );
1271
+ # $switch_to = __( 'Proceed', 'woocommerce-multilingual');
1272
+
1273
+ msgid "Keep using %s"
1274
+ msgstr ""
1275
+
1276
+ # $stay_in = sprintf( __( 'Keep using %s', 'woocommerce-multilingual'), $current_currency );
1277
+ # $switch_to = __( 'Proceed', 'woocommerce-multilingual');
1278
+ #
1279
+
1280
+ msgid "Proceed"
1281
+ msgstr ""
1282
+
1283
+ # if( apply_filters( 'wcml_add_to_cart_sold_individually', true, $cart_item_data, $product_id, $quantity ) && $current_product_trid == $cart_element_trid && $cart_item[ 'quantity' ] > 0 ){
1284
+ # throw new Exception( sprintf( '<a href="%s" class="button wc-forward">%s</a> %s', wc_get_cart_url(), __( 'View cart', 'woocommerce' ), sprintf( __( 'You cannot add another "%s" to your cart.', 'woocommerce' ), get_the_title( $product_id ) ) ) );
1285
  # }
1286
 
1287
+ msgid "View cart"
1288
  msgstr ""
1289
 
1290
+ # if( apply_filters( 'wcml_add_to_cart_sold_individually', true, $cart_item_data, $product_id, $quantity ) && $current_product_trid == $cart_element_trid && $cart_item[ 'quantity' ] > 0 ){
1291
+ # throw new Exception( sprintf( '<a href="%s" class="button wc-forward">%s</a> %s', wc_get_cart_url(), __( 'View cart', 'woocommerce' ), sprintf( __( 'You cannot add another "%s" to your cart.', 'woocommerce' ), get_the_title( $product_id ) ) ) );
1292
  # }
1293
 
1294
+ msgid "You cannot add another \"%s\" to your cart."
1295
  msgstr ""
1296
 
1297
  # input.parent().append('<div class="translation_controls"></div>');
1385
  msgid "To quickly translate this and other WooCommerce store pages, please run the %ssetup wizard%s."
1386
  msgstr ""
1387
 
1388
+ # ?>
1389
+ # <div class="message error"><p><?php printf(__('WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href="%s">WPML</a> versions prior %s.',
1390
+ # 'woocommerce-multilingual'), WCML_Links::generate_tracking_link('https://wpml.org/'), '3.4'); ?></p></div>
1391
 
1392
+ msgid "WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href=\"%s\">WPML</a> versions prior %s."
1393
  msgstr ""
1394
 
1395
+ # ?>
1396
+ # <div class="message error"><p><?php printf(__('WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href="%s">Woocommerce</a> versions prior %s.',
1397
+ # 'woocommerce-multilingual'), 'http://www.woothemes.com/woocommerce/', '2.1' ); ?></p></div>
1398
 
1399
+ msgid "WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href=\"%s\">Woocommerce</a> versions prior %s."
1400
  msgstr ""
1401
 
1402
+ # ?>
1403
+ # <div class="message error"><p><?php printf(__('WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href="%s">WPML Translation Management</a> versions prior %s.',
1404
+ # 'woocommerce-multilingual'), WCML_Links::generate_tracking_link('https://wpml.org/'), '1.9'); ?></p></div>
1405
 
1406
+ msgid "WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href=\"%s\">WPML Translation Management</a> versions prior %s."
 
1407
  msgstr ""
1408
 
1409
+ # ?>
1410
+ # <div class="message error"><p><?php printf(__('WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href="%s">WPML String Translation</a> versions prior %s.',
1411
+ # 'woocommerce-multilingual'), WCML_Links::generate_tracking_link('https://wpml.org/'), '2.0'); ?></p></div>
1412
 
1413
+ msgid "WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href=\"%s\">WPML String Translation</a> versions prior %s."
1414
  msgstr ""
1415
 
1416
+ # ?>
1417
+ # <div class="message error"><p><?php printf(__('WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href="%s">WPML Media</a> versions prior %s.',
1418
+ # 'woocommerce-multilingual'), WCML_Links::generate_tracking_link('https://wpml.org/'), '2.1'); ?></p></div>
1419
 
1420
+ msgid "WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href=\"%s\">WPML Media</a> versions prior %s."
1421
  msgstr ""
1422
 
1423
+ # } elseif ($counter == sizeof($this->missing) - 1) {
1424
+ # $sep = ' ' . __('and', 'woocommerce-multilingual') . ' ';
1425
+ # } else {
1426
 
1427
+ msgid "and"
1428
  msgstr ""
1429
 
1430
+ #
1431
+ # <div class="message error"><p><?php printf(__('WooCommerce Multilingual is enabled but not effective. It requires %s in order to work.', 'woocommerce-multilingual'), $missing); ?></p></div>
1432
+ # <?php
1433
 
1434
+ msgid "WooCommerce Multilingual is enabled but not effective. It requires %s in order to work."
1435
  msgstr ""
1436
 
1437
+ # $message .= '<br /><br />';
1438
+ # $message .= '<a href="' . admin_url('options-permalink.php') . '">' . __('Permalink settings', 'woocommerce-multilingual') . '</a>';
1439
+ # $message .= ' | ';
1440
 
1441
+ msgid "Permalink settings"
1442
  msgstr ""
1443
 
1444
+ # $message .= ' | ';
1445
+ # $message .= '<a href="' . admin_url('admin.php?page=' . WPML_TM_FOLDER . '/menu/main.php&sm=mcsetup#icl_custom_posts_sync_options') . '">' . __('Configure products slug translation', 'woocommerce-multilingual') . '</a>';
1446
+ #
1447
 
1448
+ msgid "Configure products slug translation"
1449
  msgstr ""
1450
 
1451
+ # if (!$allsame) {
1452
+ # $this->err_message = '<div class="message error"><p>'.printf(__('If you want different slugs for shop pages (%s/%s), you need to disable the shop prefix for products in <a href="%s">WooCommerce Settings</a>', 'woocommerce-multilingual'),
1453
+ # $slug, $translated_slug, admin_url("admin.php?page=woocommerce_settings&tab=pages")).'</p></div>';
1454
 
1455
+ msgid "If you want different slugs for shop pages (%s/%s), you need to disable the shop prefix for products in <a href=\"%s\">WooCommerce Settings</a>"
1456
  msgstr ""
1457
 
1458
+ #
1459
+ # $ret['success_1'] = '&nbsp;' . sprintf(__('Finished! You can visit the %sstrings translation%s screen to translate the strings now.', 'woocommerce-multilingual'), '<a href="' . admin_url('admin.php?page=' . WPML_ST_FOLDER . '/menu/string-translation.php') . '">', '</a>');
1460
+ #
1461
 
1462
+ msgid "Finished! You can visit the %sstrings translation%s screen to translate the strings now."
1463
  msgstr ""
1464
 
1465
+ # if(!file_exists($file)){
1466
+ # $this->xml_config_errors[] = __('wpml-config.xml file missing from WooCommerce Multilingual folder.', 'woocommerce-multilingual');
1467
+ # }else{
1468
 
1469
+ msgid "wpml-config.xml file missing from WooCommerce Multilingual folder."
1470
  msgstr ""
1471
 
1472
+ # if($effective_config_value != $correct_config_value){
1473
+ # $this->xml_config_errors[] = sprintf(__('Custom field %s configuration from wpml-config.xml file was altered!', 'woocommerce-multilingual'), '<i>' . $cf['value'] . '</i>');
1474
+ # }
1475
 
1476
+ msgid "Custom field %s configuration from wpml-config.xml file was altered!"
1477
  msgstr ""
1478
 
1479
+ # if($effective_config_value != $correct_config_value){
1480
+ # $this->xml_config_errors[] = sprintf(__('Custom type %s configuration from wpml-config.xml file was altered!', 'woocommerce-multilingual'), '<i>' . $ct['value'] . '</i>');
1481
+ # }
1482
 
1483
+ msgid "Custom type %s configuration from wpml-config.xml file was altered!"
1484
  msgstr ""
1485
 
1486
+ # if($effective_config_value != $correct_config_value){
1487
+ # $this->xml_config_errors[] = sprintf(__('Custom taxonomy %s configuration from wpml-config.xml file was altered!', 'woocommerce-multilingual'), '<i>' . $tx['value'] . '</i>');
1488
+ # }
1489
 
1490
+ msgid "Custom taxonomy %s configuration from wpml-config.xml file was altered!"
1491
  msgstr ""
1492
 
1493
+ # $current_language_details = $sitepress->get_language_details( $this->lang_from );
1494
+ # $dialog_title = __( 'Switching language?', 'woocommerce-multilingual' );
1495
+ # $confirmation_message = sprintf( __( "You've switched language and there are items in the cart. If you keep the %s language, the cart will be emptied and you will have to add the items again to the cart.", 'woocommerce-multilingual' ), $new_language_details[ 'display_name' ] );
1496
 
1497
+ msgid "Switching language?"
1498
  msgstr ""
1499
 
1500
+ # $dialog_title = __( 'Switching language?', 'woocommerce-multilingual' );
1501
+ # $confirmation_message = sprintf( __( "You've switched language and there are items in the cart. If you keep the %s language, the cart will be emptied and you will have to add the items again to the cart.", 'woocommerce-multilingual' ), $new_language_details[ 'display_name' ] );
1502
+ # $stay_in = sprintf( __( 'Stay in %s', 'woocommerce-multilingual' ), $new_language_details[ 'display_name' ] );
1503
 
1504
+ msgid "You've switched language and there are items in the cart. If you keep the %s language, the cart will be emptied and you will have to add the items again to the cart."
1505
  msgstr ""
1506
 
1507
+ # $confirmation_message = sprintf( __( "You've switched language and there are items in the cart. If you keep the %s language, the cart will be emptied and you will have to add the items again to the cart.", 'woocommerce-multilingual' ), $new_language_details[ 'display_name' ] );
1508
+ # $stay_in = sprintf( __( 'Stay in %s', 'woocommerce-multilingual' ), $new_language_details[ 'display_name' ] );
1509
+ # $switch_to = sprintf( __( 'Switch back to %s', 'woocommerce-multilingual' ), $current_language_details[ 'display_name' ] );
1510
 
1511
+ msgid "Stay in %s"
1512
  msgstr ""
1513
 
1514
+ # $stay_in = sprintf( __( 'Stay in %s', 'woocommerce-multilingual' ), $new_language_details[ 'display_name' ] );
1515
+ # $switch_to = sprintf( __( 'Switch back to %s', 'woocommerce-multilingual' ), $current_language_details[ 'display_name' ] );
1516
+ #
1517
 
1518
+ msgid "Switch back to %s"
1519
  msgstr ""
1520
 
1521
+ # }elseif( isset( $product_translations[ $language[ 'code' ] ] ) && $product_translations[ $language[ 'code' ] ]->original ) { ?>
1522
+ # <span title="<?php echo $language['english_name'] . ': ' . __('Original language', 'woocommerce-multilingual'); ?>">
1523
+ # <i class="otgs-ico-original"></i>
1524
 
1525
+ msgid "Original language"
1526
  msgstr ""
1527
 
1528
+ # ?>
1529
+ # <a href="<?php echo $edit_url ?>" title="<?php echo $language[ 'english_name' ] . ': ' . __( 'Take this and edit', 'woocommerce-multilingual' ); ?>">
1530
+ # <i class="otgs-ico-add"></i>
1531
 
1532
+ msgid "Take this and edit"
1533
  msgstr ""
1534
 
1535
+ # if (!$tr_status ) { ?>
1536
+ # title="<?php echo $language[ 'english_name' ] . ': ' . __( 'Add translation', 'woocommerce-multilingual' ); ?>">
1537
+ # <i class="otgs-ico-add"></i>
1538
 
1539
+ msgid "Add translation"
1540
  msgstr ""
1541
 
1542
+ # <?php }elseif( $tr_status->needs_update ){ ?>
1543
+ # title="<?php echo $language[ 'english_name' ] . ': ' . __( 'Update translation', 'woocommerce-multilingual' ); ?>">
1544
+ # <i class="otgs-ico-refresh"></i>
1545
 
1546
+ msgid "Update translation"
1547
  msgstr ""
1548
 
1549
+ # <?php }elseif( $tr_status->status != ICL_TM_COMPLETE && $tr_status->status != ICL_TM_DUPLICATE ){ ?>
1550
+ # title="<?php echo $language[ 'english_name' ] . ': ' . __( 'Finish translating', 'woocommerce-multilingual' ); ?>">
1551
+ # <i class="otgs-ico-refresh"></i>
1552
 
1553
+ msgid "Finish translating"
1554
  msgstr ""
1555
 
1556
+ # <?php }elseif( $tr_status->status == ICL_TM_COMPLETE ){ ?>
1557
+ # title="<?php echo $language[ 'english_name' ] . ': ' . __( 'Edit translation', 'woocommerce-multilingual' ); ?>">
1558
+ # <i class="otgs-ico-edit"></i>
1559
 
1560
+ msgid "Edit translation"
1561
  msgstr ""
1562
 
1563
+ # $new_actions[ 'quick_hide' ] = '<a href="#TB_inline?width=200&height=150&inlineId=quick_edit_notice" class="thickbox" title="' .
1564
+ # __('Edit this item inline', 'woocommerce-multilingual') . '">' .
1565
+ # __('Quick Edit', 'woocommerce-multilingual') . '</a>';
1566
 
1567
+ msgid "Edit this item inline"
1568
  msgstr ""
1569
 
1570
+ # __('Edit this item inline', 'woocommerce-multilingual') . '">' .
1571
+ # __('Quick Edit', 'woocommerce-multilingual') . '</a>';
1572
+ # } else {
1573
 
1574
+ msgid "Quick Edit"
1575
  msgstr ""
1576
 
1577
+ # if( $tr_status->status == ICL_TM_IN_PROGRESS ) { ?>
1578
+ # <a title="<?php _e( 'Translation in progress', 'woocommerce-multilingual' ); ?>"><i
1579
+ # class="otgs-ico-in-progress"></i></a>
1580
 
1581
+ msgid "Translation in progress"
1582
  msgstr ""
1583
 
1584
+ # jQuery('#dropdown_shop_order_language').on('change', function(){
1585
+ # if(confirm('" . esc_js(__("All the products will be removed from the current order in order to change the language", 'woocommerce-multilingual')). "')){
1586
+ # var lang = jQuery(this).val();
1587
 
1588
+ msgid "All the products will be removed from the current order in order to change the language"
1589
  msgstr ""
1590
 
1591
+ # <li class="wide">
1592
+ # <label><?php _e('Order language:'); ?></label>
1593
+ # <select id="dropdown_shop_order_language" name="wcml_shop_order_language">
1594
 
1595
+ msgid "Order language:"
1596
  msgstr ""
1597
 
1598
+ # $slug = $this->get_woocommerce_product_base();
1599
+ # $return['name'] = __('Product Base', 'woocommerce-multilingual');
1600
+ # break;
1601
 
1602
+ msgid "Product Base"
1603
  msgstr ""
1604
 
1605
+ # $slug = !empty( $this->wc_permalinks['tag_base'] ) ? trim( $this->wc_permalinks['tag_base'], '/' ) : 'product-tag';
1606
+ # $return['name'] = __('Product Tag Base', 'woocommerce-multilingual');
1607
+ # break;
1608
 
1609
+ msgid "Product Tag Base"
1610
  msgstr ""
1611
 
1612
+ # $slug = !empty( $this->wc_permalinks['category_base'] ) ? trim( $this->wc_permalinks['category_base'], '/' ) : 'product-category';
1613
+ # $return['name'] = __('Product Category Base', 'woocommerce-multilingual');
1614
+ # break;
1615
 
1616
+ msgid "Product Category Base"
1617
  msgstr ""
1618
 
1619
+ # $slug = trim( $this->wc_permalinks['attribute_base'], '/' );
1620
+ # $return['name'] = __('Product Attribute Base', 'woocommerce-multilingual');
1621
+ # break;
1622
 
1623
+ msgid "Product Attribute Base"
1624
  msgstr ""
1625
 
1626
+ # case 'attribute_slug':
1627
+ # $return['name'] = __('Attribute Slug', 'woocommerce-multilingual');
1628
+ # $string_id = icl_get_string_id( $slug, $this->url_strings_context(), $this->url_string_name( $base, $slug ) );
1629
 
1630
+ msgid "Attribute Slug"
1631
  msgstr ""
1632
 
1633
+ # $slug = isset( $endpoints[ $base ] ) ? $endpoints[ $base ] : false ;
1634
+ # $return['name'] = sprintf( __('Endpoint: %s', 'woocommerce-multilingual'), $base);
1635
+ # $string_id = icl_get_string_id( $slug, 'WooCommerce Endpoints', $base );
1636
 
1637
+ msgid "Endpoint: %s"
1638
  msgstr ""
1639
 
1640
+ # $this->default_product_tag_base = 'product-tag';
1641
+ # $this->default_product_category_gettext_base = _x( 'product-category', 'slug', 'woocommerce' );
1642
+ # $this->default_product_tag_gettext_base = _x( 'product-tag', 'slug', 'woocommerce' );
1643
 
1644
+ msgctxt "slug"
1645
+ msgid "product-category"
1646
  msgstr ""
1647
 
1648
+ # $this->default_product_category_gettext_base = _x( 'product-category', 'slug', 'woocommerce' );
1649
+ # $this->default_product_tag_gettext_base = _x( 'product-tag', 'slug', 'woocommerce' );
1650
+ #
1651
 
1652
+ msgctxt "slug"
1653
+ msgid "product-tag"
1654
  msgstr ""
1655
 
1656
+ # array(
1657
+ # 'warn' => __( "Downloading translations... Please don't close this page.", 'woocommerce-multilingual' )
1658
+ # )
1659
 
1660
+ msgid "Downloading translations... Please don't close this page."
1661
  msgstr ""
1662
 
1663
+ # <p>
1664
+ # <?php printf(__("You've successfully installed %sWooCommerce Multilingual%s. Would you like to see a quick overview?", 'woocommerce-multilingual'), '<strong>', '</strong>'); ?>
1665
+ # </p>
1666
 
1667
+ msgid "You've successfully installed %sWooCommerce Multilingual%s. Would you like to see a quick overview?"
1668
  msgstr ""
1669
 
1670
+ # <p>
1671
+ # <?php printf(__("We detected a problem in your WPML configuration: the %sproduct_type%s taxonomy is set as translatable and this would cause problems with translated products. You can fix this in the %sMultilingual Content Setup page%s.", 'woocommerce-multilingual'), '<i>', '</i>','<a href="' . admin_url( 'admin.php?page=' . WPML_TM_FOLDER . '/menu/main.php&sm=mcsetup#ml-content-setup-sec-8' ) . '">','</a>'); ?>
1672
+ # </p>
1673
 
1674
+ msgid "We detected a problem in your WPML configuration: the %sproduct_type%s taxonomy is set as translatable and this would cause problems with translated products. You can fix this in the %sMultilingual Content Setup page%s."
1675
  msgstr ""
1676
 
1677
+ # <p>
1678
+ # <?php printf(__("We detected that the %sproduct_type%s field was set incorrectly for some product translations. This happened because the product_type taxonomy was translated. You can fix this in the WooCommerce Multilingual %stroubleshooting page%s.", 'woocommerce-multilingual'), '<i>', '</i>','<a href="' . admin_url( 'admin.php?page=wpml-wcml&tab=troubleshooting' ) . '">','</a>'); ?>
1679
+ # </p>
1680
 
1681
+ msgid "We detected that the %sproduct_type%s field was set incorrectly for some product translations. This happened because the product_type taxonomy was translated. You can fix this in the WooCommerce Multilingual %stroubleshooting page%s."
1682
  msgstr ""
1683
 
1684
+ # <a class="button-primary align-right" href="<?php echo WCML_Links::generate_tracking_link('https://wpml.org/documentation/related-projects/woocommerce-multilingual/','woocommerce-multilingual','documentation'); ?>" target="_blank">
1685
+ # <?php _e('Learn how to turn your e-commerce site multilingual', 'woocommerce-multilingual') ?>
1686
+ # </a>
1687
 
1688
+ msgid "Learn how to turn your e-commerce site multilingual"
1689
  msgstr ""
1690
 
1691
+ # </p>
1692
+ # <a class="notice-dismiss" href="<?php echo $url; ?>"><span class="screen-reader-text"><?php _e('Dismiss', 'woocommerce-multilingual') ?></span></a>
1693
+ # </div>
1694
 
1695
+ msgid "Dismiss"
1696
  msgstr ""
1697
 
1698
+ # 'show' => 1,
1699
+ # 'text' => __('Looks like you are upgrading from a previous version of WooCommerce Multilingual. Would you like to automatically create translated variations and images?', 'wcml').
1700
+ # '<br /><strong>' .
1701
 
1702
+ msgid "Looks like you are upgrading from a previous version of WooCommerce Multilingual. Would you like to automatically create translated variations and images?"
1703
  msgstr ""
1704
 
1705
+ # '<br /><strong>' .
1706
+ # ' <a href="' . admin_url('admin.php?page=wpml-wcml&tab=troubleshooting') . '">' . __('Yes, go to the troubleshooting page', 'wcml') . '</a> |' .
1707
+ # ' <a href="#" onclick="jQuery.ajax({type:\'POST\',url: ajaxurl,data:\'action=wcml_hide_notice&notice='.$n.'\',success:function(){jQuery(\'#' . $n . '\').fadeOut()}});return false;">' . __('No - dismiss', 'wcml') . '</a>' .
1708
 
1709
+ msgid "Yes, go to the troubleshooting page"
1710
  msgstr ""
1711
 
1712
+ # ' <a href="' . admin_url('admin.php?page=wpml-wcml&tab=troubleshooting') . '">' . __('Yes, go to the troubleshooting page', 'wcml') . '</a> |' .
1713
+ # ' <a href="#" onclick="jQuery.ajax({type:\'POST\',url: ajaxurl,data:\'action=wcml_hide_notice&notice='.$n.'\',success:function(){jQuery(\'#' . $n . '\').fadeOut()}});return false;">' . __('No - dismiss', 'wcml') . '</a>' .
1714
+ # '</strong>'
1715
 
1716
+ msgid "No - dismiss"
1717
  msgstr ""
1718
 
1719
+ #
1720
+ # printf( '<p>'.__('In order to edit custom attributes you need to use the <a href="%s">custom product translation editor</a>', 'woocommerce-multilingual').'</p>', admin_url('admin.php?page=wpml-wcml&tab=products&prid='.$original_product_id ) );
1721
+ # }
1722
 
1723
+ msgid "In order to edit custom attributes you need to use the <a href=\"%s\">custom product translation editor</a>"
1724
  msgstr ""
1725
 
1726
+ # jQuery('input[name="woocommerce_product_category_slug"]').parent().append('<br><i class="icon-warning-sign"><?php
1727
+ # _e('You are using the same value as for the regular category base. This is known to create conflicts resulting in urls not working properly.', 'woocommerce-multilingual') ?></i>');
1728
+ # }
1729
 
1730
+ msgid "You are using the same value as for the regular category base. This is known to create conflicts resulting in urls not working properly."
1731
  msgstr ""
1732
 
1733
+ # if( empty( $permalink_options['product_base'] ) ){
1734
+ # $value = _x( 'product', 'default-slug', 'woocommerce' );
1735
+ # }else{
1736
 
1737
+ msgctxt "default-slug"
1738
+ msgid "product"
1739
  msgstr ""
1740
 
1741
+ # 'strings' => array(
1742
+ # 'title' => __('WooCommerce Multilingual', 'woocommerce-multilingual'),
1743
+ # 'untranslated_terms'=> __('You have untranslated terms!', 'woocommerce-multilingual')
1744
 
1745
+ msgid "WooCommerce Multilingual"
1746
  msgstr ""
1747
 
1748
+ # 'title' => __('WooCommerce Multilingual', 'woocommerce-multilingual'),
1749
+ # 'untranslated_terms'=> __('You have untranslated terms!', 'woocommerce-multilingual')
1750
  # ),
1751
 
1752
+ msgid "You have untranslated terms!"
1753
  msgstr ""
1754
 
1755
+ # 'products' => array(
1756
+ # 'title' => __('Products', 'woocommerce-multilingual'),
1757
+ # 'url' => admin_url('admin.php?page=wpml-wcml'),
1758
 
1759
+ msgid "Products"
1760
  msgstr ""
1761
 
1762
+ # 'product_cat' => array(
1763
+ # 'name' => __('Categories', 'woocommerce-multilingual'),
1764
+ # 'title' => !$this->woocommerce_wpml->terms->is_fully_translated( 'product_cat' ) ? __('You have untranslated terms!', 'woocommerce-multilingual') : '',
1765
 
1766
+ msgid "Categories"
1767
  msgstr ""
1768
 
1769
+ # 'product_tag' => array(
1770
+ # 'name' => __('Tags', 'woocommerce-multilingual'),
1771
+ # 'title' => !$this->woocommerce_wpml->terms->is_fully_translated( 'product_tag' ) ? __('You have untranslated terms!', 'woocommerce-multilingual') : '',
1772
 
1773
+ msgid "Tags"
1774
  msgstr ""
1775
 
1776
+ # 'custom_taxonomies' => array(
1777
+ # 'name' => __('Custom Taxonomies', 'woocommerce-multilingual'),
1778
+ # 'active' => $current_tab == 'custom-taxonomies' ? 'nav-tab-active':'',
1779
 
1780
+ msgid "Custom Taxonomies"
1781
  msgstr ""
1782
 
1783
+ # 'attributes' => array(
1784
+ # 'name' => __('Attributes', 'woocommerce-multilingual'),
1785
+ # 'active' => $current_tab == 'product-attributes' ? 'nav-tab-active':'',
1786
 
1787
+ msgid "Attributes"
1788
  msgstr ""
1789
 
1790
+ # 'shipping_classes' => array(
1791
+ # 'name' => __('Shipping Classes', 'woocommerce-multilingual'),
1792
+ # 'title' => !$this->woocommerce_wpml->terms->is_fully_translated( 'product_shipping_class' ) ? __('You have untranslated terms!', 'woocommerce-multilingual') : '',
1793
 
1794
+ msgid "Shipping Classes"
1795
  msgstr ""
1796
 
1797
+ # 'settings' => array(
1798
+ # 'name' => __( 'Settings', 'woocommerce-multilingual' ),
1799
+ # 'active' => $current_tab == 'settings' ? 'nav-tab-active':'',
1800
 
1801
+ msgid "Settings"
1802
  msgstr ""
1803
 
1804
+ # 'multi_currency' => array(
1805
+ # 'name' => __( 'Multi-currency', 'woocommerce-multilingual' ),
1806
+ # 'active' => $current_tab == 'multi-currency' ? 'nav-tab-active':'',
1807
 
1808
+ msgid "Multi-currency"
1809
  msgstr ""
1810
 
1811
+ # 'slugs' => array(
1812
+ # 'name' => __( 'Store URLs', 'woocommerce-multilingual' ),
1813
+ # 'active' => $current_tab == 'slugs' ? 'nav-tab-active':'',
1814
 
1815
+ msgid "Store URLs"
1816
  msgstr ""
1817
 
1818
+ # 'status' => array(
1819
+ # 'name' => __( 'Status', 'woocommerce-multilingual' ),
1820
+ # 'active' => $current_tab == 'status' ? 'nav-tab-active':'',
1821
 
1822
+ msgid "Status"
1823
  msgstr ""
1824
 
1825
+ # 'troubleshooting' => array(
1826
+ # 'name' => __( 'Troubleshooting', 'woocommerce-multilingual' ),
1827
+ # 'active' => $current_tab == 'troubleshooting' ? 'nav-tab-active':'',
1828
 
1829
+ msgid "Troubleshooting"
1830
  msgstr ""
1831
 
1832
+ # 'on' => !isset( $this->woocommerce_wpml->settings['rate-block'] ),
1833
+ # 'message' => sprintf(__('Thank you for using %sWooCommerce Multilingual%s! You can express your love and
1834
+ # support by %s rating our plugin and saying that %sit works%s for you.', 'woocommerce_wpml'),
1835
 
1836
+ msgid "Thank you for using %sWooCommerce Multilingual%s! You can express your love and\n support by %s rating our plugin and saying that %sit works%s for you."
1837
  msgstr ""
1838
 
 
 
1839
  # ),
1840
+ # 'hide_text' => __('Hide','woocommerce-multilingual'),
1841
+ # 'nonce' => wp_nonce_field('wcml_settings', 'wcml_settings_nonce', true, false)
1842
 
1843
+ msgid "Hide"
1844
  msgstr ""
1845
 
1846
+ # ?>
1847
+ # <div class="wpml-loading-taxonomy"><span class="spinner is-active"></span><?php echo __( 'Loading ...', 'woocommerce-multilingual' ) ?></div>
1848
+ # <div class="wpml_taxonomy_loaded" style="display:none">
1849
 
1850
+ msgid "Loading ..."
1851
  msgstr ""
1852
 
1853
  # 'strings' => array(
1854
+ # 'image' => __( 'Image', 'woocommerce-multilingual' ),
1855
+ # 'product' => __( 'Product', 'woocommerce-multilingual' ),
1856
 
1857
+ msgid "Image"
1858
  msgstr ""
1859
 
1860
+ # 'image' => __( 'Image', 'woocommerce-multilingual' ),
1861
+ # 'product' => __( 'Product', 'woocommerce-multilingual' ),
1862
+ # 'type' => __( 'Type', 'woocommerce-multilingual' ),
1863
 
1864
+ msgid "Product"
1865
  msgstr ""
1866
 
1867
+ # 'product' => __( 'Product', 'woocommerce-multilingual' ),
1868
+ # 'type' => __( 'Type', 'woocommerce-multilingual' ),
1869
+ # 'date' => __( 'Date', 'woocommerce-multilingual' ),
1870
 
1871
+ msgid "Type"
1872
  msgstr ""
1873
 
1874
+ # 'type' => __( 'Type', 'woocommerce-multilingual' ),
1875
+ # 'date' => __( 'Date', 'woocommerce-multilingual' ),
1876
+ # 'categories' => __( 'Categories', 'woocommerce-multilingual' ),
1877
 
1878
+ msgid "Date"
1879
  msgstr ""
1880
 
1881
+ # 'categories' => __( 'Categories', 'woocommerce-multilingual' ),
1882
+ # 'no_products' => __( 'No products found', 'woocommerce-multilingual' ),
1883
+ # 'draft' => __( 'Draft', 'woocommerce-multilingual' ),
1884
 
1885
+ msgid "No products found"
1886
  msgstr ""
1887
 
1888
+ # 'no_products' => __( 'No products found', 'woocommerce-multilingual' ),
1889
+ # 'draft' => __( 'Draft', 'woocommerce-multilingual' ),
1890
+ # 'private' => __( 'Private', 'woocommerce-multilingual' ),
1891
 
1892
+ msgid "Draft"
1893
  msgstr ""
1894
 
1895
+ # 'draft' => __( 'Draft', 'woocommerce-multilingual' ),
1896
+ # 'private' => __( 'Private', 'woocommerce-multilingual' ),
1897
+ # 'pending' => __( 'Pending', 'woocommerce-multilingual' ),
1898
 
1899
+ msgid "Private"
1900
  msgstr ""
1901
 
1902
+ # 'private' => __( 'Private', 'woocommerce-multilingual' ),
1903
+ # 'pending' => __( 'Pending', 'woocommerce-multilingual' ),
1904
+ # 'future' => __( 'Scheduled', 'woocommerce-multilingual' ),
1905
 
1906
+ msgid "Pending"
1907
  msgstr ""
1908
 
1909
+ # 'pending' => __( 'Pending', 'woocommerce-multilingual' ),
1910
+ # 'future' => __( 'Scheduled', 'woocommerce-multilingual' ),
1911
+ # 'parent' => __( 'Parent product: %s', 'woocommerce-multilingual' ),
1912
 
1913
+ msgid "Scheduled"
1914
  msgstr ""
1915
 
1916
+ # 'future' => __( 'Scheduled', 'woocommerce-multilingual' ),
1917
+ # 'parent' => __( 'Parent product: %s', 'woocommerce-multilingual' ),
1918
+ # 'edit_item' => __( 'Edit this item', 'woocommerce-multilingual' ),
1919
 
1920
+ msgid "Parent product: %s"
1921
  msgstr ""
1922
 
1923
+ # 'parent' => __( 'Parent product: %s', 'woocommerce-multilingual' ),
1924
+ # 'edit_item' => __( 'Edit this item', 'woocommerce-multilingual' ),
1925
+ # 'edit' => __( 'Edit', 'woocommerce-multilingual' ),
1926
 
1927
+ msgid "Edit this item"
1928
  msgstr ""
1929
 
1930
+ # 'edit_item' => __( 'Edit this item', 'woocommerce-multilingual' ),
1931
+ # 'edit' => __( 'Edit', 'woocommerce-multilingual' ),
1932
+ # 'view_link' => __( 'View "%s"', 'woocommerce-multilingual' ),
1933
 
1934
+ msgid "Edit"
1935
  msgstr ""
1936
 
1937
+ # 'edit' => __( 'Edit', 'woocommerce-multilingual' ),
1938
+ # 'view_link' => __( 'View "%s"', 'woocommerce-multilingual' ),
1939
+ # 'view' => __( 'View', 'woocommerce-multilingual' ),
1940
 
1941
+ msgid "View \"%s\""
1942
  msgstr ""
1943
 
1944
+ # 'view_link' => __( 'View "%s"', 'woocommerce-multilingual' ),
1945
+ # 'view' => __( 'View', 'woocommerce-multilingual' ),
1946
+ # 'published' => __( 'Published', 'woocommerce-multilingual' ),
1947
 
1948
+ msgid "View"
1949
  msgstr ""
1950
 
1951
+ # 'view' => __( 'View', 'woocommerce-multilingual' ),
1952
+ # 'published' => __( 'Published', 'woocommerce-multilingual' ),
1953
+ # 'modified' => __( 'Last Modified', 'woocommerce-multilingual' ),
1954
 
1955
+ msgid "Published"
1956
  msgstr ""
1957
 
1958
+ # 'published' => __( 'Published', 'woocommerce-multilingual' ),
1959
+ # 'modified' => __( 'Last Modified', 'woocommerce-multilingual' ),
1960
  # ),
1961
 
1962
+ msgid "Last Modified"
1963
  msgstr ""
1964
 
1965
  # 'strings' => array(
1966
+ # 'all_lang' => __( 'All languages', 'woocommerce-multilingual' ),
1967
+ # 'all_cats' => __( 'All categories', 'woocommerce-multilingual' ),
1968
 
1969
+ msgid "All languages"
1970
  msgstr ""
1971
 
1972
+ # 'all_lang' => __( 'All languages', 'woocommerce-multilingual' ),
1973
+ # 'all_cats' => __( 'All categories', 'woocommerce-multilingual' ),
1974
+ # 'all_trnsl_stats' => __( 'All translation statuses', 'woocommerce-multilingual' ),
1975
 
1976
+ msgid "All categories"
1977
  msgstr ""
1978
 
1979
+ # 'all_cats' => __( 'All categories', 'woocommerce-multilingual' ),
1980
+ # 'all_trnsl_stats' => __( 'All translation statuses', 'woocommerce-multilingual' ),
1981
+ # 'not_trnsl' => __( 'Not translated or needs updating', 'woocommerce-multilingual' ),
1982
 
1983
+ msgid "All translation statuses"
1984
  msgstr ""
1985
 
1986
+ # 'all_trnsl_stats' => __( 'All translation statuses', 'woocommerce-multilingual' ),
1987
+ # 'not_trnsl' => __( 'Not translated or needs updating', 'woocommerce-multilingual' ),
1988
+ # 'need_upd' => __( 'Needs updating', 'woocommerce-multilingual' ),
1989
 
1990
+ msgid "Not translated or needs updating"
1991
  msgstr ""
1992
 
1993
+ # 'not_trnsl' => __( 'Not translated or needs updating', 'woocommerce-multilingual' ),
1994
+ # 'need_upd' => __( 'Needs updating', 'woocommerce-multilingual' ),
1995
+ # 'in_progress' => __( 'Translation in progress', 'woocommerce-multilingual' ),
1996
 
1997
+ msgid "Needs updating"
1998
  msgstr ""
1999
 
2000
+ # 'in_progress' => __( 'Translation in progress', 'woocommerce-multilingual' ),
2001
+ # 'complete' => __( 'Translation complete', 'woocommerce-multilingual' ),
2002
+ # 'all_stats' => __( 'All statuses', 'woocommerce-multilingual' ),
2003
 
2004
+ msgid "Translation complete"
2005
  msgstr ""
2006
 
2007
+ # 'complete' => __( 'Translation complete', 'woocommerce-multilingual' ),
2008
+ # 'all_stats' => __( 'All statuses', 'woocommerce-multilingual' ),
2009
+ # 'filter' => __( 'Filter', 'woocommerce-multilingual' ),
2010
 
2011
+ msgid "All statuses"
2012
  msgstr ""
2013
 
2014
+ # 'all_stats' => __( 'All statuses', 'woocommerce-multilingual' ),
2015
+ # 'filter' => __( 'Filter', 'woocommerce-multilingual' ),
2016
+ # 'reset' => __( 'Reset', 'woocommerce-multilingual' ),
2017
 
2018
+ msgid "Filter"
2019
  msgstr ""
2020
 
2021
+ # 'filter' => __( 'Filter', 'woocommerce-multilingual' ),
2022
+ # 'reset' => __( 'Reset', 'woocommerce-multilingual' ),
2023
+ # 'search' => __( 'Search', 'woocommerce-multilingual' ),
2024
+
2025
+ msgid "Reset"
2026
+ msgstr ""
2027
+
2028
+ # 'reset' => __( 'Reset', 'woocommerce-multilingual' ),
2029
+ # 'search' => __( 'Search', 'woocommerce-multilingual' ),
2030
  # ),
2031
 
2032
+ msgid "Search"
2033
  msgstr ""
2034
 
2035
  # 'strings' => array(
2036
+ # 'items' => __( '%d items', 'woocommerce-multilingual' ),
2037
+ # 'first' => __( 'Go to the first page', 'woocommerce-multilingual' ),
2038
 
2039
+ msgid "%d items"
2040
  msgstr ""
2041
 
2042
+ # 'items' => __( '%d items', 'woocommerce-multilingual' ),
2043
+ # 'first' => __( 'Go to the first page', 'woocommerce-multilingual' ),
2044
+ # 'previous' => __( 'Go to the previous page', 'woocommerce-multilingual' ),
2045
 
2046
+ msgid "Go to the first page"
2047
  msgstr ""
2048
 
2049
+ # 'first' => __( 'Go to the first page', 'woocommerce-multilingual' ),
2050
+ # 'previous' => __( 'Go to the previous page', 'woocommerce-multilingual' ),
2051
+ # 'select' => __( 'Select Page', 'woocommerce-multilingual' ),
2052
 
2053
+ msgid "Go to the previous page"
2054
  msgstr ""
2055
 
2056
+ # 'previous' => __( 'Go to the previous page', 'woocommerce-multilingual' ),
2057
+ # 'select' => __( 'Select Page', 'woocommerce-multilingual' ),
2058
+ # 'current' => __( 'Current page', 'woocommerce-multilingual' ),
2059
 
2060
+ msgid "Select Page"
2061
  msgstr ""
2062
 
2063
+ # 'select' => __( 'Select Page', 'woocommerce-multilingual' ),
2064
+ # 'current' => __( 'Current page', 'woocommerce-multilingual' ),
2065
+ # 'of' => __( 'of', 'woocommerce-multilingual' ),
2066
 
2067
+ msgid "Current page"
2068
  msgstr ""
2069
 
2070
+ # 'current' => __( 'Current page', 'woocommerce-multilingual' ),
2071
+ # 'of' => __( 'of', 'woocommerce-multilingual' ),
2072
+ # 'next' => __( 'Go to the next page', 'woocommerce-multilingual' ),
2073
 
2074
+ msgid "of"
2075
  msgstr ""
2076
 
2077
+ # 'of' => __( 'of', 'woocommerce-multilingual' ),
2078
+ # 'next' => __( 'Go to the next page', 'woocommerce-multilingual' ),
2079
+ # 'last' => __( 'Go to the last page', 'woocommerce-multilingual' ),
2080
 
2081
+ msgid "Go to the next page"
2082
  msgstr ""
2083
 
2084
+ # 'next' => __( 'Go to the next page', 'woocommerce-multilingual' ),
2085
+ # 'last' => __( 'Go to the last page', 'woocommerce-multilingual' ),
2086
+ # )
2087
 
2088
+ msgid "Go to the last page"
2089
  msgstr ""
2090
 
2091
+ # 'translation_interface' => array(
2092
+ # 'heading' => __('Product Translation Interface','woocommerce-multilingual'),
2093
+ # 'tip' => __( 'The recommended way is using the WPML Translation Editor. It is streamlined for making the translation process much easier while also providing a much better integration with various WooCommerce extensions.',
2094
 
2095
+ msgid "Product Translation Interface"
2096
  msgstr ""
2097
 
2098
+ # 'heading' => __('Product Translation Interface','woocommerce-multilingual'),
2099
+ # 'tip' => __( 'The recommended way is using the WPML Translation Editor. It is streamlined for making the translation process much easier while also providing a much better integration with various WooCommerce extensions.',
2100
+ # 'woocommerce-multilingual' ),
2101
+
2102
+ msgid "The recommended way is using the WPML Translation Editor. It is streamlined for making the translation process much easier while also providing a much better integration with various WooCommerce extensions."
2103
+ msgstr ""
2104
+
2105
+ # 'wcml' => array(
2106
+ # 'label' => __('WPML Translation Editor', 'woocommerce-multilingual'),
2107
  #
2108
 
2109
+ msgid "WPML Translation Editor"
2110
  msgstr ""
2111
 
2112
+ # 'native' => array(
2113
+ # 'label' => __('Native WooCommerce product editing screen' , 'woocommerce-multilingual'),
2114
+ #
2115
 
2116
+ msgid "Native WooCommerce product editing screen"
2117
  msgstr ""
2118
 
2119
+ # 'synchronization' => array(
2120
+ # 'heading' => __('Products Synchronization', 'woocommerce-multilingual'),
2121
+ # 'tip' => __( 'Configure specific product properties that should be synced to translations.', 'woocommerce-multilingual' ),
2122
 
2123
+ msgid "Products Synchronization"
2124
  msgstr ""
2125
 
2126
+ # 'heading' => __('Products Synchronization', 'woocommerce-multilingual'),
2127
+ # 'tip' => __( 'Configure specific product properties that should be synced to translations.', 'woocommerce-multilingual' ),
2128
+ # 'sync_date' => array(
2129
 
2130
+ msgid "Configure specific product properties that should be synced to translations."
2131
  msgstr ""
2132
 
2133
+ # 'value' => $this->woocommerce_wpml->settings['products_sync_date'],
2134
+ # 'label' => __('Sync publishing date for translated products.', 'woocommerce-multilingual')
2135
+ # ),
2136
 
2137
+ msgid "Sync publishing date for translated products."
2138
  msgstr ""
2139
 
2140
+ # 'value' => $this->woocommerce_wpml->settings['products_sync_order'],
2141
+ # 'label' => __('Sync products and product taxonomies order.', 'woocommerce-multilingual')
2142
+ # ),
2143
 
2144
+ msgid "Sync products and product taxonomies order."
2145
  msgstr ""
2146
 
2147
+ # 'file_sync' => array(
2148
+ # 'heading' => __('Products Download Files', 'woocommerce-multilingual'),
2149
+ # 'tip' => __( 'If you are using downloadable products, you can choose to have their paths
2150
 
2151
+ msgid "Products Download Files"
2152
  msgstr ""
2153
 
2154
+ # 'heading' => __('Products Download Files', 'woocommerce-multilingual'),
2155
+ # 'tip' => __( 'If you are using downloadable products, you can choose to have their paths
2156
+ # synchronized, or seperate for each language.', 'woocommerce-multilingual' ),
2157
 
2158
+ msgid "If you are using downloadable products, you can choose to have their paths\n synchronized, or seperate for each language."
2159
  msgstr ""
2160
 
2161
+ # 'value' => $this->woocommerce_wpml->settings['file_path_sync'],
2162
+ # 'label_same' => __('Use the same files for translations', 'woocommerce-multilingual'),
2163
+ # 'label_diff' => __('Add separate download files for translations', 'woocommerce-multilingual'),
2164
 
2165
+ msgid "Use the same files for translations"
2166
  msgstr ""
2167
 
2168
+ # 'label_same' => __('Use the same files for translations', 'woocommerce-multilingual'),
2169
+ # 'label_diff' => __('Add separate download files for translations', 'woocommerce-multilingual'),
2170
  # ),
2171
 
2172
+ msgid "Add separate download files for translations"
2173
  msgstr ""
2174
 
2175
+ # 'cart_sync' => array(
2176
+ # 'tip' => __('You can choose to clear the cart contents when you change language or currency in case you have problems in cart or checkout page', 'woocommerce-multilingual'),
2177
+ # 'heading' => __('Cart', 'woocommerce-multilingual'),
2178
 
2179
+ msgid "You can choose to clear the cart contents when you change language or currency in case you have problems in cart or checkout page"
2180
  msgstr ""
2181
 
2182
+ # 'lang_switch' => array(
2183
+ # 'heading' => __('Switching languages when there are items in the cart', 'woocommerce-multilingual'),
2184
+ # 'sync_label' => __('Synchronize cart content when switching languages', 'woocommerce-multilingual'),
2185
 
2186
+ msgid "Switching languages when there are items in the cart"
2187
  msgstr ""
2188
 
2189
+ # 'heading' => __('Switching languages when there are items in the cart', 'woocommerce-multilingual'),
2190
+ # 'sync_label' => __('Synchronize cart content when switching languages', 'woocommerce-multilingual'),
2191
+ # 'clear_label' => __('Prompt for a confirmation and reset the cart', 'woocommerce-multilingual'),
2192
 
2193
+ msgid "Synchronize cart content when switching languages"
2194
  msgstr ""
2195
 
2196
+ # 'sync_label' => __('Synchronize cart content when switching languages', 'woocommerce-multilingual'),
2197
+ # 'clear_label' => __('Prompt for a confirmation and reset the cart', 'woocommerce-multilingual'),
2198
+ # 'value' => $this->woocommerce_wpml->settings['cart_sync']['lang_switch']
2199
 
2200
+ msgid "Prompt for a confirmation and reset the cart"
2201
  msgstr ""
2202
 
2203
+ # 'currency_switch' => array(
2204
+ # 'heading' => __('Switching currencies when there are items in the cart', 'woocommerce-multilingual'),
2205
+ # 'sync_label' => __('Synchronize cart content when switching currencies', 'woocommerce-multilingual'),
2206
 
2207
+ msgid "Switching currencies when there are items in the cart"
2208
  msgstr ""
2209
 
2210
+ # 'heading' => __('Switching currencies when there are items in the cart', 'woocommerce-multilingual'),
2211
+ # 'sync_label' => __('Synchronize cart content when switching currencies', 'woocommerce-multilingual'),
2212
+ # 'clear_label' => __('Prompt for a confirmation and reset the cart', 'woocommerce-multilingual'),
2213
 
2214
+ msgid "Synchronize cart content when switching currencies"
2215
  msgstr ""
2216
 
2217
+ # ),
2218
+ # 'doc_link' => sprintf( __( 'Not sure which option to choose? Read about %spotential issues when switching languages and currencies while the cart has items%s.',
2219
+ # 'woocommerce-multilingual' ),
2220
 
2221
+ msgid "Not sure which option to choose? Read about %spotential issues when switching languages and currencies while the cart has items%s."
2222
  msgstr ""
2223
 
2224
+ # 'nonce' => wp_nonce_field('wcml_save_settings_nonce', 'wcml_nonce', true, false),
2225
+ # 'save_label' => __( 'Save changes', 'woocommerce-multilingual' ),
2226
+ #
2227
 
2228
+ msgid "Save changes"
2229
  msgstr ""
2230
 
2231
+ # 'url' => admin_url( 'admin.php?page=wpml-wcml&tab=troubleshooting' ),
2232
+ # 'label' => __( 'Troubleshooting page', 'woocommerce-multilingual' )
2233
+ # )
2234
 
2235
+ msgid "Troubleshooting page"
2236
  msgstr ""
2237
 
2238
+ # 'strings' => array(
2239
+ # 'use_custom' => __( 'Use custom settings for translations download files', 'woocommerce-multilingual' ),
2240
+ # 'use_same' => __( 'Use the same files for translations', 'woocommerce-multilingual' ),
2241
 
2242
+ msgid "Use custom settings for translations download files"
2243
  msgstr ""
2244
 
2245
+ # 'content' => $this->content,
2246
+ # 'trnsl_title' => __( 'How to translate this?', 'woocommerce-multilingual' ),
2247
+ # 'doc_link' => $this->doc_link,
2248
 
2249
+ msgid "How to translate this?"
2250
  msgstr ""
2251
 
2252
+ # 'doc_link' => $this->doc_link,
2253
+ # 'doc_link_text' => __( 'Learn more', 'woocommerce-multilingual' ),
2254
  # ),
 
 
2255
 
2256
+ msgid "Learn more"
2257
  msgstr ""
2258
 
2259
+ # 'strings' => array(
2260
+ # 'update_trnsl' => __('Update Translation', 'woocommerce-multilingual'),
2261
+ # 'hide' => __('Hide This Message', 'woocommerce-multilingual'),
2262
 
2263
+ msgid "Update Translation"
2264
  msgstr ""
2265
 
2266
+ # 'update_trnsl' => __('Update Translation', 'woocommerce-multilingual'),
2267
+ # 'hide' => __('Hide This Message', 'woocommerce-multilingual'),
2268
+ # 'trnsl_available' => sprintf( __( '<strong>WooCommerce Translation Available</strong> &#8211; Install or update your <code>%s</code> translations to version <code>%s</code>.', 'woocommerce-multilingual' ), implode(', ', $this->notices ), WC_VERSION )
2269
 
2270
+ msgid "Hide This Message"
2271
  msgstr ""
2272
 
2273
+ # 'hide' => __('Hide This Message', 'woocommerce-multilingual'),
2274
+ # 'trnsl_available' => sprintf( __( '<strong>WooCommerce Translation Available</strong> &#8211; Install or update your <code>%s</code> translations to version <code>%s</code>.', 'woocommerce-multilingual' ), implode(', ', $this->notices ), WC_VERSION )
2275
+ # ),
2276
 
2277
+ msgid "<strong>WooCommerce Translation Available</strong> &#8211; Install or update your <code>%s</code> translations to version <code>%s</code>."
2278
  msgstr ""
2279
 
2280
+ # 'strings' => array(
2281
+ # 'tax_missing' => __( 'Taxonomies Missing Translations', 'woocommerce-multilingual' ),
2282
+ # 'run_site' => __( 'To run a fully translated site, you should translate all taxonomy terms. Some store elements, such as variations, depend on taxonomy translation.', 'woocommerce-multilingual' ),
2283
 
2284
+ msgid "Taxonomies Missing Translations"
2285
  msgstr ""
2286
 
2287
+ # 'tax_missing' => __( 'Taxonomies Missing Translations', 'woocommerce-multilingual' ),
2288
+ # 'run_site' => __( 'To run a fully translated site, you should translate all taxonomy terms. Some store elements, such as variations, depend on taxonomy translation.', 'woocommerce-multilingual' ),
2289
+ # 'not_req_trnsl' => __( '%s do not require translation.', 'woocommerce-multilingual' ),
2290
 
2291
+ msgid "To run a fully translated site, you should translate all taxonomy terms. Some store elements, such as variations, depend on taxonomy translation."
2292
  msgstr ""
2293
 
2294
+ # 'run_site' => __( 'To run a fully translated site, you should translate all taxonomy terms. Some store elements, such as variations, depend on taxonomy translation.', 'woocommerce-multilingual' ),
2295
+ # 'not_req_trnsl' => __( '%s do not require translation.', 'woocommerce-multilingual' ),
2296
+ # 'req_trnsl' => __( 'This taxonomy requires translation.', 'woocommerce-multilingual' ),
2297
 
2298
+ msgid "%s do not require translation."
2299
  msgstr ""
2300
 
2301
+ # 'not_req_trnsl' => __( '%s do not require translation.', 'woocommerce-multilingual' ),
2302
+ # 'req_trnsl' => __( 'This taxonomy requires translation.', 'woocommerce-multilingual' ),
2303
+ # 'miss_trnsl_one' => __( '%d %s is missing translations.', 'woocommerce-multilingual' ),
2304
 
2305
+ msgid "This taxonomy requires translation."
2306
  msgstr ""
2307
 
2308
+ # 'req_trnsl' => __( 'This taxonomy requires translation.', 'woocommerce-multilingual' ),
2309
+ # 'miss_trnsl_one' => __( '%d %s is missing translations.', 'woocommerce-multilingual' ),
2310
+ # 'miss_trnsl_more' => __( '%d %s are missing translations.', 'woocommerce-multilingual' ),
2311
 
2312
+ msgid "%d %s is missing translations."
2313
  msgstr ""
2314
 
2315
+ # 'miss_trnsl_one' => __( '%d %s is missing translations.', 'woocommerce-multilingual' ),
2316
+ # 'miss_trnsl_more' => __( '%d %s are missing translations.', 'woocommerce-multilingual' ),
2317
+ # 'trnsl' => __( 'Translate %s', 'woocommerce-multilingual' ),
2318
 
2319
+ msgid "%d %s are missing translations."
2320
  msgstr ""
2321
 
2322
+ # 'miss_trnsl_more' => __( '%d %s are missing translations.', 'woocommerce-multilingual' ),
2323
+ # 'trnsl' => __( 'Translate %s', 'woocommerce-multilingual' ),
2324
+ # 'doesnot_req_trnsl' => __( 'This taxonomy does not require translation.', 'woocommerce-multilingual' ),
2325
 
2326
+ msgid "Translate %s"
2327
  msgstr ""
2328
 
2329
+ # 'trnsl' => __( 'Translate %s', 'woocommerce-multilingual' ),
2330
+ # 'doesnot_req_trnsl' => __( 'This taxonomy does not require translation.', 'woocommerce-multilingual' ),
2331
+ # 'all_trnsl' => __( 'All %s are translated.', 'woocommerce-multilingual' ),
2332
 
2333
+ msgid "This taxonomy does not require translation."
2334
  msgstr ""
2335
 
2336
+ # 'doesnot_req_trnsl' => __( 'This taxonomy does not require translation.', 'woocommerce-multilingual' ),
2337
+ # 'all_trnsl' => __( 'All %s are translated.', 'woocommerce-multilingual' ),
2338
+ # 'not_to_trnsl' => __( 'Right now, there are no taxonomy terms needing translation.', 'woocommerce-multilingual' ),
2339
 
2340
+ msgid "All %s are translated."
2341
  msgstr ""
2342
 
2343
+ # 'all_trnsl' => __( 'All %s are translated.', 'woocommerce-multilingual' ),
2344
+ # 'not_to_trnsl' => __( 'Right now, there are no taxonomy terms needing translation.', 'woocommerce-multilingual' ),
2345
+ # 'conf_warning' => sprintf( __( 'To configure product taxonomies or attributes as translatable or not translatable, go to the %sMultilingual Content Setup%s', 'woocommerce-multilingual' ), '<a href="'.admin_url('admin.php?page=wpml-translation-management%2Fmenu%2Fmain.php&sm=mcsetup#ml-content-setup-sec-8').'">','</a>' )
2346
 
2347
+ msgid "Right now, there are no taxonomy terms needing translation."
2348
  msgstr ""
2349
 
2350
+ # 'not_to_trnsl' => __( 'Right now, there are no taxonomy terms needing translation.', 'woocommerce-multilingual' ),
2351
+ # 'conf_warning' => sprintf( __( 'To configure product taxonomies or attributes as translatable or not translatable, go to the %sMultilingual Content Setup%s', 'woocommerce-multilingual' ), '<a href="'.admin_url('admin.php?page=wpml-translation-management%2Fmenu%2Fmain.php&sm=mcsetup#ml-content-setup-sec-8').'">','</a>' )
2352
+ # ),
2353
 
2354
+ msgid "To configure product taxonomies or attributes as translatable or not translatable, go to the %sMultilingual Content Setup%s"
2355
  msgstr ""
2356
 
2357
+ # 'strings' => array(
2358
+ # 'conf' => __( 'Configuration Warnings', 'woocommerce-multilingual' ),
2359
+ # 'base_not_trnsl' => __( 'Your product permalink base is not translated to:', 'woocommerce-multilingual' ),
2360
 
2361
+ msgid "Configuration Warnings"
2362
  msgstr ""
2363
 
2364
+ # 'conf' => __( 'Configuration Warnings', 'woocommerce-multilingual' ),
2365
+ # 'base_not_trnsl' => __( 'Your product permalink base is not translated to:', 'woocommerce-multilingual' ),
2366
+ # 'trsl_urls' => __( 'Translate URLs', 'woocommerce-multilingual' ),
2367
 
2368
+ msgid "Your product permalink base is not translated to:"
2369
  msgstr ""
2370
 
2371
+ # 'base_not_trnsl' => __( 'Your product permalink base is not translated to:', 'woocommerce-multilingual' ),
2372
+ # 'trsl_urls' => __( 'Translate URLs', 'woocommerce-multilingual' ),
2373
+ # 'def_and_st_not_en' => __( "Your site's default language is not English and the strings language is also not English.", 'woocommerce-multilingual' ),
2374
 
2375
+ msgid "Translate URLs"
2376
  msgstr ""
2377
 
2378
+ # 'trsl_urls' => __( 'Translate URLs', 'woocommerce-multilingual' ),
2379
+ # 'def_and_st_not_en' => __( "Your site's default language is not English and the strings language is also not English.", 'woocommerce-multilingual' ),
2380
+ # 'run_not_en' => __( 'Running WooCommerce multilingual with default language other than English.', 'woocommerce-multilingual' ),
2381
 
2382
+ msgid "Your site's default language is not English and the strings language is also not English."
2383
  msgstr ""
2384
 
2385
+ # 'def_and_st_not_en' => __( "Your site's default language is not English and the strings language is also not English.", 'woocommerce-multilingual' ),
2386
+ # 'run_not_en' => __( 'Running WooCommerce multilingual with default language other than English.', 'woocommerce-multilingual' ),
2387
+ # 'url_problems' => __( 'This may cause problems with URLs in different languages.', 'woocommerce-multilingual' ),
2388
 
2389
+ msgid "Running WooCommerce multilingual with default language other than English."
2390
  msgstr ""
2391
 
2392
+ # 'run_not_en' => __( 'Running WooCommerce multilingual with default language other than English.', 'woocommerce-multilingual' ),
2393
+ # 'url_problems' => __( 'This may cause problems with URLs in different languages.', 'woocommerce-multilingual' ),
2394
+ # 'change_def_lang' => __( 'Change default language', 'woocommerce-multilingual' ),
2395
 
2396
+ msgid "This may cause problems with URLs in different languages."
2397
  msgstr ""
2398
 
2399
+ # 'url_problems' => __( 'This may cause problems with URLs in different languages.', 'woocommerce-multilingual' ),
2400
+ # 'change_def_lang' => __( 'Change default language', 'woocommerce-multilingual' ),
2401
+ # 'def_not_en' => __( "Your site's default language is not English.", 'woocommerce-multilingual' ),
2402
 
2403
+ msgid "Change default language"
2404
  msgstr ""
2405
 
2406
+ # 'change_def_lang' => __( 'Change default language', 'woocommerce-multilingual' ),
2407
+ # 'def_not_en' => __( "Your site's default language is not English.", 'woocommerce-multilingual' ),
2408
+ # 'attent_sett' => __( 'There are some settings that require careful attention.', 'woocommerce-multilingual' ),
2409
 
2410
+ msgid "Your site's default language is not English."
2411
  msgstr ""
2412
 
2413
+ # 'def_not_en' => __( "Your site's default language is not English.", 'woocommerce-multilingual' ),
2414
+ # 'attent_sett' => __( 'There are some settings that require careful attention.', 'woocommerce-multilingual' ),
2415
+ # 'over_sett' => __( 'Some settings from the WooCommerce Multilingual wpml-config.xml file have been overwritten.', 'woocommerce-multilingual' ),
2416
 
2417
+ msgid "There are some settings that require careful attention."
2418
  msgstr ""
2419
 
2420
+ # 'attent_sett' => __( 'There are some settings that require careful attention.', 'woocommerce-multilingual' ),
2421
+ # 'over_sett' => __( 'Some settings from the WooCommerce Multilingual wpml-config.xml file have been overwritten.', 'woocommerce-multilingual' ),
2422
+ # 'check_conf' => __( 'You should check WPML configuration files added by other plugins or manual settings on the %s section.', 'woocommerce-multilingual' ),
2423
 
2424
+ msgid "Some settings from the WooCommerce Multilingual wpml-config.xml file have been overwritten."
2425
  msgstr ""
2426
 
2427
+ # 'over_sett' => __( 'Some settings from the WooCommerce Multilingual wpml-config.xml file have been overwritten.', 'woocommerce-multilingual' ),
2428
+ # 'check_conf' => __( 'You should check WPML configuration files added by other plugins or manual settings on the %s section.', 'woocommerce-multilingual' ),
2429
+ # 'cont_set' => '<a href="' . admin_url( 'admin.php?page=' . WPML_TM_FOLDER . '/menu/main.php&sm=mcsetup' ) . '">'. __( 'Multilingual Content Setup', 'woocommerce-multilingual' ) .'</a>'
2430
 
2431
+ msgid "You should check WPML configuration files added by other plugins or manual settings on the %s section."
2432
  msgstr ""
2433
 
2434
+ # 'check_conf' => __( 'You should check WPML configuration files added by other plugins or manual settings on the %s section.', 'woocommerce-multilingual' ),
2435
+ # 'cont_set' => '<a href="' . admin_url( 'admin.php?page=' . WPML_TM_FOLDER . '/menu/main.php&sm=mcsetup' ) . '">'. __( 'Multilingual Content Setup', 'woocommerce-multilingual' ) .'</a>'
2436
+ # ),
2437
 
2438
+ msgid "Multilingual Content Setup"
2439
  msgstr ""
2440
 
2441
+ # 'strings' => array(
2442
+ # 'products_missing' => __( 'Products Missing Translations', 'woocommerce-multilingual' ),
2443
+ # 'miss_trnsl_one' => __( '%d %s translation missing.', 'woocommerce-multilingual' ),
2444
 
2445
+ msgid "Products Missing Translations"
2446
  msgstr ""
2447
 
2448
+ # 'products_missing' => __( 'Products Missing Translations', 'woocommerce-multilingual' ),
2449
+ # 'miss_trnsl_one' => __( '%d %s translation missing.', 'woocommerce-multilingual' ),
2450
+ # 'miss_trnsl_more' => __( '%d %s translations missing.', 'woocommerce-multilingual' ),
2451
 
2452
+ msgid "%d %s translation missing."
2453
  msgstr ""
2454
 
2455
+ # 'miss_trnsl_one' => __( '%d %s translation missing.', 'woocommerce-multilingual' ),
2456
+ # 'miss_trnsl_more' => __( '%d %s translations missing.', 'woocommerce-multilingual' ),
2457
+ # 'transl' => __( 'Translate Products', 'woocommerce-multilingual' ),
2458
 
2459
+ msgid "%d %s translations missing."
2460
  msgstr ""
2461
 
2462
+ # 'miss_trnsl_more' => __( '%d %s translations missing.', 'woocommerce-multilingual' ),
2463
+ # 'transl' => __( 'Translate Products', 'woocommerce-multilingual' ),
2464
+ # 'not_to_trnsl' => __( 'Right now, there are no products needing translation.', 'woocommerce-multilingual' )
2465
 
2466
+ msgid "Translate Products"
2467
  msgstr ""
2468
 
2469
+ # 'transl' => __( 'Translate Products', 'woocommerce-multilingual' ),
2470
+ # 'not_to_trnsl' => __( 'Right now, there are no products needing translation.', 'woocommerce-multilingual' )
2471
+ # )
 
 
 
 
 
 
 
2472
 
2473
+ msgid "Right now, there are no products needing translation."
2474
  msgstr ""
2475
 
2476
+ # 'no_secondary' => __( "You haven't added any secondary currencies.", 'woocommerce-multilingual' ),
2477
+ # 'sec_currencies' => __( 'Secondary currencies: %s', 'woocommerce-multilingual' ),
2478
+ # 'not_enabled' => __( 'Multi-currency is not enabled.', 'woocommerce-multilingual' ),
2479
 
2480
+ msgid "Secondary currencies: %s"
2481
  msgstr ""
2482
 
2483
+ # 'sec_currencies' => __( 'Secondary currencies: %s', 'woocommerce-multilingual' ),
2484
+ # 'not_enabled' => __( 'Multi-currency is not enabled.', 'woocommerce-multilingual' ),
2485
+ # 'add_cur' => __( 'Add Currencies', 'woocommerce-multilingual' )
2486
 
2487
+ msgid "Multi-currency is not enabled."
2488
  msgstr ""
2489
 
2490
+ # 'not_enabled' => __( 'Multi-currency is not enabled.', 'woocommerce-multilingual' ),
2491
+ # 'add_cur' => __( 'Add Currencies', 'woocommerce-multilingual' )
2492
+ # )
2493
 
2494
+ msgid "Add Currencies"
2495
  msgstr ""
2496
 
2497
+ # 'strings' => array(
2498
+ # 'status' => __( 'Plugins Status', 'woocommerce-multilingual' ),
2499
+ # 'inst_active' => __( '%s is installed and active.', 'woocommerce-multilingual' ),
2500
 
2501
+ msgid "Plugins Status"
2502
  msgstr ""
2503
 
2504
+ # 'status' => __( 'Plugins Status', 'woocommerce-multilingual' ),
2505
+ # 'inst_active' => __( '%s is installed and active.', 'woocommerce-multilingual' ),
2506
+ # 'is_setup' => __( '%s is set up.', 'woocommerce-multilingual' ),
2507
 
2508
+ msgid "%s is installed and active."
2509
  msgstr ""
2510
 
2511
+ # 'inst_active' => __( '%s is installed and active.', 'woocommerce-multilingual' ),
2512
+ # 'is_setup' => __( '%s is set up.', 'woocommerce-multilingual' ),
2513
+ # 'not_setup' => __( '%s is not set up.', 'woocommerce-multilingual' ),
2514
 
2515
+ msgid "%s is set up."
2516
  msgstr ""
2517
 
2518
+ # 'is_setup' => __( '%s is set up.', 'woocommerce-multilingual' ),
2519
+ # 'not_setup' => __( '%s is not set up.', 'woocommerce-multilingual' ),
2520
+ # 'wpml' => '<strong>WPML</strong>',
2521
 
2522
+ msgid "%s is not set up."
2523
  msgstr ""
2524
 
2525
+ # 'wc' => '<strong>WooCommerce</strong>',
2526
+ # 'depends' => __( 'WooCommerce Multilingual depends on several plugins to work. If any required plugin is missing, you should install and activate it.', 'woocommerce-multilingual' )
2527
+ # )
2528
 
2529
+ msgid "WooCommerce Multilingual depends on several plugins to work. If any required plugin is missing, you should install and activate it."
2530
  msgstr ""
2531
 
2532
  # 'strings' => array(
2533
+ # 'store_pages' => __( 'WooCommerce Store Pages', 'woocommerce-multilingual' ),
2534
+ # 'pages_trnsl' => __( 'To run a multilingual e-commerce site, you need to have the WooCommerce shop pages translated to all the site\'s languages. Once all the pages are installed you can add the translations for them from this menu.', 'woocommerce-multilingual' ),
2535
 
2536
+ msgid "WooCommerce Store Pages"
2537
  msgstr ""
2538
 
2539
+ # 'store_pages' => __( 'WooCommerce Store Pages', 'woocommerce-multilingual' ),
2540
+ # 'pages_trnsl' => __( 'To run a multilingual e-commerce site, you need to have the WooCommerce shop pages translated to all the site\'s languages. Once all the pages are installed you can add the translations for them from this menu.', 'woocommerce-multilingual' ),
2541
+ # 'store_pages' => __( 'WooCommerce Store Pages', 'woocommerce-multilingual' ),
2542
 
2543
+ msgid "To run a multilingual e-commerce site, you need to have the WooCommerce shop pages translated to all the site's languages. Once all the pages are installed you can add the translations for them from this menu."
2544
  msgstr ""
2545
 
2546
+ # 'store_pages' => __( 'WooCommerce Store Pages', 'woocommerce-multilingual' ),
2547
+ # 'not_created' => __( 'One or more WooCommerce pages have not been created.', 'woocommerce-multilingual' ),
2548
+ # 'install' => __( 'Install WooCommerce Pages', 'woocommerce-multilingual' ),
2549
 
2550
+ msgid "One or more WooCommerce pages have not been created."
2551
  msgstr ""
2552
 
2553
+ # 'not_created' => __( 'One or more WooCommerce pages have not been created.', 'woocommerce-multilingual' ),
2554
+ # 'install' => __( 'Install WooCommerce Pages', 'woocommerce-multilingual' ),
2555
+ # 'not_exist' => __( 'WooCommerce store pages do not exist for these languages:', 'woocommerce-multilingual' ),
2556
 
2557
+ msgid "Install WooCommerce Pages"
2558
  msgstr ""
2559
 
2560
+ # 'install' => __( 'Install WooCommerce Pages', 'woocommerce-multilingual' ),
2561
+ # 'not_exist' => __( 'WooCommerce store pages do not exist for these languages:', 'woocommerce-multilingual' ),
2562
+ # 'create_transl' => __( 'Create missing translations', 'woocommerce-multilingual' ),
2563
 
2564
+ msgid "WooCommerce store pages do not exist for these languages:"
2565
  msgstr ""
2566
 
2567
+ # 'not_exist' => __( 'WooCommerce store pages do not exist for these languages:', 'woocommerce-multilingual' ),
2568
+ # 'create_transl' => __( 'Create missing translations', 'woocommerce-multilingual' ),
2569
+ # 'translated_wpml' => __( 'These pages are currently being translated by translators via WPML: ', 'woocommerce-multilingual' ),
2570
 
2571
+ msgid "Create missing translations"
2572
  msgstr ""
2573
 
2574
+ # 'create_transl' => __( 'Create missing translations', 'woocommerce-multilingual' ),
2575
+ # 'translated_wpml' => __( 'These pages are currently being translated by translators via WPML: ', 'woocommerce-multilingual' ),
2576
+ # 'translated' => __( 'WooCommerce store pages are translated to all the site\'s languages.', 'woocommerce-multilingual' )
2577
 
2578
+ msgid "These pages are currently being translated by translators via WPML: "
2579
  msgstr ""
2580
 
2581
+ # 'translated_wpml' => __( 'These pages are currently being translated by translators via WPML: ', 'woocommerce-multilingual' ),
2582
+ # 'translated' => __( 'WooCommerce store pages are translated to all the site\'s languages.', 'woocommerce-multilingual' )
2583
  # ),
 
 
2584
 
2585
+ msgid "WooCommerce store pages are translated to all the site's languages."
2586
  msgstr ""
2587
 
2588
+ # 'strings' => array(
2589
+ # 'label' => __( 'Translatable?', 'woocommerce-multilingual' ),
2590
+ # 'description' => __( 'Enable this if you want to translate attribute values with Woocommerce Multilingual', 'woocommerce-multilingual' ),
2591
 
2592
+ msgid "Translatable?"
2593
  msgstr ""
2594
 
2595
+ # 'label' => __( 'Translatable?', 'woocommerce-multilingual' ),
2596
+ # 'description' => __( 'Enable this if you want to translate attribute values with Woocommerce Multilingual', 'woocommerce-multilingual' ),
2597
+ # 'notice' => __( 'Existing translations and variations associated will be deleted.', 'woocommerce-multilingual' )
2598
 
2599
+ msgid "Enable this if you want to translate attribute values with Woocommerce Multilingual"
2600
  msgstr ""
2601
 
2602
+ # 'description' => __( 'Enable this if you want to translate attribute values with Woocommerce Multilingual', 'woocommerce-multilingual' ),
2603
+ # 'notice' => __( 'Existing translations and variations associated will be deleted.', 'woocommerce-multilingual' )
2604
+ # )
2605
 
2606
+ msgid "Existing translations and variations associated will be deleted."
2607
  msgstr ""
2608
 
2609
+ # $last_updated = empty( $this->settings['last_updated'] ) ?
2610
+ # '<i>' . __( 'never', 'woocommerce-multilingual' ) . '</i>' :
2611
+ # date_i18n( 'F j, Y g:i a', $this->settings['last_updated'] );
2612
 
2613
+ msgid "never"
2614
  msgstr ""
2615
 
2616
+ #
2617
+ # 'header' => __( 'Automatic Exchange Rates', 'woocommerce-multilingual' ),
2618
+ # 'no_currencies' => __( "You haven't added any secondary currencies.", 'woocommerce-multilingual' ),
2619
 
2620
+ msgid "Automatic Exchange Rates"
2621
  msgstr ""
2622
 
2623
+ # 'no_currencies' => __( "You haven't added any secondary currencies.", 'woocommerce-multilingual' ),
2624
+ # 'enable_automatic' => __( 'Enable automatic exchange rates', 'woocommerce-multilingual' ),
2625
+ # 'services_label' => __( 'Exchange rates source', 'woocommerce-multilingual' ),
2626
 
2627
+ msgid "Enable automatic exchange rates"
2628
  msgstr ""
2629
 
2630
+ # 'enable_automatic' => __( 'Enable automatic exchange rates', 'woocommerce-multilingual' ),
2631
+ # 'services_label' => __( 'Exchange rates source', 'woocommerce-multilingual' ),
2632
+ # 'lifting_label' => __( 'Lifting charge', 'woocommerce-multilingual' ),
2633
 
2634
+ msgid "Exchange rates source"
2635
  msgstr ""
2636
 
2637
+ # 'services_label' => __( 'Exchange rates source', 'woocommerce-multilingual' ),
2638
+ # 'lifting_label' => __( 'Lifting charge', 'woocommerce-multilingual' ),
2639
+ # 'lifting_details1' => __( 'The lifting charge adjusts the exchange rate provided by the selected service before it is saved. The exchange rates displayed in the table above include the lifting charge.', 'woocommerce-multilingual' ),
2640
 
2641
+ msgid "Lifting charge"
2642
  msgstr ""
2643
 
2644
+ # 'lifting_label' => __( 'Lifting charge', 'woocommerce-multilingual' ),
2645
+ # 'lifting_details1' => __( 'The lifting charge adjusts the exchange rate provided by the selected service before it is saved. The exchange rates displayed in the table above include the lifting charge.', 'woocommerce-multilingual' ),
2646
+ # 'lifting_details2' => __( 'Exchange rate = %s exchange rate x (1 + lifting charge / 100)', 'woocommerce-multilingual' ),
2647
 
2648
+ msgid "The lifting charge adjusts the exchange rate provided by the selected service before it is saved. The exchange rates displayed in the table above include the lifting charge."
2649
  msgstr ""
2650
 
2651
+ # 'lifting_details1' => __( 'The lifting charge adjusts the exchange rate provided by the selected service before it is saved. The exchange rates displayed in the table above include the lifting charge.', 'woocommerce-multilingual' ),
2652
+ # 'lifting_details2' => __( 'Exchange rate = %s exchange rate x (1 + lifting charge / 100)', 'woocommerce-multilingual' ),
2653
+ # 'services_api' => __( 'API key (required)', 'woocommerce-multilingual' ),
2654
 
2655
+ msgid "Exchange rate = %s exchange rate x (1 + lifting charge / 100)"
2656
  msgstr ""
2657
 
2658
+ # 'lifting_details2' => __( 'Exchange rate = %s exchange rate x (1 + lifting charge / 100)', 'woocommerce-multilingual' ),
2659
+ # 'services_api' => __( 'API key (required)', 'woocommerce-multilingual' ),
2660
+ # 'frequency' => __( 'Update frequency', 'woocommerce-multilingual' ),
2661
 
2662
+ msgid "API key (required)"
2663
  msgstr ""
2664
 
2665
+ # 'services_api' => __( 'API key (required)', 'woocommerce-multilingual' ),
2666
+ # 'frequency' => __( 'Update frequency', 'woocommerce-multilingual' ),
2667
+ # 'update' => __( 'Update manually now', 'woocommerce-multilingual' ),
2668
 
2669
+ msgid "Update frequency"
2670
  msgstr ""
2671
 
2672
+ # 'frequency' => __( 'Update frequency', 'woocommerce-multilingual' ),
2673
+ # 'update' => __( 'Update manually now', 'woocommerce-multilingual' ),
2674
+ # 'update_tip' => __( 'You have to save all settings before updating exchange rates', 'woocommerce-multilingual' ),
2675
 
2676
+ msgid "Update manually now"
2677
  msgstr ""
2678
 
2679
+ # 'update' => __( 'Update manually now', 'woocommerce-multilingual' ),
2680
+ # 'update_tip' => __( 'You have to save all settings before updating exchange rates', 'woocommerce-multilingual' ),
2681
+ # 'manually' => __( 'Manually', 'woocommerce-multilingual'),
2682
 
2683
+ msgid "You have to save all settings before updating exchange rates"
2684
  msgstr ""
2685
 
2686
+ # 'update_tip' => __( 'You have to save all settings before updating exchange rates', 'woocommerce-multilingual' ),
2687
+ # 'manually' => __( 'Manually', 'woocommerce-multilingual'),
2688
+ # 'daily' => __( 'Daily', 'woocommerce-multilingual' ),
2689
 
2690
+ msgid "Manually"
2691
  msgstr ""
2692
 
2693
+ # 'manually' => __( 'Manually', 'woocommerce-multilingual'),
2694
+ # 'daily' => __( 'Daily', 'woocommerce-multilingual' ),
2695
+ # 'weekly' => __( 'Weekly on', 'woocommerce-multilingual' ),
2696
 
2697
+ msgid "Daily"
2698
  msgstr ""
2699
 
2700
+ # 'daily' => __( 'Daily', 'woocommerce-multilingual' ),
2701
+ # 'weekly' => __( 'Weekly on', 'woocommerce-multilingual' ),
2702
+ # 'monthly' => __( 'Monthly on the', 'woocommerce-multilingual' ),
2703
 
2704
+ msgid "Weekly on"
2705
  msgstr ""
2706
 
2707
+ # 'weekly' => __( 'Weekly on', 'woocommerce-multilingual' ),
2708
+ # 'monthly' => __( 'Monthly on the', 'woocommerce-multilingual' ),
2709
+ # 'key_placeholder' => __( 'Enter API key', 'woocommerce-multilingual' ),
2710
 
2711
+ msgid "Monthly on the"
2712
  msgstr ""
2713
 
2714
+ # 'monthly' => __( 'Monthly on the', 'woocommerce-multilingual' ),
2715
+ # 'key_placeholder' => __( 'Enter API key', 'woocommerce-multilingual' ),
2716
+ # 'key_required' => __( 'API key (required)', 'woocommerce-multilingual' ),
2717
 
2718
+ msgid "Enter API key"
2719
  msgstr ""
2720
 
2721
+ # 'updated_time' => sprintf(
2722
+ # __('Last updated: %s', 'woocommerce-multilingual' ),
2723
+ # '<span class="time">' . $last_updated . '</span>'
2724
 
2725
+ msgid "Last updated: %s"
2726
  msgstr ""
2727
 
2728
+ # ),
2729
+ # 'updated_success' => __( 'Exchange rates updated successfully', 'woocommerce-multilingual' ),
2730
+ # 'visit_website' => __( 'Visit website', 'woocommerce-multilingual' )
2731
 
2732
+ msgid "Exchange rates updated successfully"
2733
  msgstr ""
2734
 
2735
+ # 'updated_success' => __( 'Exchange rates updated successfully', 'woocommerce-multilingual' ),
2736
+ # 'visit_website' => __( 'Visit website', 'woocommerce-multilingual' )
2737
+ #
2738
 
2739
+ msgid "Visit website"
2740
  msgstr ""
2741
 
2742
+ # 'form' => array(
2743
+ # 'select' => __( 'Select currency', 'woocommerce-multilingual' ),
2744
+ # 'rate' => array(
2745
 
2746
+ msgid "Select currency"
2747
  msgstr ""
2748
 
2749
+ # 'rate' => array(
2750
+ # 'label' => __( 'Exchange Rate', 'woocommerce-multilingual' ),
2751
+ # 'only_numeric' => __( 'Only numeric', 'woocommerce-multilingual' ),
2752
 
2753
+ msgid "Exchange Rate"
2754
  msgstr ""
2755
 
2756
+ # 'label' => __( 'Exchange Rate', 'woocommerce-multilingual' ),
2757
+ # 'only_numeric' => __( 'Only numeric', 'woocommerce-multilingual' ),
2758
+ # 'set_on' => empty($this->args['currency']['updated'] ) ? '' :
2759
 
2760
+ msgid "Only numeric"
2761
  msgstr ""
2762
 
2763
+ # 'set_on' => empty($this->args['currency']['updated'] ) ? '' :
2764
+ # sprintf( __( 'Set on %s', 'woocommerce-multilingual' ),
2765
+ # date( 'F j, Y g:i a', strtotime( $this->args['currency']['updated'] ) ) ),
2766
+
2767
+ msgid "Set on %s"
2768
  msgstr ""
2769
 
2770
+ # 'previous' => empty($this->args['currency']['previous_rate'] ) ? '' :
2771
+ # ' ' . sprintf( __( '(previous value: %s)', 'woocommerce-multilingual' ), $this->args['currency']['previous_rate'] )
2772
  # ),
2773
 
2774
+ msgid "(previous value: %s)"
2775
  msgstr ""
2776
 
2777
+ # 'preview' => array(
2778
+ # 'label' => __( 'Currency Preview', 'woocommerce-multilingual' ),
2779
+ # 'value' => $this->get_price_preview( $current_currency )
2780
 
2781
+ msgid "Currency Preview"
2782
  msgstr ""
2783
 
2784
+ # 'position' => array(
2785
+ # 'label' => __( 'Currency Position', 'woocommerce-multilingual' ),
2786
+ # 'left' => __( 'Left', 'woocommerce-multilingual' ),
2787
 
2788
+ msgid "Currency Position"
2789
  msgstr ""
2790
 
2791
+ # 'label' => __( 'Currency Position', 'woocommerce-multilingual' ),
2792
+ # 'left' => __( 'Left', 'woocommerce-multilingual' ),
2793
+ # 'right' => __( 'Right', 'woocommerce-multilingual' ),
2794
 
2795
+ msgid "Left"
2796
  msgstr ""
2797
 
2798
+ # 'left' => __( 'Left', 'woocommerce-multilingual' ),
2799
+ # 'right' => __( 'Right', 'woocommerce-multilingual' ),
2800
+ # 'left_space' => __( 'Left with space', 'woocommerce-multilingual' ),
2801
 
2802
+ msgid "Right"
2803
  msgstr ""
2804
 
2805
+ # 'right' => __( 'Right', 'woocommerce-multilingual' ),
2806
+ # 'left_space' => __( 'Left with space', 'woocommerce-multilingual' ),
2807
+ # 'right_space' => __( 'Right with space', 'woocommerce-multilingual' ),
2808
 
2809
+ msgid "Left with space"
2810
  msgstr ""
2811
 
2812
+ # 'left_space' => __( 'Left with space', 'woocommerce-multilingual' ),
2813
+ # 'right_space' => __( 'Right with space', 'woocommerce-multilingual' ),
2814
+ # ),
2815
 
2816
+ msgid "Right with space"
2817
  msgstr ""
2818
 
2819
+ # 'thousand_sep' => array(
2820
+ # 'label' => __( 'Thousand Separator', 'woocommerce-multilingual' )
2821
+ # ),
2822
 
2823
+ msgid "Thousand Separator"
2824
  msgstr ""
2825
 
2826
+ # 'decimal_sep' => array(
2827
+ # 'label' =>__( 'Decimal Separator', 'woocommerce-multilingual' )
2828
+ # ),
2829
 
2830
+ msgid "Decimal Separator"
2831
  msgstr ""
2832
 
2833
+ # 'num_decimals' => array(
2834
+ # 'label' => __( 'Number of Decimals', 'woocommerce-multilingual' ),
2835
+ # 'only_numeric' => __( 'Only numeric', 'woocommerce-multilingual' )
2836
 
2837
+ msgid "Number of Decimals"
2838
  msgstr ""
2839
 
2840
+ # 'rounding' => array(
2841
+ # 'label' => __( 'Rounding to the nearest integer', 'woocommerce-multilingual' ),
2842
+ # 'disabled' => __( 'Disabled', 'woocommerce-multilingual' ),
2843
 
2844
+ msgid "Rounding to the nearest integer"
2845
  msgstr ""
2846
 
2847
+ # 'label' => __( 'Rounding to the nearest integer', 'woocommerce-multilingual' ),
2848
+ # 'disabled' => __( 'Disabled', 'woocommerce-multilingual' ),
2849
+ # 'up' => __( 'Up', 'woocommerce-multilingual' ),
2850
 
2851
+ msgid "Disabled"
2852
  msgstr ""
2853
 
2854
+ # 'disabled' => __( 'Disabled', 'woocommerce-multilingual' ),
2855
+ # 'up' => __( 'Up', 'woocommerce-multilingual' ),
2856
+ # 'down' => __( 'Down', 'woocommerce-multilingual' ),
2857
 
2858
+ msgid "Up"
2859
  msgstr ""
2860
 
2861
+ # 'up' => __( 'Up', 'woocommerce-multilingual' ),
2862
+ # 'down' => __( 'Down', 'woocommerce-multilingual' ),
2863
+ # 'nearest' => __( 'Nearest', 'woocommerce-multilingual' ),
2864
 
2865
+ msgid "Down"
2866
  msgstr ""
2867
 
2868
+ # 'down' => __( 'Down', 'woocommerce-multilingual' ),
2869
+ # 'nearest' => __( 'Nearest', 'woocommerce-multilingual' ),
2870
+ # 'increment' => __( 'Increment for nearest integer', 'woocommerce-multilingual' ),
2871
 
2872
+ msgid "Nearest"
2873
  msgstr ""
2874
 
2875
+ # 'nearest' => __( 'Nearest', 'woocommerce-multilingual' ),
2876
+ # 'increment' => __( 'Increment for nearest integer', 'woocommerce-multilingual' ),
2877
  #
2878
 
2879
+ msgid "Increment for nearest integer"
2880
  msgstr ""
2881
 
2882
  #
2883
+ # 'rounding_tooltip' => sprintf( __("Round the converted price to the closest integer. %se.g. 15.78 becomes 16.00", 'woocommerce-multilingual'), '<br />' ),
2884
+ # 'increment_tooltip' => sprintf( __('The resulting price will be an increment of this value after initial rounding.%se.g.:', 'woocommerce-multilingual'), '<br>' ) . '<br />' .
2885
 
2886
+ msgid "Round the converted price to the closest integer. %se.g. 15.78 becomes 16.00"
2887
  msgstr ""
2888
 
2889
+ # 'rounding_tooltip' => sprintf( __("Round the converted price to the closest integer. %se.g. 15.78 becomes 16.00", 'woocommerce-multilingual'), '<br />' ),
2890
+ # 'increment_tooltip' => sprintf( __('The resulting price will be an increment of this value after initial rounding.%se.g.:', 'woocommerce-multilingual'), '<br>' ) . '<br />' .
2891
+ # __('1454.07 &raquo; 1454 when set to 1', 'woocommerce-multilingual') . '<br />' .
2892
 
2893
+ msgid "The resulting price will be an increment of this value after initial rounding.%se.g.:"
2894
  msgstr ""
2895
 
2896
+ # 'increment_tooltip' => sprintf( __('The resulting price will be an increment of this value after initial rounding.%se.g.:', 'woocommerce-multilingual'), '<br>' ) . '<br />' .
2897
+ # __('1454.07 &raquo; 1454 when set to 1', 'woocommerce-multilingual') . '<br />' .
2898
+ # __('1454.07 &raquo; 1450 when set to 10', 'woocommerce-multilingual') . '<br />'.
2899
 
2900
+ msgid "1454.07 &raquo; 1454 when set to 1"
2901
  msgstr ""
2902
 
2903
+ # __('1454.07 &raquo; 1454 when set to 1', 'woocommerce-multilingual') . '<br />' .
2904
+ # __('1454.07 &raquo; 1450 when set to 10', 'woocommerce-multilingual') . '<br />'.
2905
+ # __('1454.07 &raquo; 1500 when set to 100', 'woocommerce-multilingual') . '<br />',
2906
 
2907
+ msgid "1454.07 &raquo; 1450 when set to 10"
2908
  msgstr ""
2909
 
2910
+ # __('1454.07 &raquo; 1450 when set to 10', 'woocommerce-multilingual') . '<br />'.
2911
+ # __('1454.07 &raquo; 1500 when set to 100', 'woocommerce-multilingual') . '<br />',
2912
+ # 'autosubtract_tooltip'=> __('The value to be subtracted from the amount obtained previously.', 'woocommerce-multilingual') . '<br /><br />' .
2913
 
2914
+ msgid "1454.07 &raquo; 1500 when set to 100"
2915
  msgstr ""
2916
 
2917
+ # __('1454.07 &raquo; 1500 when set to 100', 'woocommerce-multilingual') . '<br />',
2918
+ # 'autosubtract_tooltip'=> __('The value to be subtracted from the amount obtained previously.', 'woocommerce-multilingual') . '<br /><br />' .
2919
+ # __('For 1454.07, when the increment for the nearest integer is 100 and the auto-subtract amount is 1, the resulting amount is 1499.', 'woocommerce-multilingual')
2920
 
2921
+ msgid "The value to be subtracted from the amount obtained previously."
2922
  msgstr ""
2923
 
2924
+ # 'autosubtract_tooltip'=> __('The value to be subtracted from the amount obtained previously.', 'woocommerce-multilingual') . '<br /><br />' .
2925
+ # __('For 1454.07, when the increment for the nearest integer is 100 and the auto-subtract amount is 1, the resulting amount is 1499.', 'woocommerce-multilingual')
2926
+ # ),
2927
 
2928
+ msgid "For 1454.07, when the increment for the nearest integer is 100 and the auto-subtract amount is 1, the resulting amount is 1499."
2929
  msgstr ""
2930
 
2931
+ # 'autosubtract' => array(
2932
+ # 'label' => __( 'Autosubtract amount', 'woocommerce-multilingual' ),
2933
+ # 'only_numeric' => __( 'Only numeric', 'woocommerce-multilingual' )
2934
 
2935
+ msgid "Autosubtract amount"
2936
  msgstr ""
2937
 
2938
+ #
2939
+ # 'cancel' => __( 'Cancel', 'woocommerce-multilingual' ),
2940
+ # 'save' => __( 'Save', 'woocommerce-multilingual' )
2941
 
2942
+ msgid "Cancel"
2943
  msgstr ""
2944
 
2945
+ # 'cancel' => __( 'Cancel', 'woocommerce-multilingual' ),
2946
+ # 'save' => __( 'Save', 'woocommerce-multilingual' )
2947
+ #
2948
 
2949
+ msgid "Save"
2950
  msgstr ""
2951
 
2952
+ # 'automatic_rates' => $exchange_rates_automatic,
2953
+ # 'automatic_rates_tip' => sprintf( __('Exchange rate updated automatically from %s', 'woocommerce-multilingual' ), $exchange_rates_service ),
2954
+ # 'current_currency' => $current_currency
2955
 
2956
+ msgid "Exchange rate updated automatically from %s"
2957
  msgstr ""
2958
 
2959
+ # $this->custom_prices_fields = apply_filters( 'wcml_custom_prices_fields', array( '_regular_price', '_sale_price' ), $product_id );
2960
+ # $this->custom_prices_fields_labels = apply_filters( 'wcml_custom_prices_fields_labels', array( '_regular_price' => __( 'Regular Price', 'woocommerce-multilingual' ), '_sale_price' => __( 'Sale Price', 'woocommerce-multilingual' ) ), $product_id );
2961
+ #
2962
 
2963
+ msgid "Regular Price"
2964
  msgstr ""
2965
 
2966
+ # $this->custom_prices_fields = apply_filters( 'wcml_custom_prices_fields', array( '_regular_price', '_sale_price' ), $product_id );
2967
+ # $this->custom_prices_fields_labels = apply_filters( 'wcml_custom_prices_fields_labels', array( '_regular_price' => __( 'Regular Price', 'woocommerce-multilingual' ), '_sale_price' => __( 'Sale Price', 'woocommerce-multilingual' ) ), $product_id );
2968
+ #
2969
 
2970
+ msgid "Sale Price"
2971
  msgstr ""
2972
 
2973
+ # 'strings' => apply_filters( 'wcml_custom_prices_strings', array(
2974
+ # 'not_set' => sprintf( __( 'Multi-currency is enabled but no secondary currencies have been set. %sAdd secondary currencies%s.',
2975
+ # 'woocommerce-multilingual' ), '<a href="' . admin_url('admin.php?page=wpml-wcml&tab=multi-currency') . '">', '</a>' ),
2976
 
2977
+ msgid "Multi-currency is enabled but no secondary currencies have been set. %sAdd secondary currencies%s."
2978
  msgstr ""
2979
 
2980
+ # 'woocommerce-multilingual' ), '<a href="' . admin_url('admin.php?page=wpml-wcml&tab=multi-currency') . '">', '</a>' ),
2981
+ # 'calc_auto' => __( 'Calculate prices in other currencies automatically', 'woocommerce-multilingual' ),
2982
+ # 'see_prices' => __( 'Click to see the prices in the other currencies as they are currently shown on the front end.', 'woocommerce-multilingual' ),
2983
 
2984
+ msgid "Calculate prices in other currencies automatically"
2985
  msgstr ""
2986
 
2987
+ # 'calc_auto' => __( 'Calculate prices in other currencies automatically', 'woocommerce-multilingual' ),
2988
+ # 'see_prices' => __( 'Click to see the prices in the other currencies as they are currently shown on the front end.', 'woocommerce-multilingual' ),
2989
+ # 'show' => __( 'Show', 'woocommerce-multilingual' ),
2990
 
2991
+ msgid "Click to see the prices in the other currencies as they are currently shown on the front end."
2992
  msgstr ""
2993
 
2994
+ # 'see_prices' => __( 'Click to see the prices in the other currencies as they are currently shown on the front end.', 'woocommerce-multilingual' ),
2995
+ # 'show' => __( 'Show', 'woocommerce-multilingual' ),
2996
+ # 'hide' => __( 'Hide', 'woocommerce-multilingual' ),
2997
 
2998
+ msgid "Show"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2999
  msgstr ""
3000
 
3001
  # 'hide' => __( 'Hide', 'woocommerce-multilingual' ),
3075
  msgid "Please enter in a value less than the regular price"
3076
  msgstr ""
3077
 
3078
+ # 'headers' => array(
3079
+ # 'enable_disable' => __( 'Enable/disable', 'woocommerce-multilingual' ),
3080
+ # 'currencies' => __( 'Currencies', 'woocommerce-multilingual' ),
3081
 
3082
+ msgid "Enable/disable"
3083
  msgstr ""
3084
 
3085
+ # 'enable_disable' => __( 'Enable/disable', 'woocommerce-multilingual' ),
3086
+ # 'currencies' => __( 'Currencies', 'woocommerce-multilingual' ),
3087
+ # ),
3088
 
3089
+ msgid "Currencies"
3090
  msgstr ""
3091
 
3092
+ # ),
3093
+ # 'add_currency_button' => __( 'Add currency', 'woocommerce-multilingual' ),
3094
+ # 'currencies_table' => array(
3095
 
3096
+ msgid "Add currency"
3097
  msgstr ""
3098
 
3099
+ # 'currencies_table' => array(
3100
+ # 'head_currency' => __('Currency', 'woocommerce-multilingual'),
3101
+ # 'head_rate' => __('Rate', 'woocommerce-multilingual'),
3102
 
3103
+ msgid "Currency"
3104
  msgstr ""
3105
 
3106
+ # 'head_currency' => __('Currency', 'woocommerce-multilingual'),
3107
+ # 'head_rate' => __('Rate', 'woocommerce-multilingual'),
3108
+ # 'default' => __( 'default', 'woocommerce-multilingual' ),
3109
 
3110
+ msgid "Rate"
3111
  msgstr ""
3112
 
3113
+ # 'head_rate' => __('Rate', 'woocommerce-multilingual'),
3114
+ # 'default' => __( 'default', 'woocommerce-multilingual' ),
3115
+ # 'edit' => __( 'Edit', 'woocommerce-multilingual' ),
3116
 
3117
+ msgid "default"
3118
  msgstr ""
3119
 
3120
+ # 'edit' => __( 'Edit', 'woocommerce-multilingual' ),
3121
+ # 'default_currency' => __( 'Default currency', 'woocommerce-multilingual' ),
3122
+ # 'default_cur_tip' => __( 'Switch to this currency when switching language in the front-end', 'woocommerce-multilingual' ),
3123
 
3124
+ msgid "Default currency"
3125
  msgstr ""
3126
 
3127
+ # 'default_currency' => __( 'Default currency', 'woocommerce-multilingual' ),
3128
+ # 'default_cur_tip' => __( 'Switch to this currency when switching language in the front-end', 'woocommerce-multilingual' ),
3129
+ # 'keep_currency' => __( 'Keep', 'woocommerce-multilingual' ),
3130
 
3131
+ msgid "Switch to this currency when switching language in the front-end"
3132
  msgstr ""
3133
 
3134
+ # 'default_cur_tip' => __( 'Switch to this currency when switching language in the front-end', 'woocommerce-multilingual' ),
3135
+ # 'keep_currency' => __( 'Keep', 'woocommerce-multilingual' ),
3136
+ # 'delete' => __( 'Delete', 'woocommerce-multilingual' ),
3137
 
3138
+ msgid "Keep"
3139
  msgstr ""
3140
 
3141
+ # 'keep_currency' => __( 'Keep', 'woocommerce-multilingual' ),
3142
+ # 'delete' => __( 'Delete', 'woocommerce-multilingual' ),
3143
+ # 'help_title' => __( 'Currencies to display for each language', 'woocommerce-multilingual' ),
3144
 
3145
+ msgid "Delete"
3146
  msgstr ""
3147
 
3148
+ # 'delete' => __( 'Delete', 'woocommerce-multilingual' ),
3149
+ # 'help_title' => __( 'Currencies to display for each language', 'woocommerce-multilingual' ),
3150
+ # 'enable_for' => __('Enable %s for %s', 'woocommerce-multilingual'),
3151
 
3152
+ msgid "Currencies to display for each language"
3153
  msgstr ""
3154
 
3155
+ # 'help_title' => __( 'Currencies to display for each language', 'woocommerce-multilingual' ),
3156
+ # 'enable_for' => __('Enable %s for %s', 'woocommerce-multilingual'),
3157
+ # 'disable_for' => __('Disable %s for %s', 'woocommerce-multilingual')
3158
 
3159
+ msgid "Enable %s for %s"
3160
  msgstr ""
3161
 
3162
+ # 'enable_for' => __('Enable %s for %s', 'woocommerce-multilingual'),
3163
+ # 'disable_for' => __('Disable %s for %s', 'woocommerce-multilingual')
3164
+ # )
3165
 
3166
+ msgid "Disable %s for %s"
3167
  msgstr ""
3168
 
3169
+ # 'wc_currencies' => $this->wc_currencies,
3170
+ # 'positioned_price' => sprintf( __( ' (%s)', 'woocommerce-multilingual' ), $this->get_positioned_price( $this->wc_currency ) ) ,
3171
+ #
3172
 
3173
+ msgid " (%s)"
3174
  msgstr ""
3175
 
3176
+ #
3177
+ # 'wc_currency_empty_warn' => sprintf(__('The multi-currency mode cannot be enabled as a specific currency was not set. Go to the %sWooCommerce settings%s page and select the default currency for your store.',
3178
+ # 'woocommerce-multilingual'), '<a href="' . admin_url('admin.php?page=wc-settings') . '">', '</a>'),
3179
 
3180
+ msgid "The multi-currency mode cannot be enabled as a specific currency was not set. Go to the %sWooCommerce settings%s page and select the default currency for your store."
3181
  msgstr ""
3182
 
3183
+ # 'mco_disabled' => empty($wc_currency),
3184
+ # 'label_mco' => __( "Enable the multi-currency mode", 'woocommerce-multilingual' ),
3185
+ # 'label_mco_learn_url' => WCML_Links::generate_tracking_link( 'https://wpml.org/documentation/related-projects/woocommerce-multilingual/multi-currency-support-woocommerce/', 'multi-currency-support-woocommerce', 'documentation' ),
3186
 
3187
+ msgid "Enable the multi-currency mode"
3188
  msgstr ""
3189
 
3190
+ # 'checked' => $this->woocommerce_wpml->settings['display_custom_prices'] == 1,
3191
+ # 'label' => __( 'Show only products with custom prices in secondary currencies', 'woocommerce-multilingual' ),
3192
+ # 'tip' => __( 'When this option is on, when you switch to a secondary currency on the front end, only the products with custom prices in that currency are being displayed. Products with prices determined based on the exchange rate are hidden.', 'woocommerce-multilingual' )
3193
 
3194
+ msgid "Show only products with custom prices in secondary currencies"
3195
  msgstr ""
3196
 
3197
+ # 'label' => __( 'Show only products with custom prices in secondary currencies', 'woocommerce-multilingual' ),
3198
+ # 'tip' => __( 'When this option is on, when you switch to a secondary currency on the front end, only the products with custom prices in that currency are being displayed. Products with prices determined based on the exchange rate are hidden.', 'woocommerce-multilingual' )
3199
+ # ),
3200
 
3201
+ msgid "When this option is on, when you switch to a secondary currency on the front end, only the products with custom prices in that currency are being displayed. Products with prices determined based on the exchange rate are hidden."
3202
  msgstr ""
3203
 
3204
+ # 'submit' => __( 'Save changes', 'woocommerce-multilingual' ),
3205
+ # 'navigate_warn' => __( 'The changes you made will be lost if you navigate away from this page.', 'woocommerce-multilingual' ),
3206
+ # 'cur_lang_warn' => __( 'At least one currency must be enabled for this language!', 'woocommerce-multilingual' )
3207
 
3208
+ msgid "The changes you made will be lost if you navigate away from this page."
3209
  msgstr ""
3210
 
3211
+ # 'navigate_warn' => __( 'The changes you made will be lost if you navigate away from this page.', 'woocommerce-multilingual' ),
3212
+ # 'cur_lang_warn' => __( 'At least one currency must be enabled for this language!', 'woocommerce-multilingual' )
3213
  #
 
 
3214
 
3215
+ msgid "At least one currency must be enabled for this language!"
3216
  msgstr ""
3217
 
3218
+ # 'headers' => array(
3219
+ # 'main' => __('Currency switcher options', 'woocommerce-multilingual'),
3220
+ # 'style' => __('Currency switcher style', 'woocommerce-multilingual'),
3221
 
3222
+ msgid "Currency switcher options"
3223
  msgstr ""
3224
 
3225
+ # 'main' => __('Currency switcher options', 'woocommerce-multilingual'),
3226
+ # 'style' => __('Currency switcher style', 'woocommerce-multilingual'),
3227
+ # 'order' => __( 'Currency order', 'woocommerce-multilingual' ),
3228
 
3229
+ msgid "Currency switcher style"
3230
  msgstr ""
3231
 
3232
+ # 'style' => __('Currency switcher style', 'woocommerce-multilingual'),
3233
+ # 'order' => __( 'Currency order', 'woocommerce-multilingual' ),
3234
+ # 'parameters' => __( 'Available parameters', 'woocommerce-multilingual' ),
3235
 
3236
+ msgid "Currency order"
3237
  msgstr ""
3238
 
3239
+ # 'order' => __( 'Currency order', 'woocommerce-multilingual' ),
3240
+ # 'parameters' => __( 'Available parameters', 'woocommerce-multilingual' ),
3241
+ # 'parameters_list' => '%code%, %symbol%, %name%, %subtotal%',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3242
 
3243
+ msgid "Available parameters"
3244
  msgstr ""
3245
 
3246
+ # 'parameters_list' => '%code%, %symbol%, %name%, %subtotal%',
3247
+ # 'template' => __( 'Template for currency switcher', 'woocommerce-multilingual' ),
3248
+ # 'visibility' => __('Visibility', 'woocommerce-multilingual')
3249
 
3250
+ msgid "Template for currency switcher"
3251
  msgstr ""
3252
 
3253
+ # 'template' => __( 'Template for currency switcher', 'woocommerce-multilingual' ),
3254
+ # 'visibility' => __('Visibility', 'woocommerce-multilingual')
3255
+ # ),
3256
 
3257
+ msgid "Visibility"
3258
  msgstr ""
3259
 
3260
+ # 'preview' => $this->woocommerce_wpml->multi_currency->currency_switcher->wcml_currency_switcher( array('echo' => false) ),
3261
+ # 'preview_text' => __( 'Currency switcher preview', 'woocommerce-multilingual' ),
3262
+ # 'style' => isset($this->woocommerce_wpml->settings['currency_switcher_style']) ? $this->woocommerce_wpml->settings['currency_switcher_style'] : false,
3263
 
3264
+ msgid "Currency switcher preview"
3265
  msgstr ""
3266
 
3267
+ # 'options' => array(
3268
+ # 'dropdown' => __('Drop-down menu', 'woocommerce-multilingual'),
3269
+ # 'list' => __('List of currencies', 'woocommerce-multilingual'),
3270
 
3271
+ msgid "Drop-down menu"
3272
  msgstr ""
3273
 
3274
+ # 'dropdown' => __('Drop-down menu', 'woocommerce-multilingual'),
3275
+ # 'list' => __('List of currencies', 'woocommerce-multilingual'),
3276
+ # 'vertical' => __('Vertical', 'woocommerce-multilingual'),
3277
 
3278
+ msgid "List of currencies"
3279
  msgstr ""
3280
 
3281
+ # 'list' => __('List of currencies', 'woocommerce-multilingual'),
3282
+ # 'vertical' => __('Vertical', 'woocommerce-multilingual'),
3283
+ # 'horizontal' => __('Horizontal', 'woocommerce-multilingual'),
3284
 
3285
+ msgid "Vertical"
3286
  msgstr ""
3287
 
3288
+ # 'vertical' => __('Vertical', 'woocommerce-multilingual'),
3289
+ # 'horizontal' => __('Horizontal', 'woocommerce-multilingual'),
3290
+ # 'allowed_tags' => __('Allowed HTML tags: <img> <span> <u> <strong> <em>', 'woocommerce-multilingual')
3291
 
3292
+ msgid "Horizontal"
3293
  msgstr ""
3294
 
3295
+ # 'horizontal' => __('Horizontal', 'woocommerce-multilingual'),
3296
+ # 'allowed_tags' => __('Allowed HTML tags: <img> <span> <u> <strong> <em>', 'woocommerce-multilingual')
3297
+ # ),
3298
 
3299
+ msgid "Allowed HTML tags: <img> <span> <u> <strong> <em>"
3300
  msgstr ""
3301
 
3302
+ # 'order_nonce' => wp_create_nonce( 'set_currencies_order_nonce' ),
3303
+ # 'order_tip' => __( 'Drag the currencies to change their order', 'woocommerce-multilingual' ),
3304
+ # 'parameters_tip' => __( '%name%, %symbol%, %code%', 'woocommerce-multilingual' ),
3305
 
3306
+ msgid "Drag the currencies to change their order"
3307
  msgstr ""
3308
 
3309
+ # 'order_tip' => __( 'Drag the currencies to change their order', 'woocommerce-multilingual' ),
3310
+ # 'parameters_tip' => __( '%name%, %symbol%, %code%', 'woocommerce-multilingual' ),
3311
+ # 'template' => isset($this->woocommerce_wpml->settings['wcml_curr_template']) ?
3312
 
3313
+ msgid "%name%, %symbol%, %code%"
3314
  msgstr ""
3315
 
3316
+ # $this->woocommerce_wpml->settings['wcml_curr_template'] : '',
3317
+ # 'template_tip' => __( 'Default: %name% (%symbol%) - %code%', 'woocommerce-multilingual' ),
3318
+ # 'template_default' => '%name% (%symbol%) - %code%',
3319
 
3320
+ msgid "Default: %name% (%symbol%) - %code%"
3321
  msgstr ""
3322
 
3323
+ # 'template_default' => '%name% (%symbol%) - %code%',
3324
+ # 'visibility_label' => __('Show a currency selector on the product page template', 'woocommerce-multilingual'),
3325
+ # 'visibility_on' => isset($this->woocommerce_wpml->settings['currency_switcher_product_visibility']) ?
3326
 
3327
+ msgid "Show a currency selector on the product page template"
3328
  msgstr ""
3329
 
3330
+ # 'products' => $this->get_removed_products(),
3331
+ # 'title' => sprintf( __( 'Products removed after switching to %s:', 'woocommerce-multilingual'), $switched_to ),
3332
+ # 'clear' => __( 'Clear list', 'woocommerce-multilingual'),
3333
 
3334
+ msgid "Products removed after switching to %s:"
3335
  msgstr ""
3336
 
3337
+ # 'title' => sprintf( __( 'Products removed after switching to %s:', 'woocommerce-multilingual'), $switched_to ),
3338
+ # 'clear' => __( 'Clear list', 'woocommerce-multilingual'),
3339
+ # 'nonce' => wp_create_nonce( 'wcml_clear_removed_items' ),
3340
 
3341
+ msgid "Clear list"
3342
  msgstr ""
3343
 
3344
  # 'troubl' => __( 'Troubleshooting', 'woocommerce-multilingual' ),
3406
 
3407
  # 'dup_terms' => __( 'Duplicate terms ( please select attribute ):', 'woocommerce-multilingual' ),
3408
  # 'none' => __( 'none', 'woocommerce-multilingual' ),
3409
+ # 'start' => __( 'Start', 'woocommerce-multilingual' ),
3410
 
3411
  msgid "none"
3412
  msgstr ""
3413
 
3414
  # 'none' => __( 'none', 'woocommerce-multilingual' ),
3415
+ # 'start' => __( 'Start', 'woocommerce-multilingual' ),
3416
+ # 'delete_terms' => __( 'Fix product_type taxonomy terms', 'woocommerce-multilingual' ),
3417
 
3418
  msgid "Start"
3419
  msgstr ""
3420
 
3421
+ # 'start' => __( 'Start', 'woocommerce-multilingual' ),
3422
+ # 'delete_terms' => __( 'Fix product_type taxonomy terms', 'woocommerce-multilingual' ),
3423
+ # 'product_type_fix_done' => __( 'Done!', 'woocommerce-multilingual' )
3424
 
3425
+ msgid "Fix product_type taxonomy terms"
3426
  msgstr ""
3427
 
3428
+ # 'delete_terms' => __( 'Fix product_type taxonomy terms', 'woocommerce-multilingual' ),
3429
+ # 'product_type_fix_done' => __( 'Done!', 'woocommerce-multilingual' )
3430
+ # ),
3431
 
3432
+ msgid "Done!"
3433
  msgstr ""
3434
 
3435
+ # 'title' => __('WooCommerce Multilingual', 'woocommerce-multilingual'),
3436
+ # 'required'=> __('Required plugins', 'woocommerce-multilingual'),
3437
+ # 'plugins'=> __('Plugins Status', 'woocommerce-multilingual'),
3438
 
3439
+ msgid "Required plugins"
3440
  msgstr ""
3441
 
3442
+ # 'depends'=> __('WooCommerce Multilingual depends on several plugins to work. If any required plugin is missing, you should install and activate it.', 'woocommerce-multilingual'),
3443
+ # 'old_wpml_link'=> sprintf( __( 'WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href="%s">WPML</a> versions prior 2.0.5.', 'woocommerce-multilingual' ), WCML_Links::generate_tracking_link( 'https://wpml.org/' ) ),
3444
+ # 'update_wpml'=> __( 'Update WPML', 'woocommerce-multilingual' ),
3445
 
3446
+ msgid "WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href=\"%s\">WPML</a> versions prior 2.0.5."
3447
  msgstr ""
3448
 
3449
+ # 'old_wpml_link'=> sprintf( __( 'WooCommerce Multilingual is enabled but not effective. It is not compatible with <a href="%s">WPML</a> versions prior 2.0.5.', 'woocommerce-multilingual' ), WCML_Links::generate_tracking_link( 'https://wpml.org/' ) ),
3450
+ # 'update_wpml'=> __( 'Update WPML', 'woocommerce-multilingual' ),
3451
+ # 'upgrade_wpml'=> __( 'Upgrade WPML', 'woocommerce-multilingual' ),
3452
 
3453
+ msgid "Update WPML"
3454
  msgstr ""
3455
 
3456
+ # 'update_wpml'=> __( 'Update WPML', 'woocommerce-multilingual' ),
3457
+ # 'upgrade_wpml'=> __( 'Upgrade WPML', 'woocommerce-multilingual' ),
3458
+ # 'get_wpml'=> __( 'Get WPML', 'woocommerce-multilingual' ),
3459
 
3460
+ msgid "Upgrade WPML"
3461
  msgstr ""
3462
 
3463
+ # 'upgrade_wpml'=> __( 'Upgrade WPML', 'woocommerce-multilingual' ),
3464
+ # 'get_wpml'=> __( 'Get WPML', 'woocommerce-multilingual' ),
3465
+ # 'get_wpml_media'=> __( 'Get WPML Media', 'woocommerce-multilingual' ),
3466
 
3467
+ msgid "Get WPML"
3468
  msgstr ""
3469
 
3470
+ # 'get_wpml'=> __( 'Get WPML', 'woocommerce-multilingual' ),
3471
+ # 'get_wpml_media'=> __( 'Get WPML Media', 'woocommerce-multilingual' ),
3472
+ # 'get_wpml_tm'=> __( 'Get WPML Translation Management', 'woocommerce-multilingual' ),
3473
 
3474
+ msgid "Get WPML Media"
3475
  msgstr ""
3476
 
3477
+ # 'get_wpml_media'=> __( 'Get WPML Media', 'woocommerce-multilingual' ),
3478
+ # 'get_wpml_tm'=> __( 'Get WPML Translation Management', 'woocommerce-multilingual' ),
3479
+ # 'get_wpml_st'=> __( 'Get WPML String Translation', 'woocommerce-multilingual' ),
3480
 
3481
+ msgid "Get WPML Translation Management"
3482
  msgstr ""
3483
 
3484
+ # 'get_wpml_tm'=> __( 'Get WPML Translation Management', 'woocommerce-multilingual' ),
3485
+ # 'get_wpml_st'=> __( 'Get WPML String Translation', 'woocommerce-multilingual' ),
3486
+ # 'new_design_wpml_link'=> sprintf( __( 'You are using WooCommerce Multilingual %s. This version includes an important UI redesign for the configuration screens and it requires <a href="%s">WPML %s</a> or higher. Everything still works on the front end now but, in order to configure options for WooCommerce Multilingual, you need to upgrade WPML.', 'woocommerce-multilingual' ), WCML_VERSION, WCML_Links::generate_tracking_link( 'https://wpml.org/' ), '3.4' ),
3487
 
3488
+ msgid "Get WPML String Translation"
 
3489
  msgstr ""
3490
 
3491
+ # 'get_wpml_st'=> __( 'Get WPML String Translation', 'woocommerce-multilingual' ),
3492
+ # 'new_design_wpml_link'=> sprintf( __( 'You are using WooCommerce Multilingual %s. This version includes an important UI redesign for the configuration screens and it requires <a href="%s">WPML %s</a> or higher. Everything still works on the front end now but, in order to configure options for WooCommerce Multilingual, you need to upgrade WPML.', 'woocommerce-multilingual' ), WCML_VERSION, WCML_Links::generate_tracking_link( 'https://wpml.org/' ), '3.4' ),
3493
+ # 'wpml' => '<strong>WPML</strong>',
3494
 
3495
+ msgid "You are using WooCommerce Multilingual %s. This version includes an important UI redesign for the configuration screens and it requires <a href=\"%s\">WPML %s</a> or higher. Everything still works on the front end now but, in order to configure options for WooCommerce Multilingual, you need to upgrade WPML."
 
3496
  msgstr ""
3497
 
3498
+ # 'not_setup' => __( '%s is not set up.', 'woocommerce-multilingual' ),
3499
+ # 'not_inst' => __( '%s is either not installed or not active.', 'woocommerce-multilingual' ),
3500
+ # 'wpml_not_inst' => sprintf( __( '%s is either not installed or not active.', 'woocommerce-multilingual' ),'<strong><a title="' . esc_attr__('The WordPress Multilingual Plugin', 'woocommerce-multilingual') .'" href="' . WCML_Links::generate_tracking_link( 'https://wpml.org/' ) . '">WPML</a></strong>' ),
3501
 
3502
+ msgid "%s is either not installed or not active."
3503
  msgstr ""
3504
 
3505
+ # 'wpml_not_inst' => sprintf( __( '%s is either not installed or not active.', 'woocommerce-multilingual' ),'<strong><a title="' . esc_attr__('The WordPress Multilingual Plugin', 'woocommerce-multilingual') .'" href="' . WCML_Links::generate_tracking_link( 'https://wpml.org/' ) . '">WPML</a></strong>' ),
3506
+ # 'old_wc' => sprintf( __( '%1$s is installed, but with incorrect version. You need %1$s %2$s or higher. ', 'woocommerce-multilingual' ), '<strong>WooCommerce</strong>', '2.0' ),
3507
+ # 'download_wc' => __( 'Download WooCommerce', 'woocommerce-multilingual' ),
3508
 
3509
+ msgid "%1$s is installed, but with incorrect version. You need %1$s %2$s or higher. "
3510
+ msgstr ""
3511
+
3512
+ # 'old_wc' => sprintf( __( '%1$s is installed, but with incorrect version. You need %1$s %2$s or higher. ', 'woocommerce-multilingual' ), '<strong>WooCommerce</strong>', '2.0' ),
3513
+ # 'download_wc' => __( 'Download WooCommerce', 'woocommerce-multilingual' ),
3514
+ # )
3515
+
3516
+ msgid "Download WooCommerce"
3517
+ msgstr ""
3518
+
3519
+ # 'not_inst' => __( '%s is either not installed or not active.', 'woocommerce-multilingual' ),
3520
+ # 'wpml_not_inst' => sprintf( __( '%s is either not installed or not active.', 'woocommerce-multilingual' ),'<strong><a title="' . esc_attr__('The WordPress Multilingual Plugin', 'woocommerce-multilingual') .'" href="' . WCML_Links::generate_tracking_link( 'https://wpml.org/' ) . '">WPML</a></strong>' ),
3521
+ # 'old_wc' => sprintf( __( '%1$s is installed, but with incorrect version. You need %1$s %2$s or higher. ', 'woocommerce-multilingual' ), '<strong>WooCommerce</strong>', '2.0' ),
3522
+
3523
+ msgid "The WordPress Multilingual Plugin"
3524
+ msgstr ""
3525
+
3526
+ # 'strings' => array(
3527
+ # 'heading' => __('Setup Complete', 'woocommerce-multilingual'),
3528
+ # 'description1' => __("Your multilingual shop is almost ready. Next, you should go to the different tabs in %sWooCommerce &raquo; WooCommerce Multilingual%s admin and do the final setup.", 'woocommerce-multilingual'),
3529
+
3530
+ msgid "Setup Complete"
3531
+ msgstr ""
3532
+
3533
+ # 'heading' => __('Setup Complete', 'woocommerce-multilingual'),
3534
+ # 'description1' => __("Your multilingual shop is almost ready. Next, you should go to the different tabs in %sWooCommerce &raquo; WooCommerce Multilingual%s admin and do the final setup.", 'woocommerce-multilingual'),
3535
+ # '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'),
3536
+
3537
+ msgid "Your multilingual shop is almost ready. Next, you should go to the different tabs in %sWooCommerce &raquo; WooCommerce Multilingual%s admin and do the final setup."
3538
+ msgstr ""
3539
+
3540
+ # 'description1' => __("Your multilingual shop is almost ready. Next, you should go to the different tabs in %sWooCommerce &raquo; WooCommerce Multilingual%s admin and do the final setup.", 'woocommerce-multilingual'),
3541
+ # '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'),
3542
+ # 'continue' => __('Close setup', 'woocommerce-multilingual'),
3543
+
3544
+ msgid "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."
3545
+ msgstr ""
3546
+
3547
+ # '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'),
3548
+ # 'continue' => __('Close setup', 'woocommerce-multilingual'),
3549
+ # ),
3550
+
3551
+ msgid "Close setup"
3552
+ msgstr ""
3553
+
3554
+ #
3555
+ # $store_pages_view = '<p><i class="otgs-ico-warning"></i> ' . __('One or more WooCommerce pages have not been created') . '<p>';
3556
+ #
3557
+
3558
+ msgid "One or more WooCommerce pages have not been created"
3559
+ msgstr ""
3560
+
3561
+ # '<label><input type="checkbox" name="install_missing_pages" value="1" checked="checked">&nbsp;' .
3562
+ # __('Install missing WooCommerce pages and create translations.', 'woocommerce-multilingual') .
3563
+ # '</label>';
3564
+
3565
+ msgid "Install missing WooCommerce pages and create translations."
3566
+ msgstr ""
3567
+
3568
+ # 'strings' => array(
3569
+ # 'heading' => __('Translate Store Pages', 'woocommerce-multilingual'),
3570
+ # 'description' => __("All store pages must be translated in the languages configured on the site.", 'woocommerce-multilingual'),
3571
+
3572
+ msgid "Translate Store Pages"
3573
+ msgstr ""
3574
+
3575
+ # 'heading' => __('Translate Store Pages', 'woocommerce-multilingual'),
3576
+ # 'description' => __("All store pages must be translated in the languages configured on the site.", 'woocommerce-multilingual'),
3577
+ # 'continue' => __('Continue', 'woocommerce-multilingual'),
3578
+
3579
+ msgid "All store pages must be translated in the languages configured on the site."
3580
+ msgstr ""
3581
+
3582
+ # 'description' => __("All store pages must be translated in the languages configured on the site.", 'woocommerce-multilingual'),
3583
+ # 'continue' => __('Continue', 'woocommerce-multilingual'),
3584
+ # ),
3585
+
3586
+ msgid "Continue"
3587
+ msgstr ""
3588
+
3589
+ # 'strings' => array(
3590
+ # 'heading' => __("Let's turn your WooCommerce shop multilingual", 'woocommerce-multilingual'),
3591
+ # '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'),
3592
+
3593
+ msgid "Let's turn your WooCommerce shop multilingual"
3594
+ msgstr ""
3595
+
3596
+ # 'heading' => __("Let's turn your WooCommerce shop multilingual", 'woocommerce-multilingual'),
3597
+ # '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'),
3598
+ # 'description2' => array(
3599
+
3600
+ msgid "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."
3601
+ msgstr ""
3602
+
3603
+ #
3604
+ # 'title' => __("We'll help you:", 'woocommerce-multilingual'),
3605
+ # 'step1' => __("Translate the 'store' pages", 'woocommerce-multilingual'),
3606
+
3607
+ msgid "We'll help you:"
3608
+ msgstr ""
3609
+
3610
+ # 'title' => __("We'll help you:", 'woocommerce-multilingual'),
3611
+ # 'step1' => __("Translate the 'store' pages", 'woocommerce-multilingual'),
3612
+ # 'step2' => __("Choose which attributes to make translatable", 'woocommerce-multilingual'),
3613
+
3614
+ msgid "Translate the 'store' pages"
3615
+ msgstr ""
3616
+
3617
+ # 'step1' => __("Translate the 'store' pages", 'woocommerce-multilingual'),
3618
+ # 'step2' => __("Choose which attributes to make translatable", 'woocommerce-multilingual'),
3619
+ # 'step3' => __("Choose if you need multiple currencies", 'woocommerce-multilingual'),
3620
+
3621
+ msgid "Choose which attributes to make translatable"
3622
+ msgstr ""
3623
+
3624
+ # 'step2' => __("Choose which attributes to make translatable", 'woocommerce-multilingual'),
3625
+ # 'step3' => __("Choose if you need multiple currencies", 'woocommerce-multilingual'),
3626
+ #
3627
+
3628
+ msgid "Choose if you need multiple currencies"
3629
+ msgstr ""
3630
+
3631
+ # ),
3632
+ # 'description3' => sprintf( __("You can make these updates now, or later from the %sWooCommerce &raquo; WooCommerce Multilingual%s menu.", 'woocommerce-multilingual'), '<strong>', '</strong>' ),
3633
+ # 'continue' => __("Let's continue", 'woocommerce-multilingual'),
3634
+
3635
+ msgid "You can make these updates now, or later from the %sWooCommerce &raquo; WooCommerce Multilingual%s menu."
3636
+ msgstr ""
3637
+
3638
+ # 'description3' => sprintf( __("You can make these updates now, or later from the %sWooCommerce &raquo; WooCommerce Multilingual%s menu.", 'woocommerce-multilingual'), '<strong>', '</strong>' ),
3639
+ # 'continue' => __("Let's continue", 'woocommerce-multilingual'),
3640
+ # 'later' => __("I'll do the setup later", 'woocommerce-multilingual')
3641
+
3642
+ msgid "Let's continue"
3643
+ msgstr ""
3644
+
3645
+ # 'continue' => __("Let's continue", 'woocommerce-multilingual'),
3646
+ # 'later' => __("I'll do the setup later", 'woocommerce-multilingual')
3647
+ # ),
3648
+
3649
+ msgid "I'll do the setup later"
3650
+ msgstr ""
3651
+
3652
+ # 'strings' => array(
3653
+ # 'heading' => __('Select Translatable Attributes', 'woocommerce-multilingual'),
3654
+ # 'no_attributes' => __('There are no attributes defined', 'woocommerce-multilingual'),
3655
+
3656
+ msgid "Select Translatable Attributes"
3657
+ msgstr ""
3658
+
3659
+ # 'heading' => __('Select Translatable Attributes', 'woocommerce-multilingual'),
3660
+ # 'no_attributes' => __('There are no attributes defined', 'woocommerce-multilingual'),
3661
+ # 'continue' => __('Continue', 'woocommerce-multilingual'),
3662
+
3663
+ msgid "There are no attributes defined"
3664
+ msgstr ""
3665
+
3666
+ # 'continue' => __('Continue', 'woocommerce-multilingual'),
3667
+ # 'later' => __('Later', 'woocommerce-multilingual')
3668
+ # ),
3669
+
3670
+ msgid "Later"
3671
+ msgstr ""
3672
+
3673
+ # 'strings' => array(
3674
+ # 'heading' => __( 'Enable Multiple Currencies', 'woocommerce-multilingual' ),
3675
+ # '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' ),
3676
+
3677
+ msgid "Enable Multiple Currencies"
3678
+ msgstr ""
3679
+
3680
+ # 'heading' => __( 'Enable Multiple Currencies', 'woocommerce-multilingual' ),
3681
+ # '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' ),
3682
+ # 'label_mco' => __( 'Enable the multi-currency mode', 'woocommerce-multilingual' ),
3683
+
3684
+ msgid "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."
3685
+ msgstr ""
3686
+
3687
+ # 'strings' => array(
3688
+ # 'notice' => __( 'This page allows you to translate all strings that are being used by WooCommerce in building different type of urls. Translating them enables you to have fully localized urls that match the language of the pages.', 'woocommerce-multilingual' ),
3689
+ # 'notice_defaults' => sprintf( __( 'You can enter or edit your default values on the %sPermalinks settings%s page or, for the endpoints, on the WooCommerce %sAccount settings%s page.',
3690
+
3691
+ msgid "This page allows you to translate all strings that are being used by WooCommerce in building different type of urls. Translating them enables you to have fully localized urls that match the language of the pages."
3692
+ msgstr ""
3693
+
3694
+ # 'notice' => __( 'This page allows you to translate all strings that are being used by WooCommerce in building different type of urls. Translating them enables you to have fully localized urls that match the language of the pages.', 'woocommerce-multilingual' ),
3695
+ # 'notice_defaults' => sprintf( __( 'You can enter or edit your default values on the %sPermalinks settings%s page or, for the endpoints, on the WooCommerce %sAccount settings%s page.',
3696
+ # 'woocommerce-multilingual' ),
3697
+
3698
+ msgid "You can enter or edit your default values on the %sPermalinks settings%s page or, for the endpoints, on the WooCommerce %sAccount settings%s page."
3699
+ msgstr ""
3700
+
3701
+ # ),
3702
+ # 'perm_settings' => '<a href="'.admin_url('options-permalink.php').'" >' .__( 'permalinks settings', 'woocommerce-multilingual' ).'</a>',
3703
+ # 'account_settings' => '<a href="admin.php?page=wc-settings&tab=account" >'.__( 'Account settings', 'woocommerce-multilingual' ).'</a>',
3704
+
3705
+ msgid "permalinks settings"
3706
+ msgstr ""
3707
+
3708
+ # 'perm_settings' => '<a href="'.admin_url('options-permalink.php').'" >' .__( 'permalinks settings', 'woocommerce-multilingual' ).'</a>',
3709
+ # 'account_settings' => '<a href="admin.php?page=wc-settings&tab=account" >'.__( 'Account settings', 'woocommerce-multilingual' ).'</a>',
3710
+ # 'slug_type' => __( 'Slug type', 'woocommerce-multilingual' ),
3711
+
3712
+ msgid "Account settings"
3713
+ msgstr ""
3714
+
3715
+ # 'account_settings' => '<a href="admin.php?page=wc-settings&tab=account" >'.__( 'Account settings', 'woocommerce-multilingual' ).'</a>',
3716
+ # 'slug_type' => __( 'Slug type', 'woocommerce-multilingual' ),
3717
+ # 'orig_slug' => __( 'Original Slug', 'woocommerce-multilingual' ),
3718
+
3719
+ msgid "Slug type"
3720
+ msgstr ""
3721
+
3722
+ # 'slug_type' => __( 'Slug type', 'woocommerce-multilingual' ),
3723
+ # 'orig_slug' => __( 'Original Slug', 'woocommerce-multilingual' ),
3724
+ # 'shop' => __( 'Shop page', 'woocommerce-multilingual' ),
3725
+
3726
+ msgid "Original Slug"
3727
+ msgstr ""
3728
+
3729
+ # 'orig_slug' => __( 'Original Slug', 'woocommerce-multilingual' ),
3730
+ # 'shop' => __( 'Shop page', 'woocommerce-multilingual' ),
3731
+ # 'product' => __( 'Product base', 'woocommerce-multilingual' ),
3732
+
3733
+ msgid "Shop page"
3734
+ msgstr ""
3735
+
3736
+ # 'shop' => __( 'Shop page', 'woocommerce-multilingual' ),
3737
+ # 'product' => __( 'Product base', 'woocommerce-multilingual' ),
3738
+ # 'category' => __( 'Product category base', 'woocommerce-multilingual' ),
3739
+
3740
+ msgid "Product base"
3741
+ msgstr ""
3742
+
3743
+ # 'product' => __( 'Product base', 'woocommerce-multilingual' ),
3744
+ # 'category' => __( 'Product category base', 'woocommerce-multilingual' ),
3745
+ # 'tag' => __( 'Product tag base', 'woocommerce-multilingual' ),
3746
+
3747
+ msgid "Product category base"
3748
+ msgstr ""
3749
+
3750
+ # 'category' => __( 'Product category base', 'woocommerce-multilingual' ),
3751
+ # 'tag' => __( 'Product tag base', 'woocommerce-multilingual' ),
3752
+ # 'attr' => __( 'Product attribute base', 'woocommerce-multilingual' ),
3753
+
3754
+ msgid "Product tag base"
3755
+ msgstr ""
3756
+
3757
+ # 'tag' => __( 'Product tag base', 'woocommerce-multilingual' ),
3758
+ # 'attr' => __( 'Product attribute base', 'woocommerce-multilingual' ),
3759
+ # 'endpoint' => __( 'Endpoint: %s', 'woocommerce-multilingual' ),
3760
+
3761
+ msgid "Product attribute base"
3762
+ msgstr ""
3763
+
3764
+ # 'endpoint' => __( 'Endpoint: %s', 'woocommerce-multilingual' ),
3765
+ # 'attribute_slug' => __( 'Attribute slug: %s', 'woocommerce-multilingual' ),
3766
+ # ),
3767
+
3768
+ msgid "Attribute slug: %s"
3769
+ msgstr ""
3770
+
3771
+ # 'strings' => array(
3772
+ # 'orig' => __( 'Original', 'woocommerce-multilingual' ),
3773
+ # 'trnsl_to' => __( 'Translation to', 'woocommerce-multilingual' ),
3774
+
3775
+ msgid "Original"
3776
+ msgstr ""
3777
+
3778
+ # 'orig' => __( 'Original', 'woocommerce-multilingual' ),
3779
+ # 'trnsl_to' => __( 'Translation to', 'woocommerce-multilingual' ),
3780
+ # 'cancel' => __( 'Cancel', 'woocommerce-multilingual' ),
3781
+
3782
+ msgid "Translation to"
3783
+ msgstr ""
3784
+
3785
+ # $args['original_base_value'] = urldecode(get_post($original_shop_id)->post_name);
3786
+ # $args['label_name'] = __('Product Shop Base', 'woocommerce-multilingual');
3787
+ # }else{
3788
+
3789
+ msgid "Product Shop Base"
3790
+ msgstr ""
3791
+
3792
+ # 'strings' => array(
3793
+ # 'sync_update' => __('Synchronize attributes and update product variations', 'woocommerce-multilingual'),
3794
+ # 'auto_generate' => __('This will automatically generate variations for translated products corresponding to recently translated attributes.', 'woocommerce-multilingual'),
3795
+
3796
+ msgid "Synchronize attributes and update product variations"
3797
+ msgstr ""
3798
+
3799
+ # 'sync_update' => __('Synchronize attributes and update product variations', 'woocommerce-multilingual'),
3800
+ # 'auto_generate' => __('This will automatically generate variations for translated products corresponding to recently translated attributes.', 'woocommerce-multilingual'),
3801
+ # 'vars_to_create' => __('Currently, there are %s variations that need to be created.', 'woocommerce-multilingual'),
3802
+
3803
+ msgid "This will automatically generate variations for translated products corresponding to recently translated attributes."
3804
+ msgstr ""
3805
+
3806
+ # 'auto_generate' => __('This will automatically generate variations for translated products corresponding to recently translated attributes.', 'woocommerce-multilingual'),
3807
+ # 'vars_to_create' => __('Currently, there are %s variations that need to be created.', 'woocommerce-multilingual'),
3808
+ # 'sync_in_cont' => __('Synchronize %s assignment in content', 'woocommerce-multilingual'),
3809
+
3810
+ msgid "Currently, there are %s variations that need to be created."
3811
+ msgstr ""
3812
+
3813
+ # 'vars_to_create' => __('Currently, there are %s variations that need to be created.', 'woocommerce-multilingual'),
3814
+ # 'sync_in_cont' => __('Synchronize %s assignment in content', 'woocommerce-multilingual'),
3815
+ # 'auto_apply' => __('This action lets you automatically apply the %s taxonomy to your content in different languages. It will scan the original content and apply the same taxonomy to translated content.', 'woocommerce-multilingual'),
3816
+
3817
+ msgid "Synchronize %s assignment in content"
3818
+ msgstr ""
3819
+
3820
+ # 'sync_in_cont' => __('Synchronize %s assignment in content', 'woocommerce-multilingual'),
3821
+ # 'auto_apply' => __('This action lets you automatically apply the %s taxonomy to your content in different languages. It will scan the original content and apply the same taxonomy to translated content.', 'woocommerce-multilingual'),
3822
+ # 'untranslated_warn' => __( 'You have untranslated terms!', 'woocommerce-multilingual' )
3823
+
3824
+ msgid "This action lets you automatically apply the %s taxonomy to your content in different languages. It will scan the original content and apply the same taxonomy to translated content."
3825
+ msgstr ""
3826
+
3827
+ # $empty_value->name = '';
3828
+ # $empty_value->label = __( '--Taxonomy--', 'woocommerce-multilingual' );
3829
+ # array_unshift( $this->custom_taxonomies, $empty_value );
3830
+
3831
+ msgid "--Taxonomy--"
3832
+ msgstr ""
3833
+
3834
+ # 'strings' => array(
3835
+ # 'no_taxonomies' => __( 'There are no translatable product custom taxonomies defined', 'woocommerce-multilingual' ),
3836
+ # 'select_label' => __('Select the taxonomy to translate: ', 'woocommerce-multilingual'),
3837
+
3838
+ msgid "There are no translatable product custom taxonomies defined"
3839
+ msgstr ""
3840
+
3841
+ # 'no_taxonomies' => __( 'There are no translatable product custom taxonomies defined', 'woocommerce-multilingual' ),
3842
+ # 'select_label' => __('Select the taxonomy to translate: ', 'woocommerce-multilingual'),
3843
+ # 'loading' => __( 'Loading ...', 'woocommerce-multilingual' )
3844
+
3845
+ msgid "Select the taxonomy to translate: "
3846
+ msgstr ""
3847
+
3848
+ # $empty_value->attribute_name = '';
3849
+ # $empty_value->attribute_label = __( '--Attribute--', 'woocommerce-multilingual' );
3850
+ # array_unshift( $product_attributes, $empty_value );
3851
+
3852
+ msgid "--Attribute--"
3853
+ msgstr ""
3854
+
3855
+ # 'strings' => array(
3856
+ # 'no_attributes' => __( 'There are no translatable product attributes defined', 'woocommerce-multilingual' ),
3857
+ # 'select_label' => __('Select the attribute to translate: ', 'woocommerce-multilingual'),
3858
+
3859
+ msgid "There are no translatable product attributes defined"
3860
+ msgstr ""
3861
+
3862
+ # 'no_attributes' => __( 'There are no translatable product attributes defined', 'woocommerce-multilingual' ),
3863
+ # 'select_label' => __('Select the attribute to translate: ', 'woocommerce-multilingual'),
3864
+ # 'loading' => __( 'Loading ...', 'woocommerce-multilingual' )
3865
+
3866
+ msgid "Select the attribute to translate: "
3867
+ msgstr ""
3868
+
3869
+ # $link = admin_url('admin.php?page=wpml-wcml');
3870
+ # $name = __('Translate WooCommerce products', 'woocommerce-multilingual');
3871
+ # wp_enqueue_style( 'wcml-pointers');
3872
+
3873
+ msgid "Translate WooCommerce products"
3874
+ msgstr ""
3875
+
3876
+ # $link = admin_url('admin.php?page=wpml-wcml&tab=product_shipping_class');
3877
+ # $name = __('Translate shipping classes', 'woocommerce-multilingual');
3878
+ # wp_enqueue_style( 'wcml-pointers');
3879
+
3880
+ msgid "Translate shipping classes"
3881
+ msgstr ""
3882
+
3883
+ # $link = admin_url('admin.php?page=wpml-wcml&tab=multi-currency');
3884
+ # $name = __('Configure multi-currency for multilingual sites', 'woocommerce-multilingual');
3885
+ # wp_enqueue_style( 'wcml-pointers');
3886
+
3887
+ msgid "Configure multi-currency for multilingual sites"
3888
+ msgstr ""
3889
+
3890
+ # $link = admin_url('admin.php?page=wpml-wcml&tab=slugs');
3891
+ # $name = __('Translate endpoints', 'woocommerce-multilingual');
3892
+ # wp_enqueue_style( 'wcml-pointers');
3893
+
3894
+ msgid "Translate endpoints"
3895
+ msgstr ""
3896
+
3897
+ # $wp_api->add_submenu_page(null,
3898
+ # __('Translations', 'wpml-translation-management'), __('Translations', 'wpml-translation-management'),
3899
+ # 'wpml_operate_woocommerce_multilingual', WPML_TM_FOLDER . '/menu/translations-queue.php', array($WPML_Translation_Management, 'translation_queue_page'));
3900
+
3901
+ msgid "Translations"
3902
+ msgstr ""
3903
+
3904
+ # $quick_edit_notice = '<div id="quick_edit_notice" style="display:none;"><p>' .
3905
+ # sprintf( __( "Quick edit is disabled for product translations. It\'s recommended to use the %s for editing products translations. %s",
3906
+ # 'woocommerce-multilingual' ), '<a href="' . admin_url( 'admin.php?page=wpml-wcml&tab=products' ) . '" >' .
3907
+
3908
+ msgid "Quick edit is disabled for product translations. It's recommended to use the %s for editing products translations. %s"
3909
+ msgstr ""
3910
+
3911
+ # 'woocommerce-multilingual' ), '<a href="' . admin_url( 'admin.php?page=wpml-wcml&tab=products' ) . '" >' .
3912
+ # __( 'WooCommerce Multilingual products editor', 'woocommerce-multilingual' ) . '</a>',
3913
+ # '<a href="" class="quick_product_trnsl_link" >' . __( 'Edit this product translation', 'woocommerce-multilingual' ) . '</a>'
3914
+
3915
+ msgid "WooCommerce Multilingual products editor"
3916
+ msgstr ""
3917
+
3918
+ # __( 'WooCommerce Multilingual products editor', 'woocommerce-multilingual' ) . '</a>',
3919
+ # '<a href="" class="quick_product_trnsl_link" >' . __( 'Edit this product translation', 'woocommerce-multilingual' ) . '</a>'
3920
+ # ) . '</p></div>';
3921
+
3922
+ msgid "Edit this product translation"
3923
+ msgstr ""
3924
+
3925
+ # $prot_link = '<span class="button" style="padding:4px;margin-top:0px; float: left;"><img align="baseline" src="' . ICL_PLUGIN_URL . '/res/img/icon16.png" width="16" height="16" style="margin-bottom:-4px" /> <a href="' . WCML_Links::generate_tracking_link( 'https://wpml.org/documentation/related-projects/woocommerce-multilingual/', 'woocommerce-multilingual', 'documentation', '#3' ) . '" target="_blank" style="text-decoration: none;">' .
3926
+ # __( 'How to translate attributes', 'sitepress' ) . '<\/a>' . '<\/span><br \/><br \/>';
3927
+ # ?>
3928
+
3929
+ msgid "How to translate attributes"
3930
+ msgstr ""
3931
+
3932
+ # $prot_link = '<span class="button" style="padding:4px;margin-top:0px; float: left;"><img align="baseline" src="' . ICL_PLUGIN_URL . '/res/img/icon16.png" width="16" height="16" style="margin-bottom:-4px" /> <a href="' . WCML_Links::generate_tracking_link( 'https://wpml.org/documentation/related-projects/woocommerce-multilingual/', 'woocommerce-multilingual', 'documentation', '#3' ) . '" target="_blank" style="text-decoration: none;">' .
3933
+ # __( 'How to translate product categories', 'sitepress' ) . '<\/a>' . '<\/span><br \/><br \/>';
3934
+ # ?>
3935
+
3936
+ msgid "How to translate product categories"
3937
+ msgstr ""
3938
+
3939
+ # $message .= sprintf(
3940
+ # __('The recommended way to translate WooCommerce products is using the
3941
+ # %sWooCommerce Multilingual products translation%s page.
3942
+
3943
+ msgid "The recommended way to translate WooCommerce products is using the\n %sWooCommerce Multilingual products translation%s page.\n Please use this page only for translating elements that are not available in the WooCommerce Multilingual products translation table."
3944
+ msgstr ""
3945
+
3946
+ # foreach( $menu as $key => $menu_item ) {
3947
+ # if ( $menu_item[ 0 ] == __( 'WooCommerce', 'woocommerce' ) ) {
3948
+ # $menu[ $key ][ 0 ] .= '<span class="wcml-menu-warn"><i class="otgs-ico-warning"></i></span>';
3949
+
3950
+ msgid "WooCommerce"
3951
  msgstr ""
3952
 
3953
+ # 'introduction' => array(
3954
+ # 'name' => __( 'Introduction', 'woocommerce-multilingual' ),
3955
+ # 'view' => array( $this, 'setup_introduction' ),
3956
 
3957
+ msgid "Introduction"
3958
  msgstr ""
3959
 
3960
+ # 'store-pages' => array(
3961
+ # 'name' => __( 'Store Pages', 'woocommerce-multilingual' ),
3962
+ # 'view' => array( $this, 'setup_store_pages' ),
3963
 
3964
+ msgid "Store Pages"
3965
  msgstr ""
3966
 
3967
+ # 'attributes' => array(
3968
+ # 'name' => __( 'Global Attributes', 'woocommerce-multilingual' ),
3969
+ # 'view' => array( $this, 'setup_attributes' ),
3970
 
3971
+ msgid "Global Attributes"
3972
  msgstr ""
3973
 
3974
+ # 'multi-currency' => array(
3975
+ # 'name' => __( 'Multiple Currencies', 'woocommerce-multilingual' ),
3976
+ # 'view' => array( $this, 'setup_multi_currency' ),
3977
 
3978
+ msgid "Multiple Currencies"
3979
  msgstr ""
3980
 
3981
+ # 'ready' => array(
3982
+ # 'name' => __( 'Ready!', 'woocommerce-multilingual' ),
3983
+ # 'view' => array( $this, 'setup_ready' ),
3984
 
3985
+ msgid "Ready!"
3986
  msgstr ""
3987
 
3988
+ # if ( ! wp_verify_nonce( $_GET['_wcml_setup_nonce'], 'wcml_setup_skip_nonce' ) ) {
3989
+ # wp_die( __( 'Action failed. Please refresh the page and retry.', 'woocommerce-multilingual' ) );
3990
+ # }
3991
 
3992
+ msgid "Action failed. Please refresh the page and retry."
3993
  msgstr ""
3994
 
3995
+ # if ( ! current_user_can( 'manage_options' ) ) {
3996
+ # wp_die( __( 'Cheatin&#8217; huh?', 'woocommerce' ) );
3997
+ # }
3998
 
3999
+ msgid "Cheatin&#8217; huh?"
4000
  msgstr ""
4001
 
4002
+ # <p>
4003
+ # <strong><?php _e('Prepare your WooCommerce store to run multilingual!', 'woocommerce-multilingual'); ?></strong><br />
4004
+ # <?php _e('We need to help you with a few steps to turn your WooCommerce store multilingual. These steps include:', 'woocommerce-multilingual'); ?>
4005
 
4006
+ msgid "Prepare your WooCommerce store to run multilingual!"
4007
  msgstr ""
4008
 
4009
+ # <strong><?php _e('Prepare your WooCommerce store to run multilingual!', 'woocommerce-multilingual'); ?></strong><br />
4010
+ # <?php _e('We need to help you with a few steps to turn your WooCommerce store multilingual. These steps include:', 'woocommerce-multilingual'); ?>
4011
+ # <ul class="wcml-notice-list">
4012
 
4013
+ msgid "We need to help you with a few steps to turn your WooCommerce store multilingual. These steps include:"
4014
  msgstr ""
4015
 
4016
+ # <ul class="wcml-notice-list">
4017
+ # <li><?php _e("Translating the 'store' pages", 'woocommerce-multilingual'); ?></li>
4018
+ # <li><?php _e("Choosing which attributes to make translatable", 'woocommerce-multilingual'); ?></li>
4019
 
4020
+ msgid "Translating the 'store' pages"
4021
  msgstr ""
4022
 
4023
+ # <li><?php _e("Translating the 'store' pages", 'woocommerce-multilingual'); ?></li>
4024
+ # <li><?php _e("Choosing which attributes to make translatable", 'woocommerce-multilingual'); ?></li>
4025
+ # <li><?php _e("Choosing if you need multiple currencies", 'woocommerce-multilingual'); ?></li>
4026
 
4027
+ msgid "Choosing which attributes to make translatable"
4028
  msgstr ""
4029
 
4030
+ # <li><?php _e("Choosing which attributes to make translatable", 'woocommerce-multilingual'); ?></li>
4031
+ # <li><?php _e("Choosing if you need multiple currencies", 'woocommerce-multilingual'); ?></li>
4032
+ # </ul>
4033
 
4034
+ msgid "Choosing if you need multiple currencies"
4035
  msgstr ""
4036
 
4037
+ # <p class="submit">
4038
+ # <a href="<?php echo esc_url( admin_url('admin.php?page=wcml-setup') ); ?>" class="button-primary"><?php _e('Start the Setup Wizard', 'woocommerce-multilingual') ?></a>
4039
+ # <a href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wcml-setup-skip', 1 ), 'wcml_setup_skip_nonce', '_wcml_setup_nonce' ) ); ?>" class="button-secondary skip"><?php _e('Skip', 'woocommerce-multilingual') ?></a>
4040
 
4041
+ msgid "Start the Setup Wizard"
4042
  msgstr ""
4043
 
4044
+ # <a href="<?php echo esc_url( admin_url('admin.php?page=wcml-setup') ); ?>" class="button-primary"><?php _e('Start the Setup Wizard', 'woocommerce-multilingual') ?></a>
4045
+ # <a href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wcml-setup-skip', 1 ), 'wcml_setup_skip_nonce', '_wcml_setup_nonce' ) ); ?>" class="button-secondary skip"><?php _e('Skip', 'woocommerce-multilingual') ?></a>
4046
+ # </p>
4047
 
4048
+ msgid "Skip"
4049
  msgstr ""
4050
 
4051
+ # <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4052
+ # <title><?php _e( 'WooCommerce Multilingual &rsaquo; Setup Wizard', 'woocommerce-multilingual' ); ?></title>
4053
+ # <?php wp_print_scripts( 'wcml-setup' ); ?>
4054
 
4055
+ msgid "WooCommerce Multilingual &rsaquo; Setup Wizard"
4056
  msgstr ""
4057
 
4058
+ # if ( !isset($active_languages[$lang]) && $lang != 'all' ) {
4059
+ # throw new WC_API_Exception( '404', sprintf( __( 'Invalid language parameter: %s' ), $lang ), '404' );
4060
+ # }
4061
 
4062
+ msgid "Invalid language parameter: %s"
4063
  msgstr ""
4064
 
4065
+ # if( empty($trid) ){
4066
+ # throw new WC_API_Exception( '404', sprintf( __( 'Source product id not found: %s' ), $data['translation_of'] ), '404' );
4067
  # }
4068
 
4069
+ msgid "Source product id not found: %s"
4070
  msgstr ""
4071
 
4072
+ # $this->add_field( new WPML_Editor_UI_Single_Line_Field( 'title', __( 'Title', 'woocommerce-multilingual' ), $this->data, true ) );
4073
+ # $this->add_field( new WPML_Editor_UI_Single_Line_Field( 'slug', __( 'Slug', 'woocommerce-multilingual' ), $this->data, true ) );
4074
+ # $this->add_field( new WPML_Editor_UI_WYSIWYG_Field( 'product_content', __( 'Content / Description', 'woocommerce-multilingual' ), $this->data, true ) );
4075
 
4076
+ msgid "Slug"
4077
  msgstr ""
4078
 
4079
+ # $this->add_field( new WPML_Editor_UI_Single_Line_Field( 'slug', __( 'Slug', 'woocommerce-multilingual' ), $this->data, true ) );
4080
+ # $this->add_field( new WPML_Editor_UI_WYSIWYG_Field( 'product_content', __( 'Content / Description', 'woocommerce-multilingual' ), $this->data, true ) );
4081
  #
4082
 
4083
+ msgid "Content / Description"
4084
  msgstr ""
4085
 
4086
+ #
4087
+ # $excerpt_section = new WPML_Editor_UI_Field_Section( __( 'Excerpt', 'woocommerce-multilingual' ) );
4088
+ # $excerpt_section->add_field( new WPML_Editor_UI_WYSIWYG_Field( 'product_excerpt', null, $this->data, true ) );
4089
 
4090
+ msgid "Excerpt"
4091
  msgstr ""
4092
 
4093
+ #
4094
+ # $purchase_note_section = new WPML_Editor_UI_Field_Section( __( 'Purchase note', 'woocommerce-multilingual' ) );
4095
+ # $purchase_note_section->add_field( new WPML_Editor_UI_TextArea_Field( '_purchase_note', null, $this->data, true ) );
4096
 
4097
+ msgid "Purchase note"
4098
  msgstr ""
4099
 
4100
  #
4101
+ # $images_section = new WPML_Editor_UI_Field_Section( __( 'Images', 'woocommerce-multilingual' ) );
4102
+ # foreach( $product_images as $image_id ) {
4103
 
4104
+ msgid "Images"
4105
  msgstr ""
4106
 
4107
+ # if ( $attributes ){
4108
+ # $attributes_section = new WPML_Editor_UI_Field_Section( __( 'Custom Product attributes', 'woocommerce-multilingual' ) );
4109
+ # foreach( $attributes as $attr_key => $attribute ) {
4110
+
4111
+ msgid "Custom Product attributes"
4112
+ msgstr ""
4113
+
4114
+ # $group->add_field( $attribute_field );
4115
+ # $attribute_field = new WPML_Editor_UI_Single_Line_Field( $attr_key , __( 'Value(s)', 'woocommerce-multilingual' ), $this->data, false );
4116
+ # $group->add_field( $attribute_field );
4117
+
4118
+ msgid "Value(s)"
4119
+ msgstr ""
4120
+
4121
+ # if( $custom_fields ) {
4122
+ # $custom_fields_section = new WPML_Editor_UI_Field_Section( __( 'Custom Fields', 'woocommerce-multilingual' ) );
4123
  #
4124
 
4125
+ msgid "Custom Fields"
4126
  msgstr ""
4127
 
4128
+ # if( !empty( $variations ) ){
4129
+ # $variations_data_section = new WPML_Editor_UI_Field_Section( __( 'Variations data', 'woocommerce-multilingual' ) );
4130
+ # foreach( $variations as $variation ){
4131
 
4132
+ msgid "Variations data"
4133
  msgstr ""
4134
 
4135
+ # if( $is_variable ){
4136
+ # $files_section = new WPML_Editor_UI_Field_Section( sprintf( __( 'Download Files for Variation #%s', 'woocommerce-multilingual' ), $post_id ) );
4137
+ # }else{
4138
 
4139
+ msgid "Download Files for Variation #%s"
4140
  msgstr ""
4141
 
4142
+ # }else{
4143
+ # $files_section = new WPML_Editor_UI_Field_Section( __( 'Download Files', 'woocommerce-multilingual' ) );
4144
+ # }
4145
 
4146
+ msgid "Download Files"
4147
  msgstr ""
4148
 
4149
+ # $sub_group->add_field( $field_input );
4150
+ # $field_input = new WPML_Editor_UI_Single_Line_Field( 'file-url'.$key.$post_id, __( 'File URL', 'woocommerce-multilingual' ), $this->data, false );
4151
+ # $sub_group->add_field( $field_input );
4152
 
4153
+ msgid "File URL"
4154
+ msgstr ""
4155
+
4156
+ # if( $this->product_type === 'external' ){
4157
+ # $external_product_section = new WPML_Editor_UI_Field_Section( __( 'External Product', 'woocommerce-multilingual' ) );
4158
+ # $external_product_section->add_field( new WPML_Editor_UI_Single_Line_Field( '_product_url', __( 'Product url', 'woocommerce-multilingual' ), $this->data, true ) );
4159
+
4160
+ msgid "External Product"
4161
+ msgstr ""
4162
+
4163
+ # $external_product_section = new WPML_Editor_UI_Field_Section( __( 'External Product', 'woocommerce-multilingual' ) );
4164
+ # $external_product_section->add_field( new WPML_Editor_UI_Single_Line_Field( '_product_url', __( 'Product url', 'woocommerce-multilingual' ), $this->data, true ) );
4165
+ # $external_product_section->add_field( new WPML_Editor_UI_Single_Line_Field( '_button_text', __( 'Button text', 'woocommerce-multilingual' ), $this->data, true ) );
4166
+
4167
+ msgid "Product url"
4168
+ msgstr ""
4169
+
4170
+ # $external_product_section->add_field( new WPML_Editor_UI_Single_Line_Field( '_product_url', __( 'Product url', 'woocommerce-multilingual' ), $this->data, true ) );
4171
+ # $external_product_section->add_field( new WPML_Editor_UI_Single_Line_Field( '_button_text', __( 'Button text', 'woocommerce-multilingual' ), $this->data, true ) );
4172
+ # $this->add_field( $external_product_section );
4173
+
4174
+ msgid "Button text"
4175
+ msgstr ""
4176
+
4177
+ # if ( !$args[ 'post_title' ] && !$args[ 'post_content' ] && !$args[ 'post_excerpt' ] ){
4178
+ # return new WP_Error( 'empty_content', __( 'Content, title, and excerpt are empty.' ) );
4179
+ # }
4180
+
4181
+ msgid "Content, title, and excerpt are empty."
4182
+ msgstr ""
4183
+
4184
+ # <p class="icl-admin-message" style="margin-top: 0">
4185
+ # <?php printf( __('To configure how the %sWooCommerce products%s are translated, visit the WooCommerce Multiligual %ssettings%s page.',
4186
+ # 'woocommerce-multilingual'), '<strong>', '</strong>', '<a href="' . admin_url('admin.php?page=wpml-wcml&tab=settings') . '">', '</a>' ); ?>
4187
+
4188
+ msgid "To configure how the %sWooCommerce products%s are translated, visit the WooCommerce Multiligual %ssettings%s page."
4189
  msgstr ""
locale/woocommerce-multilingual-ar.mo CHANGED
Binary file
locale/woocommerce-multilingual-de_DE.mo CHANGED
Binary file
locale/woocommerce-multilingual-el.mo CHANGED
Binary file
locale/woocommerce-multilingual-es_ES.mo CHANGED
Binary file
locale/woocommerce-multilingual-fr_FR.mo CHANGED
Binary file
locale/woocommerce-multilingual-he_IL.mo CHANGED
Binary file
locale/woocommerce-multilingual-it_IT.mo CHANGED
Binary file
locale/woocommerce-multilingual-ja.mo CHANGED
Binary file
locale/woocommerce-multilingual-ko_KR.mo CHANGED
Binary file
locale/woocommerce-multilingual-nl_NL.mo CHANGED
Binary file
locale/woocommerce-multilingual-pl_PL.mo CHANGED
Binary file
locale/woocommerce-multilingual-pt_BR.mo CHANGED
Binary file
locale/woocommerce-multilingual-pt_PT.mo CHANGED
Binary file
locale/woocommerce-multilingual-ru_RU.mo CHANGED
Binary file
locale/woocommerce-multilingual-sv_SE.mo CHANGED
Binary file
locale/woocommerce-multilingual-uk_UA.mo CHANGED
Binary file
locale/woocommerce-multilingual-vi.mo CHANGED
Binary file
locale/woocommerce-multilingual-zh_CN.mo CHANGED
Binary file
locale/woocommerce-multilingual-zh_TW.mo CHANGED
Binary file
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.7.1
8
- Stable tag: 4.0.4
9
 
10
  Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
11
 
@@ -142,6 +142,30 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
142
 
143
  == Changelog ==
144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  = 4.0.4 =
146
  * Bug fix: empty shipping class was shown on the Quick Editor when using WooCommerce Table Rate Shipping
147
  * Bug fix: the Translation Editor could not save the same slug for translations of the same product
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.7.3
8
+ Stable tag: 4.1.0
9
 
10
  Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
11
 
142
 
143
  == Changelog ==
144
 
145
+ = 4.1.0 =
146
+ * Enhanced language switchers
147
+ * Improved REST API support
148
+ * Updated WooCommerce 2.7 compatibiilty
149
+ * Added the ability to translate product terms in the products translation editor
150
+ * Enhanced the translation of rich text custom fields in the products translation editor.
151
+ * Compatibility with WooCommerce Product Bundles (updated, not for WooCommerce 2.7)
152
+ * Compatibility with ACF Pro (fixes)
153
+ * Compatibility with WooCommerce Bookings (fixes)
154
+ * Compatibility with WP Simple Survey (fixes)
155
+ * Fix: Translations for custom attributes containing the umlaut character were not showing on the frontend.
156
+ * Fix: Some gallery images were not synchronized when using the corresponding option on the troubleshooting page.
157
+ * Fix: Incorrect country name translations were used in the order confirmation email is some situations.
158
+ * Fix: Some endpoints were not accessible when using the ‘Different languages in directories’ configuration.
159
+ * Fix: Order screen displayed ‘Variation # of Product name’ instead of just the product name.
160
+ * Fix: The custom prices were not displayed correctly on the front end when using ‘,’ as a decimal separator.
161
+ * Fix: In specific circumstances, the product category URLs were returning a 404 error.
162
+ * Fix: New lines were not copied correctly when using the products translation editor.
163
+ * Fix: In some circumstances, accessing product categories without a trailing slash generated PHP notices.
164
+ * Fix: The stock status was not synchronized correctly for variable products.
165
+ * Fix: By removing an attribute, only the terms in the default language were removed from the database.
166
+ * Fix: When using the option to display only products with custom prices in the secondary currencies and the price was 0, the products variations were not visible on the front end.
167
+ * Fix: The option to set separate download files for each translation was not working correctly for variable products
168
+
169
  = 4.0.4 =
170
  * Bug fix: empty shipping class was shown on the Quick Editor when using WooCommerce Table Rate Shipping
171
  * Bug fix: the Translation Editor could not save the same slug for translations of the same product
res/css/admin.css CHANGED
@@ -1,64 +1 @@
1
- .wcml-menu-warn {
2
- display: inline-block;
3
- color: #d54e21;
4
- line-height: 15px;
5
- margin: 1px 0 0 2px;
6
- z-index: 26;
7
- }
8
-
9
- a.wcml-external-link {
10
- padding-right: 15px;
11
- }
12
-
13
- a.wcml-external-link:after {
14
- content: "\f504";
15
- display: inline-block;
16
- width: 15px;
17
- margin-right: -15px;
18
- font-size: 14px;
19
- line-height: 18px;
20
- font-family: dashicons;
21
- text-decoration: none;
22
- font-weight: normal;
23
- font-style: normal;
24
- vertical-align: top;
25
- -webkit-font-smoothing: antialiased;
26
- -moz-osx-font-smoothing: grayscale;
27
- }
28
-
29
- .wcml-pointer-inner .wcml-information-paragraph {
30
- padding-right: 30px;
31
- }
32
-
33
- .wcml-pointer-inner .wp-pointer-buttons {
34
- padding: 0;
35
- }
36
-
37
- .wcml-pointer-inner.wp-pointer-bottom .wp-pointer-arrow {
38
- left: auto;
39
- right: 50px;
40
- }
41
-
42
- .wcml-message-icon.wcml-table-cell,
43
- .wcml-message-content.wcml-table-cell {
44
- height: 100px;
45
- }
46
-
47
- .wcml-pointer-link {
48
- position: relative;
49
- text-decoration: none;
50
- padding: 10px;
51
- }
52
-
53
- .wcml-cart-dialog button {
54
- text-transform: capitalize;
55
- }
56
-
57
- div[data-selector="woocommerce_table_rate_title"] a,
58
- div[data-selector="wpbody-content .woocommerce h2"] a {
59
- padding: 10px 0 0 0;
60
- }
61
-
62
- #shipping_rates .shipping_label .wcml-pointer-link {
63
- padding: 0;
64
- }
1
+ .wcml-menu-warn{display:inline-block;color:#d54e21;line-height:15px;margin:1px 0 0 2px;z-index:26}a.wcml-external-link{padding-right:15px}a.wcml-external-link:after{content:"\f504";display:inline-block;width:15px;margin-right:-15px;font-size:14px;line-height:18px;font-family:dashicons;text-decoration:none;font-weight:normal;font-style:normal;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wcml-pointer-inner .wcml-information-paragraph{padding-right:30px}.wcml-pointer-inner .wp-pointer-buttons{padding:0}.wcml-pointer-inner.wp-pointer-bottom .wp-pointer-arrow{left:auto;right:50px}.wcml-message-icon.wcml-table-cell,.wcml-message-content.wcml-table-cell{height:100px}.wcml-pointer-link{position:relative;text-decoration:none;padding:10px}.wcml-cart-dialog button{text-transform:capitalize}div[data-selector="woocommerce_table_rate_title"] a,div[data-selector="wpbody-content .woocommerce h2"] a{padding:10px 0 0 0}#shipping_rates .shipping_label .wcml-pointer-link{padding:0}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
res/css/currency-switcher.css CHANGED
@@ -1 +1 @@
1
- .wcml-active-currency{background-color:#E5E5E5}ul.wcml_currency_switcher{padding:0 !important;margin:0 !important;list-style-type:none !important;position:relative}ul.wcml_currency_switcher li{cursor:pointer;border:1px solid #cdcdcd}ul.wcml_currency_switcher.curr_list_vertical{border-top:1px solid #cdcdcd;display:inline-block}ul.wcml_currency_switcher.curr_list_horizontal li{float:left;position:relative;padding:2px 5px;margin-left:1px}ul.wcml_currency_switcher.curr_list_horizontal li:first-child{margin-left:0}ul.wcml_currency_switcher.curr_list_vertical li{border-top-width:0;cursor:pointer;padding:3px 10px;margin:0}.exchange-rates-online-wrap,.service-details-wrap{padding-left:24px}.rtl .service-details-wrap,.rtl .exchange-rate-api-key-wrap{padding-left:0;padding-right:24px}.exchange-rate-service-website{text-decoration:none}.exchange-rate-service-website .dashicons-external{font-size:14px;width:14px;height:14px;vertical-align:-4px}
1
+ ul.wcml_currency_switcher{padding:0 !important;margin:0 !important;list-style-type:none !important;position:relative}ul.wcml_currency_switcher li{cursor:pointer;border:1px solid #cdcdcd}ul.wcml_currency_switcher.curr_list_vertical{border-top:1px solid #cdcdcd;display:inline-block}ul.wcml_currency_switcher.curr_list_horizontal li{float:left;position:relative;padding:2px 5px;margin-left:1px}ul.wcml_currency_switcher.curr_list_horizontal li:first-child{margin-left:0}ul.wcml_currency_switcher.curr_list_vertical li{border-top-width:0;cursor:pointer;padding:3px 10px;margin:0}ul.dropdown.wcml_currency_switcher{position:relative;padding:0;margin:0 !important;list-style-type:none}ul.dropdown.wcml_currency_switcher li span{position:relative;padding-right:-webkit-calc(10px + .7em + .7em);padding-right:calc(10px + .7em + .7em);display:block;padding:5px 10px;line-height:1}ul.dropdown.wcml_currency_switcher li span:after{content:'';vertical-align:middle;display:inline-block;border:.35em solid transparent;border-top:.5em solid;position:absolute;right:10px;top:-webkit-calc(50% - .175em);top:calc(50% - .175em)}ul.dropdown.wcml_currency_switcher ul.wcml-cs-submenu{visibility:hidden;position:absolute;top:100%;right:0;left:0;border-top:1px solid #cdcdcd;padding:0;margin:0;list-style-type:none;z-index:101}.exchange-rates-online-wrap,.service-details-wrap{padding-left:24px}.rtl .exchange-rates-online-wrap,.rtl .service-details-wrap{padding-left:0;padding-right:24px}.exchange-rate-service-website{text-decoration:none}.exchange-rate-service-website .dashicons-external{font-size:14px;width:14px;height:14px;vertical-align:-4px}
res/css/management.css CHANGED
@@ -1 +1 @@
1
- .wcml-wrap{border:1px solid #CCCCCC;padding:15px;background-color:#ffffff}.wcml-wrap:before,.wcml-wrap:after{content:" ";display:table}.wcml-wrap:after{clear:both}.dis_base{opacity:0.5}.wcml-wrap{margin-bottom:20px;min-width:900px}.wcml-wrap .wpml-tabs{margin-top:0}.wcml-wrap .otgs-ico-yes,.wcml-wrap .otgs-ico-ok{color:#51a351}.wcml-wrap .otgs-ico-no,.wcml-wrap .otgs-ico-warning,.wcml-wrap .otgs-ico-delete{color:#9d261d}.wcml-wrap .otgs-ico-edit{color:#3a87ad}.wcml-wrap .otgs-ico-in-progress{color:#ffb800}@media (max-width: 1199px){.wcml-wrap .tablenav.top{height:auto}.wcml-wrap .tablenav.top.wcml-product-translation-filtering .alignright,.wcml-wrap .tablenav.top.wcml-product-translation-filtering .alignleft{float:none;margin-bottom:5px}}[class*="otgs-ico"]:before{font-size:16px}.wcml-tabs{min-width:930px}.wcml-tabs:before,.wcml-tabs:after{content:" ";display:table}.wcml-tabs:after{clear:both}.wcml-tabs .nav-tab{margin-top:5px}@media (max-width: 1350px){.wcml-tabs .nav-tab{margin-left:.2em}}.wcml-tabs .nav-tab [class*="otgs-ico"]:before{font-size:18px}.wcml-section{clear:both;padding:0 0 15px 0;margin:0 0 15px 0;border-bottom:1px solid #ededed;min-width:900px;overflow:hidden}.wcml-section:last-of-type{border:none;margin:0}.wcml-section-content .wcml-section-content-inner:not(:last-child){margin:0 0 20px 0;padding:0 0 10px 0;border-bottom:1px solid #ededed}.wcml-section-header{width:310px;float:left}.wcml-section-header h3{font-weight:normal;font-size:1.4em;margin-top:0.7em}.wcml-section-header h3 .wcml-tip:before{vertical-align:top}.wcml-section-content{float:left;width:680px;margin-left:30px}.wcml-section-content-wide{width:-webkit-calc(100% - 360px);width:calc(100% - 360px)}.wcml_products{margin:20px 0;position:relative}.button-wrap,.widefat td .button-wrap{text-align:right;margin:10px 0}.currency_action_update{display:inline-block}.wcml-co-dialog.hidden{display:none}.wcml-co-dialog .wpml-form-row label{width:215px;text-align:left}.wcml-co-dialog input,.wcml-co-dialog select{width:145px}.wcml-co-dialog .currency_code label{width:100px;vertical-align:top}.wcml-co-dialog .currency_code select{width:auto;max-width:-webkit-calc(100% - 165px);max-width:calc(100% - 165px)}.wcml-co-dialog .wcml-co-exchange-rate label{width:100px;vertical-align:top}.wcml-co-dialog .wcml-co-exchange-rate input{margin:0 !important;width:75px}.wcml-co-dialog .wcml-co-exchange-rate .wcml-co-set-rate{display:inline-block;padding:4px 15px 7px 15px;max-width:265px}.wcml-co-dialog .wcml-co-exchange-rate small{display:block;margin-top:5px}.wcml-co-dialog .wcml-co-help-link{margin-top:7px}.wcml-co-dialog .wcml-co-preview label{width:120px;vertical-align:middle}.wcml-co-dialog .wcml-co-preview .wcml-co-preview-value{display:inline-block;padding:7px 15px;border:1px solid #555;font-size:1.4em;font-weight:bold;vertical-align:middle;margin:15px 0}table.widefat.currency_table{float:left;width:320px;border-right:none}table.widefat.currency_table td.wcml-col-currency,table.widefat.currency_table td.wcml-col-rate{padding-top:7px;padding-bottom:0;vertical-align:top}table.widefat.currency_table td.wcml-col-currency .truncate{max-width:120px;display:block}table.widefat.currency_table td.wcml-col-currency small{display:block}table.widefat.currency_table td.wcml-col-edit a{position:relative;top:-3px}table.widefat.currency_table td.wcml-col-rate{font-size:.85em}table.widefat.currency_table td.wcml-col-rate .truncate{max-width:75px;display:block}table.widefat.currency_delete_table{float:left;width:50px;border-left:none;clear:none}table.widefat.currency_delete_table td.wcml-col-delete{vertical-align:middle;text-align:center}table.widefat.currency_delete_table td.wcml-col-delete:first-child{border-left:1px solid #e5e5e5}.currency_value .wcml-error,.wcml-error{font-size:10px;color:#f00;display:inline-block}.trbl_variables_products{padding:10px;border:1px solid #8cceea;background-color:#eff8fc;border-radius:5px}.trbl_variables_products label span{font-weight:bold}.wcml_trbl_warning{padding:10px;margin-bottom:10px;border:1px solid #f00;background-color:#ffb7b7;border-radius:5px 5px}#wcml_sync_variations{background-color:#21759b;background-image:-webkit-linear-gradient(top, #2a95c5, #21759b);background-image:linear-gradient(to bottom, #2a95c5, #21759b);border-color:#21759b;border-bottom-color:#1e6a8d;box-shadow:inset 0 1px 0 rgba(120,200,230,0.5);color:#fff;text-decoration:none;text-shadow:0 1px 0 rgba(0,0,0,0.1)}.wcml_duplicate_product_notice td{border-bottom:none !important}.wcml_product_status_text,.prod_parent_text{font-style:italic;color:#9A9A9A}.wcml_no_found_text{text-align:center}.currency_languages{position:relative;text-align:center}.currency_languages:first-child{border-left:1px solid #e5e5e5}.currency_languages ul{margin:0;text-align:center}.currency_languages ul li{margin:0;display:none}.currency_languages ul li.on{display:inline-block}table.widefat.currency_lang_table{border-left:none;border-right:none}table.widefat.currency_lang_table thead tr{height:28px}table.widefat.currency_lang_table thead td{border-bottom:0;text-align:center;padding-top:3px;padding-bottom:1px;font-size:1em}table.widefat.currency_lang_table thead th{padding-top:0;padding-bottom:0;text-align:center}.currency_wrap{width:-webkit-calc(100% - 320px - 50px);width:calc(100% - 320px - 50px);float:left;margin-bottom:10px}.currency_inner{overflow-x:auto;overflow-y:visible}.currency_table,.currency_lang_table,.currency_delete_table{clear:none}.currency_table thead tr,.currency_lang_table thead tr,.currency_delete_table thead tr{height:56px}.currency_table tr,.currency_lang_table tr,.currency_delete_table tr{height:50px}.currency_lang_table th{text-align:center}.currency_lang_table td{vertical-align:middle}.currency_lang_table.widefat td{padding-right:0;padding-left:0}.default_currency select{font-size:9px;height:24px;margin:0;margin-right:2px;padding:2px 0}.default_currency td{border-top:1px solid #e5e5e5}.default_currency .inf_message{font-size:10px;font-style:italic;color:#9A9A9A}#wcml_currencies_order{display:block;overflow:hidden;width:100%}#wcml_currencies_order li{float:left;margin:2px 4px 2px 0;padding:2px 8px;border:1px solid #DFDFDF;border-radius:2px;background:-webkit-linear-gradient(bottom, #ECECEC, #F9F9F9) repeat scroll 0 0 #F1F1F1;background:linear-gradient(to top, #ECECEC, #F9F9F9) repeat scroll 0 0 #F1F1F1;cursor:move}.wcml_currencies_order_ajx_resp{padding-top:5px;color:#E68A00}.explanation-text{color:#999}input[name="wcml_curr_template"]{width:100%}.wcml_curr_style label{line-height:30px}.wcml-currency-preview{margin:15px 0 30px;display:inline-block}.wcml_product_name{line-height:20px}.wcml_prod_filters{float:left}.wcml_miss_lang p:first-child{float:left}#display_custom_prices_select{display:inline-block;width:100%}.edit_slug_input,.edit_slug_hide_link{display:none}.wcml-tip{cursor:help;color:#555}.wcml-products a{cursor:pointer}@media (max-width: 782px){.column-product_cat,.column-product_tag,.column-product_type{display:none}}.wcml-link-troubleshooting{margin-top:7px}.wcml-status-list li{padding-left:25px;margin-bottom:30px}.wcml-status-list li ul li{margin-bottom:3.5px}.wcml-status-list.wcml-tax-translation-list li{margin-bottom:5px;line-height:26px}.wcml-status-list.wcml-plugins-status-list li{margin-bottom:10px}.wcml-status-list [class*="otgs-ico"]:not(.otgs-ico-help){margin-left:-25px;margin-right:5px;vertical-align:baseline}.wcml-status-list .button-secondary{vertical-align:middle}.wcml-status-list small{display:block}.wcml-lang-list{margin:7px 0}.wcml-lang-list .wpml-title-flag{margin-left:-25px;margin-right:5px}.wcml-dismiss-warning{position:relative;float:right;padding:0;text-decoration:none;outline:none}.wcml-dismiss-warning:active{outline:none}.wcml-notice{background:#fff;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);margin:5px 0 15px;padding:1px 12px;position:relative}.wcml-notice p{margin:.5em 0;padding:2px}.otgs-is-dismissible{position:relative;padding-right:38px}.otgs-is-dismissible .notice-dismiss{text-decoration:none}.otgs-is-dismissible p [class*="button-"]{margin:-5px 5px}.wcml_tt_spinner{margin-right:15px;display:none}.wcml-product-attributes-selector{text-align:center;margin-bottom:25px}@media (max-width: 1280px){.wcml-product-attributes-selector{margin-left:.2em}}.wcml-product-attributes-selector select{min-width:200px}.wcml-product-custom-taxonomies-selector{text-align:center;margin-bottom:25px}.wcml_attributes_wrap #wpml_tt_taxonomy_translation_wrap>label,.wcml_custom_taxonomies_wrap #wpml_tt_taxonomy_translation_wrap>label{display:none}
1
+ .wcml-wrap{border:1px solid #CCCCCC;padding:15px;background-color:#ffffff}.wcml-wrap:before,.wcml-wrap:after{content:" ";display:table}.wcml-wrap:after{clear:both}.dis_base{opacity:0.5}.display-block{display:block}.wcml-wrap{margin-bottom:20px;min-width:900px}.wcml-wrap .wpml-tabs{margin-top:0}.wcml-wrap .otgs-ico-yes,.wcml-wrap .otgs-ico-ok{color:#51a351}.wcml-wrap .otgs-ico-no,.wcml-wrap .otgs-ico-warning,.wcml-wrap .otgs-ico-delete{color:#9d261d}.wcml-wrap .otgs-ico-edit{color:#3a87ad}.wcml-wrap .otgs-ico-in-progress{color:#ffb800}@media (max-width: 1199px){.wcml-wrap .tablenav.top{height:auto}.wcml-wrap .tablenav.top.wcml-product-translation-filtering .alignright,.wcml-wrap .tablenav.top.wcml-product-translation-filtering .alignleft{float:none;margin-bottom:5px}}[class*="otgs-ico"]:before{font-size:16px}.wcml-tabs{min-width:930px}.wcml-tabs:before,.wcml-tabs:after{content:" ";display:table}.wcml-tabs:after{clear:both}.wcml-tabs .nav-tab{margin-top:5px}@media (max-width: 1350px){.wcml-tabs .nav-tab{margin-left:.2em}}.wcml-tabs .nav-tab [class*="otgs-ico"]:before{font-size:18px}.wcml-section{clear:both;padding:0 0 15px 0;margin:0 0 15px 0;border-bottom:1px solid #ededed;min-width:900px}.wcml-section:after{content:'';display:table;clear:both}.wcml-section:last-of-type{border:none;margin:0}.explanation-text{color:#999}h4+.explanation-text{margin-top:-1.1em;margin-bottom:1.33em}.wcml-section-content .wcml-section-content-inner:not(:last-child){margin:0 0 20px 0;padding:0 0 10px 0;border-bottom:1px solid #ededed}.wcml-section-header{width:310px;float:left}.wcml-section-header h3{font-weight:normal;font-size:1.4em;margin-top:0.7em}.wcml-section-header h3 .wcml-tip:before{vertical-align:top}.wcml-section-content{float:left;width:680px;margin-left:30px}.wcml-section-content-wide{width:-webkit-calc(100% - 360px);width:calc(100% - 360px)}.wcml_products{margin:20px 0;position:relative}.button-wrap,.widefat td .button-wrap{text-align:right;margin:10px 0}.currency_action_update{display:inline-block}.wcml-co-dialog.hidden{display:none}.wcml-co-dialog .wpml-form-row label{width:215px;text-align:left}.wcml-co-dialog input,.wcml-co-dialog select{width:145px}.wcml-co-dialog .currency_code label{width:100px;vertical-align:top}.wcml-co-dialog .currency_code select{width:auto;max-width:-webkit-calc(100% - 165px);max-width:calc(100% - 165px)}.wcml-co-dialog .wcml-co-exchange-rate label{width:100px;vertical-align:top}.wcml-co-dialog .wcml-co-exchange-rate input{margin:0 !important;width:75px}.wcml-co-dialog .wcml-co-exchange-rate .wcml-co-set-rate{display:inline-block;padding:4px 15px 7px 15px;max-width:265px}.wcml-co-dialog .wcml-co-exchange-rate small{display:block;margin-top:5px}.wcml-co-dialog .wcml-co-help-link{margin-top:7px}.wcml-co-dialog .wcml-co-preview label{width:120px;vertical-align:middle}.wcml-co-dialog .wcml-co-preview .wcml-co-preview-value{display:inline-block;padding:7px 15px;border:1px solid #555;font-size:1.4em;font-weight:bold;vertical-align:middle;margin:15px 0}table.widefat.currency_table{float:left;width:320px;border-right:none}table.widefat.currency_table td.wcml-col-currency,table.widefat.currency_table td.wcml-col-rate{padding-top:7px;padding-bottom:0;vertical-align:top}table.widefat.currency_table td.wcml-col-currency .truncate{max-width:120px;display:block}table.widefat.currency_table td.wcml-col-currency small{display:block}table.widefat.currency_table td.wcml-col-edit a{position:relative;top:-3px}table.widefat.currency_table td.wcml-col-rate{font-size:.85em}table.widefat.currency_table td.wcml-col-rate .truncate{max-width:75px;display:block}table.widefat.currency_delete_table{float:left;width:50px;border-left:none;clear:none}table.widefat.currency_delete_table td.wcml-col-delete{vertical-align:middle;text-align:center}table.widefat.currency_delete_table td.wcml-col-delete:first-child{border-left:1px solid #e5e5e5}.currency_value .wcml-error,.wcml-error{font-size:10px;color:#f00;display:inline-block}.trbl_variables_products{padding:10px;border:1px solid #8cceea;background-color:#eff8fc;border-radius:5px}.trbl_variables_products label span{font-weight:bold}.wcml_trbl_warning{padding:10px;margin-bottom:10px;border:1px solid #f00;background-color:#ffb7b7;border-radius:5px 5px}#wcml_sync_variations{background-color:#21759b;background-image:-webkit-linear-gradient(top, #2a95c5, #21759b);background-image:linear-gradient(to bottom, #2a95c5, #21759b);border-color:#21759b;border-bottom-color:#1e6a8d;box-shadow:inset 0 1px 0 rgba(120,200,230,0.5);color:#fff;text-decoration:none;text-shadow:0 1px 0 rgba(0,0,0,0.1)}.wcml_duplicate_product_notice td{border-bottom:none !important}.wcml_product_status_text,.prod_parent_text{font-style:italic;color:#9A9A9A}.wcml_no_found_text{text-align:center}.currency_languages{position:relative;text-align:center}.currency_languages:first-child{border-left:1px solid #e5e5e5}.currency_languages ul{margin:0;text-align:center}.currency_languages ul li{margin:0;display:none}.currency_languages ul li.on{display:inline-block}table.widefat.currency_lang_table{border-left:none;border-right:none}table.widefat.currency_lang_table thead tr{height:28px}table.widefat.currency_lang_table thead td{border-bottom:0;text-align:center;padding-top:3px;padding-bottom:1px;font-size:1em}table.widefat.currency_lang_table thead th{padding-top:0;padding-bottom:0;text-align:center}.currency_wrap{width:-webkit-calc(100% - 320px - 50px);width:calc(100% - 320px - 50px);float:left;margin-bottom:10px}.currency_inner{overflow-x:auto;overflow-y:visible}.currency_table,.currency_lang_table,.currency_delete_table{clear:none}.currency_table thead tr,.currency_lang_table thead tr,.currency_delete_table thead tr{height:56px}.currency_table tr,.currency_lang_table tr,.currency_delete_table tr{height:50px}.currency_lang_table th{text-align:center}.currency_lang_table td{vertical-align:middle}.currency_lang_table.widefat td{padding-right:0;padding-left:0}.default_currency select{font-size:9px;height:24px;margin:0;margin-right:2px;padding:2px 0}.default_currency td{border-top:1px solid #e5e5e5}.default_currency .inf_message{font-size:10px;font-style:italic;color:#9A9A9A}#wcml_currencies_order{display:block;overflow:hidden;width:100%}#wcml_currencies_order li{float:left;margin:2px 4px 2px 0;padding:2px 8px;border:1px solid #DFDFDF;border-radius:2px;background:-webkit-linear-gradient(bottom, #ECECEC, #F9F9F9) repeat scroll 0 0 #F1F1F1;background:linear-gradient(to top, #ECECEC, #F9F9F9) repeat scroll 0 0 #F1F1F1;cursor:move}.wcml_currencies_order_ajx_resp{font-weight:500;margin:0 5px;padding:1px 4px 2px;border-radius:3px;white-space:nowrap;color:#46b450;background-color:rgba(92,255,102,0.15)}.wcml-cs-list{font-size:inherit;width:100%;border-collapse:collapse;border:lightgrey 1px solid;vertical-align:middle}.wcml-cs-list thead tr{border:lightgrey 1px solid}.wcml-cs-list th,.wcml-cs-list td{text-align:center;padding:5px}.wcml-cs-list .wcml-cs-cell-preview{text-align:start}.wcml-cs-list .wcml-cs-actions{width:60px}.wcml-cs-list .wcml-cs-actions a{display:inline-block;width:20px;cursor:pointer}.wcml-currency-preview-wrapper{background-color:#fff;padding:15px 10px 10px;border:1px solid #ccc;width:100%;min-width:150px;min-height:120px;box-sizing:border-box;position:relative;display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.wcml-currency-preview-wrapper .wcml-currency-preview-label{position:absolute;top:5px;left:10px;z-index:101;display:inline-block;padding:2px;background:rgba(255,255,255,0.9)}.wcml-currency-preview-wrapper .spinner{position:absolute;bottom:5px;right:0;z-index:101}.wcml-cs-dialog .wcml-currency-switcher-options-form input{max-width:100%}@media (min-width: 1000px){.wcml-cs-dialog .wcml-currency-switcher-options-form{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.wcml-cs-dialog .wcml-currency-switcher-options-form .wcml-currency-switcher-options{width:60%;-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1;box-sizing:border-box}.wcml-cs-dialog .wcml-currency-switcher-options-form .wcml-currency-switcher-options>h4:first-child{margin-top:0}.wcml-cs-dialog .wcml-currency-switcher-options-form .wcml-currency-preview-wrapper{width:40%;box-sizing:border-box;-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.wcml-cs-dialog .wcml-currency-switcher-options-form .wcml-currency-preview-wrapper>div{display:block}}@media (max-width: 999px){.wcml-cs-dialog .wcml-currency-switcher-options-form .wcml-currency-preview-wrapper{margin:-17px -15px 30px -15px;width:-webkit-calc(100% + 2 * 15px);width:calc(100% + 2 * 15px);border-left:0;border-right:0;z-index:10}}.wcml-cs-panel-colors table{width:100%;max-width:600px;font-size:inherit}.wcml-cs-panel-colors table th{text-align:start}.wcml-cs-panel-colors table td{vertical-align:top}.wcml-cs-panel-colors .wp-color-result{padding-left:50px;position:relative}@media screen and (max-width: 782px){.wcml-cs-panel-colors .wp-color-result{height:22px}}.wcml-cs-panel-colors .wp-color-result:after{background:transparent;border-radius:0;border-left:0;padding:0;right:0;left:0;position:absolute;content:''}.wcml-cs-panel-colors .wp-color-result.wp-picker-open:after{content:''}.wcml-cs-panel-colors .wp-color-result:not(.wp-picker-open):after{font-family:otgs-icons;content:'h';color:#333;text-shadow:1px 1px 2px rgba(255,255,255,0.4);font-size:16px;min-width:0}.wcml_product_name{line-height:20px}.wcml_prod_filters{float:left}.wcml_miss_lang p:first-child{float:left}#display_custom_prices_select{display:inline-block;width:100%}.edit_slug_input,.edit_slug_hide_link{display:none}.wcml-tip{cursor:help;color:#555}.wcml-products a{cursor:pointer}@media (max-width: 782px){.column-product_cat,.column-product_tag,.column-product_type{display:none}}.wcml-link-troubleshooting{margin-top:7px}.wcml-status-list li{padding-left:25px;margin-bottom:30px}.wcml-status-list li ul li{margin-bottom:3.5px}.wcml-status-list.wcml-tax-translation-list li{margin-bottom:5px;line-height:26px}.wcml-status-list.wcml-plugins-status-list li{margin-bottom:10px}.wcml-status-list [class*="otgs-ico"]:not(.otgs-ico-help){margin-left:-25px;margin-right:5px;vertical-align:baseline}.wcml-status-list .button-secondary{vertical-align:middle}.wcml-status-list small{display:block}.wcml-lang-list{margin:7px 0}.wcml-lang-list .wpml-title-flag{margin-left:-25px;margin-right:5px}.wcml-dismiss-warning{position:relative;float:right;padding:0;text-decoration:none;outline:none}.wcml-dismiss-warning:active{outline:none}.wcml-notice{background:#fff;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);margin:5px 0 15px;padding:1px 12px;position:relative}.wcml-notice p{margin:.5em 0;padding:2px}.otgs-is-dismissible{position:relative;padding-right:38px}.otgs-is-dismissible .notice-dismiss{text-decoration:none}.otgs-is-dismissible p [class*="button-"]{margin:-5px 5px}.wcml_tt_spinner{margin-right:15px;display:none}.wcml-product-attributes-selector{text-align:center;margin-bottom:25px}@media (max-width: 1280px){.wcml-product-attributes-selector{margin-left:.2em}}.wcml-product-attributes-selector select{min-width:200px}.wcml-product-custom-taxonomies-selector{text-align:center;margin-bottom:25px}.wcml_attributes_wrap #wpml_tt_taxonomy_translation_wrap>label,.wcml_custom_taxonomies_wrap #wpml_tt_taxonomy_translation_wrap>label{display:none}
res/js/currency-switcher-settings.js ADDED
@@ -0,0 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ jQuery( function($){
3
+
4
+ WCML_Currency_Switcher_Settings = {
5
+
6
+ _currency_languages_saving : 0,
7
+
8
+ init: function(){
9
+
10
+ $(document).ready( function(){
11
+
12
+ $(document).on('change','#currency_switcher_style', WCML_Currency_Switcher_Settings.update_currency_switcher_style);
13
+ $(document).on('click','.currency_switcher_save', WCML_Currency_Switcher_Settings.save_currency_switcher_settings);
14
+ $(document).on('click','.delete_currency_switcher', WCML_Currency_Switcher_Settings.delete_currency_switcher);
15
+
16
+ $(document).on('change','.js-wcml-cs-colorpicker-preset', WCML_Currency_Switcher_Settings.set_currency_switcher_color_pre_set );
17
+
18
+ $(document).on('keyup','input[name="wcml_curr_template"]', WCML_Currency_Switcher_Settings.setup_currency_switcher_template_keyup);
19
+ $(document).on('change','input[name="wcml_curr_template"]', WCML_Currency_Switcher_Settings.setup_currency_switcher_template_change);
20
+
21
+ WCML_Currency_Switcher_Settings.open_dialog_from_hash();
22
+
23
+ } );
24
+
25
+ },
26
+
27
+ initColorPicker : function() {
28
+ $('.wcml-ui-dialog .js-wcml-cs-panel-colors').find('.js-wcml-cs-colorpicker').wpColorPicker({
29
+ change: function(e){
30
+ var dialog = $( this ).closest( '.wcml-ui-dialog' );
31
+ WCML_Currency_Switcher_Settings.currency_switcher_preview( dialog );
32
+ },
33
+ clear: function(e){
34
+ var dialog = $( this ).closest( '.wcml-ui-dialog' );
35
+ WCML_Currency_Switcher_Settings.currency_switcher_preview( dialog );
36
+ }
37
+ });
38
+ },
39
+
40
+ save_currency_switcher_settings: function(){
41
+
42
+ var dialog = $( this ).closest( '.wcml-ui-dialog' );
43
+ var ajaxLoader = $('<span class="spinner" style="visibility: visible;"></span>');
44
+ var widget_name = dialog.find('#wcml-cs-widget option:selected').text();
45
+ var switcher_id = dialog.find('#wcml_currencies_switcher_id').val();
46
+ var widget_id = dialog.find('#wcml-cs-widget').val();
47
+ var widget_title = dialog.find('input[name="wcml_cs_widget_title"]').val();
48
+ var switcher_style = dialog.find('#currency_switcher_style').val();
49
+
50
+ ajaxLoader.show();
51
+ $(this).parent().append(ajaxLoader);
52
+ dialog.find(':submit,:button').prop('disabled', true);
53
+
54
+ var template = dialog.find('input[name="wcml_curr_template"]').val();
55
+ if(!template){
56
+ template = dialog.find('#currency_switcher_default').val();
57
+ }
58
+
59
+ var color_scheme = {};
60
+ dialog.find('input.js-wcml-cs-colorpicker').each( function(){
61
+ color_scheme[ $(this).attr('name') ] = $(this).val();
62
+ });
63
+
64
+ $.ajax({
65
+ type: 'POST',
66
+ dataType: 'json',
67
+ url: ajaxurl,
68
+ data: {
69
+ action: 'wcml_currencies_switcher_save_settings',
70
+ wcml_nonce: dialog.find('#wcml_currencies_switcher_save_settings_nonce').val(),
71
+ switcher_id: switcher_id,
72
+ widget_id: widget_id,
73
+ widget_title: widget_title,
74
+ switcher_style: switcher_style,
75
+ template: template,
76
+ color_scheme: color_scheme
77
+ },
78
+ success: function(e) {
79
+ dialog.find('.ui-dialog-titlebar-close').trigger('click');
80
+
81
+ if( typeof widget_id == 'undefined' ){
82
+ widget_id = switcher_id;
83
+ }
84
+
85
+ $('#wcml_currency_switcher_options_form_new_widget #wcml-cs-widget option').each( function(){
86
+ if( $(this).val() == widget_id ){
87
+ $(this).remove();
88
+ }
89
+ });
90
+
91
+ if( $('#wcml_currency_switcher_options_form_new_widget #wcml-cs-widget option').length == 0 ){
92
+ $('.wcml_add_cs_sidebar').fadeOut();
93
+ }
94
+
95
+ if( $('#currency-switcher-widget .wcml-cs-list').find('thead tr').is(':hidden') ){
96
+ $('#currency-switcher-widget .wcml-cs-list').find('thead tr').fadeIn();
97
+ }
98
+
99
+ if( $('.wcml-currency-preview.' + widget_id ).length == 0 ){
100
+
101
+ var widget_row = $('.wcml-cs-empty-row').clone();
102
+ widget_row.removeClass('wcml-cs-empty-row');
103
+ widget_row.find('.wcml-currency-preview').addClass(widget_id);
104
+ widget_row.find('.wcml-cs-widget-name').html( widget_name );
105
+ widget_row.find('.edit_currency_switcher').attr('data-switcher', widget_id );
106
+ widget_row.find('.edit_currency_switcher').attr('data-dialog', 'wcml_currency_switcher_options_' + widget_id );
107
+ widget_row.find('.edit_currency_switcher').attr('data-content', 'wcml_currency_switcher_options_' + widget_id );
108
+ widget_row.find('.delete_currency_switcher').attr('data-switcher', widget_id );
109
+ widget_row.show();
110
+
111
+ $('.wcml-cs-list').find('tr.wcml-cs-empty-row').before( widget_row );
112
+ if( $('.wcml-cs-list').is(':hidden') ){
113
+ $('.wcml-cs-list').fadeIn();
114
+ }
115
+ }
116
+ $('#wcml_currency_switcher_options_' + widget_id).remove();
117
+ dialog.find('.wcml-dialog-container').attr('id','wcml-dialog-wcml_currency_switcher_options_'+ widget_id );
118
+ dialog.find(':submit,:button').prop('disabled', false);
119
+ dialog.find('#wcml_currencies_switcher_id').val( widget_id );
120
+ ajaxLoader.remove();
121
+
122
+ WCML_Currency_Switcher_Settings.currency_switcher_preview( dialog, true );
123
+ }
124
+ });
125
+
126
+ return false;
127
+ },
128
+
129
+ delete_currency_switcher: function(e){
130
+
131
+ e.preventDefault();
132
+
133
+ var switcher_id = $(this).data( 'switcher' );
134
+ var switcher_row = $(this).closest('tr');
135
+ var ajaxLoader = $('<span class="spinner" style="visibility: visible;">');
136
+ $(this).parent().html( ajaxLoader );
137
+
138
+ $.ajax({
139
+ type: 'POST',
140
+ dataType: 'json',
141
+ url: ajaxurl,
142
+ data: {
143
+ action: 'wcml_delete_currency_switcher',
144
+ wcml_nonce: $('#wcml_delete_currency_switcher_nonce').val(),
145
+ switcher_id: switcher_id
146
+ },
147
+ success: function(e){
148
+ var sidebar_name = switcher_row.find('.wcml-cs-widget-name').html();
149
+ $('#wcml_currency_switcher_options_form_new_widget #wcml-cs-widget').append( '<option value="'+switcher_id+'">'+sidebar_name+'</option>');
150
+
151
+ switcher_row.remove();
152
+
153
+ if( $('#currency-switcher-widget .wcml-cs-list').find('tbody tr').length == 1 ){
154
+ $('#currency-switcher-widget .wcml-cs-list').find('thead tr').fadeOut();
155
+ }
156
+ if( $('.wcml_add_cs_sidebar').is(':hidden') ){
157
+ $('.wcml_add_cs_sidebar').fadeIn();
158
+ }
159
+ }
160
+ });
161
+ },
162
+
163
+ currency_switcher_preview: _.debounce( function ( dialog, update_settings ){
164
+
165
+ var template = dialog.find('input[name="wcml_curr_template"]').val();
166
+ if(!template){
167
+ template = dialog.find('#currency_switcher_default').val();
168
+ }
169
+
170
+ var ajaxLoader = $('<span class="spinner" style="visibility: visible;">');
171
+ dialog.find('#wcml_curr_sel_preview_wrap').append(ajaxLoader);
172
+
173
+ var color_scheme = {};
174
+ dialog.find('input.js-wcml-cs-colorpicker').each( function(){
175
+ color_scheme[ $(this).attr('name') ] = $(this).val();
176
+ });
177
+
178
+ var switcher_id = dialog.find('#wcml_currencies_switcher_id').val();
179
+ var switcher_style = dialog.find('#currency_switcher_style').val();
180
+
181
+ $.ajax({
182
+ type: "POST",
183
+ url: ajaxurl,
184
+ dataType: 'json',
185
+ data: {
186
+ action: 'wcml_currencies_switcher_preview',
187
+ wcml_nonce: dialog.find('#wcml_currencies_switcher_preview_nonce').val(),
188
+ switcher_id: switcher_id,
189
+ switcher_style: switcher_style,
190
+ template: template,
191
+ color_scheme: color_scheme
192
+ },
193
+ success: function(resp){
194
+ if( resp.success ) {
195
+ resp = resp.data;
196
+ if( $( '#'+resp.inline_styles_id).length == 0 ){
197
+ $('head').append( '<style type="text/css" id="'+resp.inline_styles_id+'">'+ resp.inline_css+'</style>' );
198
+ }else{
199
+ $( '#'+resp.inline_styles_id).html( resp.inline_css );
200
+ }
201
+ ajaxLoader.remove();
202
+ if( update_settings ){
203
+ if( switcher_id == 'new_widget'){
204
+ switcher_id = dialog.find('#wcml-cs-widget').val();
205
+ }
206
+ $('.wcml-currency-preview.'+switcher_id).html(resp.preview);
207
+ }else{
208
+ dialog.find('.wcml-currency-preview').html(resp.preview);
209
+ }
210
+
211
+ if( switcher_style == 'wcml-dropdown-click' ){
212
+ WCMLCurrecnySwitcherDropdownClick.init();
213
+ }
214
+ }
215
+
216
+ }
217
+ });
218
+ }, 500),
219
+
220
+ set_currency_switcher_color_pre_set: function (){
221
+
222
+ var color_sheme = $(this).val();
223
+ var dialog = $( this ).closest( '.wcml-ui-dialog' );
224
+
225
+ if( settings.pre_selected_colors[color_sheme] != 'undefined' ){
226
+ var selected_scheme = settings.pre_selected_colors[color_sheme];
227
+ var color;
228
+ for ( color in selected_scheme ) {
229
+ $('.wcml-ui-dialog input[name="'+color+'"]').val( selected_scheme[ color ] );
230
+ $('.wcml-ui-dialog input[name="'+color+'"]').closest('.wp-picker-container').find('.wp-color-result').css( 'background-color', selected_scheme[color] );
231
+ }
232
+ }
233
+
234
+ WCML_Currency_Switcher_Settings.currency_switcher_preview( dialog );
235
+ },
236
+
237
+ update_currency_switcher_style: function(e){
238
+ var dialog = $( this ).closest( '.wcml-ui-dialog' );
239
+ WCML_Currency_Switcher_Settings.currency_switcher_preview( dialog );
240
+ },
241
+
242
+ setup_currency_switcher_template_keyup: function(e){
243
+ var dialog = $( this ).closest( '.wcml-ui-dialog' );
244
+ discard = true;
245
+ $(this).closest('.wcml-section').find('.button-wrap input').css("border-color","#1e8cbe");
246
+ WCML_Currency_Switcher_Settings.currency_switcher_preview( dialog );
247
+ },
248
+
249
+ setup_currency_switcher_template_change: function(e){
250
+ if(!$(this).val()){
251
+ $(this).val($('#currency_switcher_default').val())
252
+ }
253
+ },
254
+
255
+ open_dialog_from_hash: function(){
256
+ var hashParts = window.location.hash.substring(1).split('/'),
257
+ type = hashParts[0] || '',
258
+ slug = hashParts[1] || '';
259
+
260
+ if ( type == 'currency-switcher' ) {
261
+ $('.edit_currency_switcher[data-switcher="'+slug+'"]').trigger('click');
262
+ parent.location.hash = '';
263
+ }
264
+ }
265
+
266
+ }
267
+
268
+ WCML_Currency_Switcher_Settings.init();
269
+
270
+ } );
res/js/currency-switcher-settings.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(function(a){WCML_Currency_Switcher_Settings={_currency_languages_saving:0,init:function(){a(document).ready(function(){a(document).on("change","#currency_switcher_style",WCML_Currency_Switcher_Settings.update_currency_switcher_style),a(document).on("click",".currency_switcher_save",WCML_Currency_Switcher_Settings.save_currency_switcher_settings),a(document).on("click",".delete_currency_switcher",WCML_Currency_Switcher_Settings.delete_currency_switcher),a(document).on("change",".js-wcml-cs-colorpicker-preset",WCML_Currency_Switcher_Settings.set_currency_switcher_color_pre_set),a(document).on("keyup",'input[name="wcml_curr_template"]',WCML_Currency_Switcher_Settings.setup_currency_switcher_template_keyup),a(document).on("change",'input[name="wcml_curr_template"]',WCML_Currency_Switcher_Settings.setup_currency_switcher_template_change),WCML_Currency_Switcher_Settings.open_dialog_from_hash()})},initColorPicker:function(){a(".wcml-ui-dialog .js-wcml-cs-panel-colors").find(".js-wcml-cs-colorpicker").wpColorPicker({change:function(b){var c=a(this).closest(".wcml-ui-dialog");WCML_Currency_Switcher_Settings.currency_switcher_preview(c)},clear:function(b){var c=a(this).closest(".wcml-ui-dialog");WCML_Currency_Switcher_Settings.currency_switcher_preview(c)}})},save_currency_switcher_settings:function(){var b=a(this).closest(".wcml-ui-dialog"),c=a('<span class="spinner" style="visibility: visible;"></span>'),d=b.find("#wcml-cs-widget option:selected").text(),e=b.find("#wcml_currencies_switcher_id").val(),f=b.find("#wcml-cs-widget").val(),g=b.find('input[name="wcml_cs_widget_title"]').val(),h=b.find("#currency_switcher_style").val();c.show(),a(this).parent().append(c),b.find(":submit,:button").prop("disabled",!0);var i=b.find('input[name="wcml_curr_template"]').val();i||(i=b.find("#currency_switcher_default").val());var j={};return b.find("input.js-wcml-cs-colorpicker").each(function(){j[a(this).attr("name")]=a(this).val()}),a.ajax({type:"POST",dataType:"json",url:ajaxurl,data:{action:"wcml_currencies_switcher_save_settings",wcml_nonce:b.find("#wcml_currencies_switcher_save_settings_nonce").val(),switcher_id:e,widget_id:f,widget_title:g,switcher_style:h,template:i,color_scheme:j},success:function(g){if(b.find(".ui-dialog-titlebar-close").trigger("click"),"undefined"==typeof f&&(f=e),a("#wcml_currency_switcher_options_form_new_widget #wcml-cs-widget option").each(function(){a(this).val()==f&&a(this).remove()}),0==a("#wcml_currency_switcher_options_form_new_widget #wcml-cs-widget option").length&&a(".wcml_add_cs_sidebar").fadeOut(),a("#currency-switcher-widget .wcml-cs-list").find("thead tr").is(":hidden")&&a("#currency-switcher-widget .wcml-cs-list").find("thead tr").fadeIn(),0==a(".wcml-currency-preview."+f).length){var h=a(".wcml-cs-empty-row").clone();h.removeClass("wcml-cs-empty-row"),h.find(".wcml-currency-preview").addClass(f),h.find(".wcml-cs-widget-name").html(d),h.find(".edit_currency_switcher").attr("data-switcher",f),h.find(".edit_currency_switcher").attr("data-dialog","wcml_currency_switcher_options_"+f),h.find(".edit_currency_switcher").attr("data-content","wcml_currency_switcher_options_"+f),h.find(".delete_currency_switcher").attr("data-switcher",f),h.show(),a(".wcml-cs-list").find("tr.wcml-cs-empty-row").before(h),a(".wcml-cs-list").is(":hidden")&&a(".wcml-cs-list").fadeIn()}a("#wcml_currency_switcher_options_"+f).remove(),b.find(".wcml-dialog-container").attr("id","wcml-dialog-wcml_currency_switcher_options_"+f),b.find(":submit,:button").prop("disabled",!1),b.find("#wcml_currencies_switcher_id").val(f),c.remove(),WCML_Currency_Switcher_Settings.currency_switcher_preview(b,!0)}}),!1},delete_currency_switcher:function(b){b.preventDefault();var c=a(this).data("switcher"),d=a(this).closest("tr"),e=a('<span class="spinner" style="visibility: visible;">');a(this).parent().html(e),a.ajax({type:"POST",dataType:"json",url:ajaxurl,data:{action:"wcml_delete_currency_switcher",wcml_nonce:a("#wcml_delete_currency_switcher_nonce").val(),switcher_id:c},success:function(b){var e=d.find(".wcml-cs-widget-name").html();a("#wcml_currency_switcher_options_form_new_widget #wcml-cs-widget").append('<option value="'+c+'">'+e+"</option>"),d.remove(),1==a("#currency-switcher-widget .wcml-cs-list").find("tbody tr").length&&a("#currency-switcher-widget .wcml-cs-list").find("thead tr").fadeOut(),a(".wcml_add_cs_sidebar").is(":hidden")&&a(".wcml_add_cs_sidebar").fadeIn()}})},currency_switcher_preview:_.debounce(function(b,c){var d=b.find('input[name="wcml_curr_template"]').val();d||(d=b.find("#currency_switcher_default").val());var e=a('<span class="spinner" style="visibility: visible;">');b.find("#wcml_curr_sel_preview_wrap").append(e);var f={};b.find("input.js-wcml-cs-colorpicker").each(function(){f[a(this).attr("name")]=a(this).val()});var g=b.find("#wcml_currencies_switcher_id").val(),h=b.find("#currency_switcher_style").val();a.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"wcml_currencies_switcher_preview",wcml_nonce:b.find("#wcml_currencies_switcher_preview_nonce").val(),switcher_id:g,switcher_style:h,template:d,color_scheme:f},success:function(d){0==a("#"+d.inline_styles_id).length?a("head").append('<style type="text/css" id="'+d.inline_styles_id+'">'+d.inline_css+"</style>"):a("#"+d.inline_styles_id).html(d.inline_css),e.remove(),c?("new_widget"==g&&(g=b.find("#wcml-cs-widget").val()),a(".wcml-currency-preview."+g).html(d.preview)):b.find(".wcml-currency-preview").html(d.preview),"wcml-dropdown-click"==h&&WCMLCurrecnySwitcherDropdownClick.init()}})},500),set_currency_switcher_color_pre_set:function(){var b=a(this).val(),c=a(this).closest(".wcml-ui-dialog");if("undefined"!=settings.pre_selected_colors[b]){var d,e=settings.pre_selected_colors[b];for(d in e)a('.wcml-ui-dialog input[name="'+d+'"]').val(e[d]),a('.wcml-ui-dialog input[name="'+d+'"]').closest(".wp-picker-container").find(".wp-color-result").css("background-color",e[d])}WCML_Currency_Switcher_Settings.currency_switcher_preview(c)},update_currency_switcher_style:function(b){var c=a(this).closest(".wcml-ui-dialog");WCML_Currency_Switcher_Settings.currency_switcher_preview(c)},setup_currency_switcher_template_keyup:function(b){var c=a(this).closest(".wcml-ui-dialog");discard=!0,a(this).closest(".wcml-section").find(".button-wrap input").css("border-color","#1e8cbe"),WCML_Currency_Switcher_Settings.currency_switcher_preview(c)},setup_currency_switcher_template_change:function(b){a(this).val()||a(this).val(a("#currency_switcher_default").val())},open_dialog_from_hash:function(){var b=window.location.hash.substring(1).split("/"),c=b[0]||"",d=b[1]||"";"currency-switcher"==c&&(a('.edit_currency_switcher[data-switcher="'+d+'"]').trigger("click"),parent.location.hash="")}},WCML_Currency_Switcher_Settings.init()});
res/js/dialogs.js CHANGED
@@ -3,6 +3,8 @@ var WCML_Dialog = WCML_Dialog || {};
3
 
4
  jQuery( function($){
5
 
 
 
6
  WCML_Dialog.dialog = function(dialog_id, data){
7
  var self = this;
8
 
@@ -13,7 +15,7 @@ jQuery( function($){
13
  self.overflow_y = $('body').css('overflow-y');
14
  $('body').css('overflow-y','hidden');
15
 
16
- var dialog_div = $('#wcml-dialog-' + dialog_id);
17
 
18
  var title = $('#' + dialog_id).attr('title');
19
  if( typeof title == 'undefined'){
@@ -24,6 +26,14 @@ jQuery( function($){
24
  }
25
  }
26
 
 
 
 
 
 
 
 
 
27
  if(!dialog_div.length){
28
  $(document.body).append($('<div class="wcml-dialog-container" title="' + title + '" id="wcml-dialog-' + dialog_id + '" />'));
29
 
@@ -34,13 +44,13 @@ jQuery( function($){
34
  title: '',
35
  autoOpen:false,
36
  show:true,
37
- dialogClass:'wcml-ui-dialog otgs-ui-dialog',
38
  position: { my: 'center', at: 'center', of: window },
39
  modal:true,
40
  width: "90%",
41
  height: window_h * 0.7,
42
  resizable:false,
43
- draggable:false,
44
  beforeOpen: function (event) {
45
  },
46
  beforeClose: function (event) {
@@ -53,16 +63,22 @@ jQuery( function($){
53
  focus: function (event) {
54
  },
55
  open: function (event) {
 
 
 
 
 
 
56
  },
57
  refresh:function(event){
58
  }
59
  };
60
 
61
- if(typeof data.height != 'undefined'){
62
  dialog_parameters.height = Math.min(window_h * 0.7, data.height);
63
  }
64
 
65
- if(typeof data.width != 'undefined'){
66
  dialog_parameters.width = data.width;
67
  }
68
 
@@ -72,10 +88,19 @@ jQuery( function($){
72
  dialog_div.dialog(dialog_parameters);
73
  }
74
 
75
-
76
  }
77
 
78
- if(WCML_Dialog.using_wpdialog) { // pre WP 3.5
 
 
 
 
 
 
 
 
 
 
79
  dialog_div.wpdialog('open');
80
  }else{
81
  dialog_div.dialog('open');
@@ -101,9 +126,7 @@ jQuery( function($){
101
 
102
  // load static html
103
  if( data.content && $('#' + data.content).length ) {
104
-
105
  dialog_div.html($('#' + data.content).html());
106
-
107
  }
108
 
109
  if( typeof WCML_Tooltip != 'undefined' ){
@@ -111,7 +134,41 @@ jQuery( function($){
111
  }
112
 
113
  return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  }
116
 
117
  WCML_Dialog._register_open_handler = function(){
@@ -132,13 +189,31 @@ jQuery( function($){
132
  if($(this).data('action')){
133
  $(this).data('action', $(this).data('action').replace(/-/g, '_'));
134
  }
135
-
136
  WCML_Dialog.dialog(dialog_id, $(this).data());
137
  }
 
138
 
 
 
139
 
140
- });
 
 
 
 
 
 
 
 
 
 
 
 
141
 
 
 
 
 
142
  }
143
 
144
  WCML_Dialog._register_close_handler = function(){
@@ -190,30 +265,22 @@ jQuery( function($){
190
  }
191
  }
192
  });
193
-
194
  }
195
 
196
  if(!data.stay){
197
-
198
  elem.trigger('before_close_dialog');
199
-
200
  if(WCML_Dialog.using_wpdialog){ // pre WP 3.5
201
  dialog_div.wpdialog('close');
202
  }else{
203
  dialog_div.dialog('close');
204
  }
205
-
206
  }
207
-
208
  });
209
-
210
-
211
  }
212
 
213
  WCML_Dialog.init = function(){
214
 
215
  $(document).ready(function() {
216
-
217
  if (typeof $.wp != 'undefined') {
218
  WCML_Dialog.using_wpdialog = typeof $.wp.wpdialog != 'undefined';
219
  } else {
@@ -222,13 +289,10 @@ jQuery( function($){
222
 
223
  WCML_Dialog._register_open_handler();
224
  WCML_Dialog._register_close_handler();
225
-
226
  });
227
-
228
  }
229
 
230
  WCML_Dialog.init();
231
-
232
  });
233
 
234
 
3
 
4
  jQuery( function($){
5
 
6
+ var dialog_div;
7
+
8
  WCML_Dialog.dialog = function(dialog_id, data){
9
  var self = this;
10
 
15
  self.overflow_y = $('body').css('overflow-y');
16
  $('body').css('overflow-y','hidden');
17
 
18
+ dialog_div = $('#wcml-dialog-' + dialog_id);
19
 
20
  var title = $('#' + dialog_id).attr('title');
21
  if( typeof title == 'undefined'){
26
  }
27
  }
28
 
29
+ if( typeof data.class === 'undefined'){
30
+ data.class = '';
31
+ }
32
+
33
+ if( typeof data.draggable === 'undefined'){
34
+ data.draggable = false;
35
+ }
36
+
37
  if(!dialog_div.length){
38
  $(document.body).append($('<div class="wcml-dialog-container" title="' + title + '" id="wcml-dialog-' + dialog_id + '" />'));
39
 
44
  title: '',
45
  autoOpen:false,
46
  show:true,
47
+ dialogClass:'wcml-ui-dialog otgs-ui-dialog ' + data.class,
48
  position: { my: 'center', at: 'center', of: window },
49
  modal:true,
50
  width: "90%",
51
  height: window_h * 0.7,
52
  resizable:false,
53
+ draggable: data.draggable,
54
  beforeOpen: function (event) {
55
  },
56
  beforeClose: function (event) {
63
  focus: function (event) {
64
  },
65
  open: function (event) {
66
+ $('body').css('overflow', 'hidden');
67
+ WCML_Dialog._repositionDialog();
68
+
69
+ if( data.class === 'wcml-cs-dialog' ){
70
+ WCML_Dialog._attachDialogScrollEvent();
71
+ }
72
  },
73
  refresh:function(event){
74
  }
75
  };
76
 
77
+ if(typeof data.height != 'undefined' && data.class != 'wcml-cs-dialog'){
78
  dialog_parameters.height = Math.min(window_h * 0.7, data.height);
79
  }
80
 
81
+ if(typeof data.width != 'undefined' && data.class != 'wcml-cs-dialog'){
82
  dialog_parameters.width = data.width;
83
  }
84
 
88
  dialog_div.dialog(dialog_parameters);
89
  }
90
 
 
91
  }
92
 
93
+ var resizeWindowEvent = _.debounce(function() {
94
+ WCML_Dialog._repositionDialog();
95
+ if( data.class === 'wcml-cs-dialog' ) {
96
+ WCML_Dialog._attachDialogScrollEvent();
97
+ }
98
+ }, 200);
99
+
100
+ $(window).resize(resizeWindowEvent);
101
+
102
+
103
+ if(WCML_Dialog.using_wpdialog) { // pre WP 3.5
104
  dialog_div.wpdialog('open');
105
  }else{
106
  dialog_div.dialog('open');
126
 
127
  // load static html
128
  if( data.content && $('#' + data.content).length ) {
 
129
  dialog_div.html($('#' + data.content).html());
 
130
  }
131
 
132
  if( typeof WCML_Tooltip != 'undefined' ){
134
  }
135
 
136
  return false;
137
+ }
138
+
139
+ WCML_Dialog._repositionDialog = function () {
140
+ var winH = $(window).height() - 180;
141
+ dialog_div.css("max-height", winH);
142
+
143
+ dialog_div.dialog("option", "position", {
144
+ my: "center",
145
+ at: "center",
146
+ of: window
147
+ });
148
+ }
149
+
150
+ WCML_Dialog._attachDialogScrollEvent = function() {
151
+ var preview = dialog_div.find('.wcml-currency-preview-wrapper'),
152
+ has_two_columns = dialog_div.width() > 900,
153
+ has_minimal_height = (preview.height() + 200) < dialog_div.height();
154
 
155
+ has_minimal_height = has_minimal_height || (has_two_columns && preview.height() < dialog_div.height());
156
+
157
+ if (has_minimal_height) {
158
+ dialog_div.on('scroll.preview', function(){
159
+ dialog_div.find('.wcml-currency-preview-wrapper').css({
160
+ position: 'relative',
161
+ top: dialog_div.scrollTop()
162
+ });
163
+ });
164
+ } else {
165
+ dialog_div
166
+ .off('scroll.preview')
167
+ .find('.wcml-currency-preview-wrapper').css({
168
+ position: 'relative',
169
+ top: 0
170
+ });
171
+ }
172
  }
173
 
174
  WCML_Dialog._register_open_handler = function(){
189
  if($(this).data('action')){
190
  $(this).data('action', $(this).data('action').replace(/-/g, '_'));
191
  }
 
192
  WCML_Dialog.dialog(dialog_id, $(this).data());
193
  }
194
+ });
195
 
196
+ // dialog open handler
197
+ $(document).on( 'click','.js-wcml-cs-dialog-trigger', function(e){
198
 
199
+ e.preventDefault();
200
+ var dialog_id = false;
201
+
202
+ if( $(this).data('dialog') ){
203
+ dialog_id = $(this).data('dialog');
204
+ }
205
+
206
+ var data = $(this).data();
207
+ data.class = 'wcml-cs-dialog';
208
+ data.draggable = true;
209
+
210
+ if( dialog_id ){
211
+ WCML_Dialog.dialog( dialog_id, data );
212
 
213
+ WCML_Currency_Switcher_Settings.initColorPicker();
214
+ WCML_Currency_Switcher_Settings.currency_switcher_preview( $('#wcml-dialog-'+dialog_id) );
215
+ }
216
+ });
217
  }
218
 
219
  WCML_Dialog._register_close_handler = function(){
265
  }
266
  }
267
  });
 
268
  }
269
 
270
  if(!data.stay){
 
271
  elem.trigger('before_close_dialog');
 
272
  if(WCML_Dialog.using_wpdialog){ // pre WP 3.5
273
  dialog_div.wpdialog('close');
274
  }else{
275
  dialog_div.dialog('close');
276
  }
 
277
  }
 
278
  });
 
 
279
  }
280
 
281
  WCML_Dialog.init = function(){
282
 
283
  $(document).ready(function() {
 
284
  if (typeof $.wp != 'undefined') {
285
  WCML_Dialog.using_wpdialog = typeof $.wp.wpdialog != 'undefined';
286
  } else {
289
 
290
  WCML_Dialog._register_open_handler();
291
  WCML_Dialog._register_close_handler();
 
292
  });
 
293
  }
294
 
295
  WCML_Dialog.init();
 
296
  });
297
 
298
 
res/js/dialogs.min.js CHANGED
@@ -1 +1 @@
1
- var WCML_Dialog=WCML_Dialog||{};jQuery(function(a){WCML_Dialog.dialog=function(b,c){var d=this;"undefined"==typeof b&&(b="generic"),d.overflow_y=a("body").css("overflow-y"),a("body").css("overflow-y","hidden");var e=a("#wcml-dialog-"+b),f=a("#"+b).attr("title");if("undefined"==typeof f&&(f="undefined"!=c.title?c.title:""),!e.length){a(document.body).append(a('<div class="wcml-dialog-container" title="'+f+'" id="wcml-dialog-'+b+'" />')),e=a("#wcml-dialog-"+b);var g=a(window).height(),h={title:"",autoOpen:!1,show:!0,dialogClass:"wcml-ui-dialog otgs-ui-dialog",position:{my:"center",at:"center",of:window},modal:!0,width:"90%",height:.7*g,resizable:!1,draggable:!1,beforeOpen:function(a){},beforeClose:function(a){},close:function(b){a("body").css("overflow-y",d.overflow_y)},create:function(a){},focus:function(a){},open:function(a){},refresh:function(a){}};"undefined"!=typeof c.height&&(h.height=Math.min(.7*g,c.height)),"undefined"!=typeof c.width&&(h.width=c.width),WCML_Dialog.using_wpdialog?e.wpdialog(h):e.dialog(h)}if(WCML_Dialog.using_wpdialog?e.wpdialog("open"):e.dialog("open"),c.action){var i=a('<div class="spinner"></div>');i.css({display:"inline-block",visibility:"visible","float":"none"}),e.html(i),a.ajax({url:ajaxurl,type:"post",dataType:"json",data:c,success:function(a){e.html(a.html)}})}return c.content&&a("#"+c.content).length&&e.html(a("#"+c.content).html()),"undefined"!=typeof WCML_Tooltip&&WCML_Tooltip.init(),!1},WCML_Dialog._register_open_handler=function(){a(document).on("click",".js-wcml-dialog-trigger",function(b){b.preventDefault();var c=!1;a(this).data("dialog")?c=a(this).data("dialog"):a(this).data("action")&&(c=a(this).data("action")),c&&(a(this).data("action")&&a(this).data("action",a(this).data("action").replace(/-/g,"_")),WCML_Dialog.dialog(c,a(this).data()))})},WCML_Dialog._register_close_handler=function(){a(document).on("click",".wcml-dialog-close-button",function(b){b.preventDefault(),"undefined"!=typeof tinyMCE&&tinyMCE.triggerSave(),a(".wcml-dialog").find(".mce_editor textarea").each(function(){var b=a(this).attr("id"),c=a(this);if(b in tinyMCE.editors){var d=tinyMCE.get(b);d.isHidden()||c.val(d.getContent())}});var c=a(this).closest(".wcml-dialog-container"),d=a(this);d.attr("disabled","disabled");var e=a(this).data();if(e.action){var f=a('<div class="spinner"></div>');f.css({visibility:"visible","float":"right"}).prependTo(a(".wcml-dialog-footer .alignright")),a.ajax({url:ajaxurl,type:"post",dataType:"json",data:{action:e.action,fields:d.closest(".wcml-dialog-container").find("form").serialize(),icl_nonce:e.nonce},async:!1,success:function(a){e.stay&&(f.remove(),d.removeAttr("disabled"))}})}e.stay||(d.trigger("before_close_dialog"),WCML_Dialog.using_wpdialog?c.wpdialog("close"):c.dialog("close"))})},WCML_Dialog.init=function(){a(document).ready(function(){"undefined"!=typeof a.wp?WCML_Dialog.using_wpdialog="undefined"!=typeof a.wp.wpdialog:WCML_Dialog.using_wpdialog=!1,WCML_Dialog._register_open_handler(),WCML_Dialog._register_close_handler()})},WCML_Dialog.init()});
1
+ var WCML_Dialog=WCML_Dialog||{};jQuery(function(a){var b;WCML_Dialog.dialog=function(c,d){var e=this;"undefined"==typeof c&&(c="generic"),e.overflow_y=a("body").css("overflow-y"),a("body").css("overflow-y","hidden"),b=a("#wcml-dialog-"+c);var f=a("#"+c).attr("title");if("undefined"==typeof f&&(f="undefined"!=d.title?d.title:""),"undefined"==typeof d["class"]&&(d["class"]=""),"undefined"==typeof d.draggable&&(d.draggable=!1),!b.length){a(document.body).append(a('<div class="wcml-dialog-container" title="'+f+'" id="wcml-dialog-'+c+'" />')),b=a("#wcml-dialog-"+c);var g=a(window).height(),h={title:"",autoOpen:!1,show:!0,dialogClass:"wcml-ui-dialog otgs-ui-dialog "+d["class"],position:{my:"center",at:"center",of:window},modal:!0,width:"90%",height:.7*g,resizable:!1,draggable:d.draggable,beforeOpen:function(a){},beforeClose:function(a){},close:function(b){a("body").css("overflow-y",e.overflow_y)},create:function(a){},focus:function(a){},open:function(b){a("body").css("overflow","hidden"),WCML_Dialog._repositionDialog(),"wcml-cs-dialog"===d["class"]&&WCML_Dialog._attachDialogScrollEvent()},refresh:function(a){}};"undefined"!=typeof d.height&&"wcml-cs-dialog"!=d["class"]&&(h.height=Math.min(.7*g,d.height)),"undefined"!=typeof d.width&&"wcml-cs-dialog"!=d["class"]&&(h.width=d.width),WCML_Dialog.using_wpdialog?b.wpdialog(h):b.dialog(h)}var i=_.debounce(function(){WCML_Dialog._repositionDialog(),"wcml-cs-dialog"===d["class"]&&WCML_Dialog._attachDialogScrollEvent()},200);if(a(window).resize(i),WCML_Dialog.using_wpdialog?b.wpdialog("open"):b.dialog("open"),d.action){var j=a('<div class="spinner"></div>');j.css({display:"inline-block",visibility:"visible","float":"none"}),b.html(j),a.ajax({url:ajaxurl,type:"post",dataType:"json",data:d,success:function(a){b.html(a.html)}})}return d.content&&a("#"+d.content).length&&b.html(a("#"+d.content).html()),"undefined"!=typeof WCML_Tooltip&&WCML_Tooltip.init(),!1},WCML_Dialog._repositionDialog=function(){var c=a(window).height()-180;b.css("max-height",c),b.dialog("option","position",{my:"center",at:"center",of:window})},WCML_Dialog._attachDialogScrollEvent=function(){var a=b.find(".wcml-currency-preview-wrapper"),c=b.width()>900,d=a.height()+200<b.height();d=d||c&&a.height()<b.height(),d?b.on("scroll.preview",function(){b.find(".wcml-currency-preview-wrapper").css({position:"relative",top:b.scrollTop()})}):b.off("scroll.preview").find(".wcml-currency-preview-wrapper").css({position:"relative",top:0})},WCML_Dialog._register_open_handler=function(){a(document).on("click",".js-wcml-dialog-trigger",function(b){b.preventDefault();var c=!1;a(this).data("dialog")?c=a(this).data("dialog"):a(this).data("action")&&(c=a(this).data("action")),c&&(a(this).data("action")&&a(this).data("action",a(this).data("action").replace(/-/g,"_")),WCML_Dialog.dialog(c,a(this).data()))}),a(document).on("click",".js-wcml-cs-dialog-trigger",function(b){b.preventDefault();var c=!1;a(this).data("dialog")&&(c=a(this).data("dialog"));var d=a(this).data();d["class"]="wcml-cs-dialog",d.draggable=!0,c&&(WCML_Dialog.dialog(c,d),WCML_Currency_Switcher_Settings.initColorPicker(),WCML_Currency_Switcher_Settings.currency_switcher_preview(a("#wcml-dialog-"+c)))})},WCML_Dialog._register_close_handler=function(){a(document).on("click",".wcml-dialog-close-button",function(b){b.preventDefault(),"undefined"!=typeof tinyMCE&&tinyMCE.triggerSave(),a(".wcml-dialog").find(".mce_editor textarea").each(function(){var b=a(this).attr("id"),c=a(this);if(b in tinyMCE.editors){var d=tinyMCE.get(b);d.isHidden()||c.val(d.getContent())}});var c=a(this).closest(".wcml-dialog-container"),d=a(this);d.attr("disabled","disabled");var e=a(this).data();if(e.action){var f=a('<div class="spinner"></div>');f.css({visibility:"visible","float":"right"}).prependTo(a(".wcml-dialog-footer .alignright")),a.ajax({url:ajaxurl,type:"post",dataType:"json",data:{action:e.action,fields:d.closest(".wcml-dialog-container").find("form").serialize(),icl_nonce:e.nonce},async:!1,success:function(a){e.stay&&(f.remove(),d.removeAttr("disabled"))}})}e.stay||(d.trigger("before_close_dialog"),WCML_Dialog.using_wpdialog?c.wpdialog("close"):c.dialog("close"))})},WCML_Dialog.init=function(){a(document).ready(function(){"undefined"!=typeof a.wp?WCML_Dialog.using_wpdialog="undefined"!=typeof a.wp.wpdialog:WCML_Dialog.using_wpdialog=!1,WCML_Dialog._register_open_handler(),WCML_Dialog._register_close_handler()})},WCML_Dialog.init()});
res/js/languages_notice.js CHANGED
@@ -18,10 +18,8 @@ jQuery(document).ready(function(){
18
 
19
  jQuery('#icl_avail_languages_picker li input').each( function(){
20
  if( jQuery(this).is(':checked') ){
21
- if( jQuery('#default_language_'+jQuery(this).val()).length === 0 ){
22
- jQuery('<p class="icl_ajx_response" style="display: block">'+wcml_settings.warn+'</p>').insertBefore('#icl_ajx_response');
23
- return false;
24
- }
25
  }
26
  });
27
  });
18
 
19
  jQuery('#icl_avail_languages_picker li input').each( function(){
20
  if( jQuery(this).is(':checked') ){
21
+ jQuery('<p class="icl_ajx_response" style="display: block">'+wcml_settings.warn+'</p>').insertBefore('#icl_ajx_response');
22
+ return false;
 
 
23
  }
24
  });
25
  });
res/js/languages_notice.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(){jQuery(document).on("click","#wcml_translations_message",function(a){a.preventDefault(),jQuery.ajax({type:"post",url:ajaxurl,data:{action:"hide_wcml_translations_message",wcml_nonce:jQuery("#wcml_hide_languages_notice").val()},success:function(a){jQuery("#wcml_translations_message").remove()}})}),jQuery(document).on("click","#icl_save_language_selection",function(){jQuery("#icl_avail_languages_picker li input").each(function(){return jQuery(this).is(":checked")&&0===jQuery("#default_language_"+jQuery(this).val()).length?(jQuery('<p class="icl_ajx_response" style="display: block">'+wcml_settings.warn+"</p>").insertBefore("#icl_ajx_response"),!1):void 0})})});
1
+ jQuery(document).ready(function(){jQuery(document).on("click","#wcml_translations_message",function(a){a.preventDefault(),jQuery.ajax({type:"post",url:ajaxurl,data:{action:"hide_wcml_translations_message",wcml_nonce:jQuery("#wcml_hide_languages_notice").val()},success:function(a){jQuery("#wcml_translations_message").remove()}})}),jQuery(document).on("click","#icl_save_language_selection",function(){jQuery("#icl_avail_languages_picker li input").each(function(){return jQuery(this).is(":checked")?(jQuery('<p class="icl_ajx_response" style="display: block">'+wcml_settings.warn+"</p>").insertBefore("#icl_ajx_response"),!1):void 0})})});
res/js/lock_fields.js CHANGED
@@ -138,7 +138,7 @@ jQuery(document).ready(function($){
138
 
139
  });
140
 
141
- var wcml_lock_variation_fields = function(){
142
 
143
  var check_attr = jQuery('.woocommerce_variation>h3 select').attr('disabled');
144
 
@@ -184,6 +184,7 @@ var wcml_lock_variation_fields = function(){
184
  for (i = 0; i < var_checkboxes.length; i++) {
185
  jQuery('input[name^="variable'+var_checkboxes[i]+'"]').each(function(){
186
  jQuery(this).attr('disabled','disabled');
 
187
  jQuery(this).after(jQuery('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
188
  });
189
  }
@@ -197,19 +198,30 @@ var wcml_lock_variation_fields = function(){
197
  });
198
  }
199
 
200
- if( unlock_fields.file_paths == 1 ){
201
- var file_path_inputs = ['_wc_variation_file_names','_wc_variation_file_urls'];
202
- for (i = 0; i < file_path_inputs.length; i++) {
203
- jQuery('input[name^="'+file_path_inputs[i]+'"]').each(function(){
204
- jQuery(this).attr('readonly','readonly');
205
- jQuery(this).after(jQuery('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
206
- });
207
- }
208
- var file_path_buttons = ['upload_file_button','insert','delete'];
209
- for (i = 0; i < file_path_buttons.length; i++) {
210
- jQuery('.'+file_path_buttons[i]).attr('disabled','disabled');
211
- jQuery('.'+file_path_buttons[i]).after(jQuery('.wcml_lock_img').clone().removeClass('wcml_lock_img').show().css('float','right'));
 
 
 
 
 
 
 
 
 
 
212
  }
 
213
  }
214
 
215
  }
138
 
139
  });
140
 
141
+ var wcml_lock_variation_fields = function( file_path_sync ){
142
 
143
  var check_attr = jQuery('.woocommerce_variation>h3 select').attr('disabled');
144
 
184
  for (i = 0; i < var_checkboxes.length; i++) {
185
  jQuery('input[name^="variable'+var_checkboxes[i]+'"]').each(function(){
186
  jQuery(this).attr('disabled','disabled');
187
+ jQuery(this).parent().append('<input type="hidden" name="'+jQuery(this).attr('name')+'" value="'+jQuery(this).val()+'" />');
188
  jQuery(this).after(jQuery('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
189
  });
190
  }
198
  });
199
  }
200
 
201
+ if( file_path_sync ){
202
+
203
+ for (var key in file_path_sync) {
204
+
205
+ if( file_path_sync[ key ] == 1){
206
+
207
+ jQuery('input[name^="_wc_variation_file_names['+key+']"]').each(function(){
208
+ jQuery(this).attr('readonly','readonly');
209
+ });
210
+
211
+ jQuery('input[name^="_wc_variation_file_urls['+key+']"]').each(function(){
212
+ jQuery(this).attr('readonly','readonly');
213
+ jQuery(this).closest('tr').find('.upload_file_button').attr('disabled','disabled');
214
+ jQuery(this).closest('tr').find('.delete').attr('disabled','disabled');
215
+ jQuery(this).closest('tr').find('.delete').after(jQuery('.wcml_lock_img').clone().removeClass('wcml_lock_img').show().css('float','right'));
216
+ });
217
+
218
+ jQuery('input[name^="_wc_variation_file_urls['+key+']"]').closest('table').find('.insert').attr('disabled','disabled');
219
+ jQuery('input[name^="_wc_variation_file_urls['+key+']"]').closest('table').find('.insert').after( jQuery('.wcml_lock_img').clone().removeClass('wcml_lock_img').show().css('float','left') );
220
+
221
+ }
222
+
223
  }
224
+
225
  }
226
 
227
  }
res/js/lock_fields.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(a){var b,c=["_virtual","_downloadable","product-type","_backorders","_manage_stock","_stock","_stock_status","_sold_individually","comment_status","_tax_status","_tax_class","parent_id","crosssell_ids","upsell_ids","product_shipping_class"];for(1==unlock_fields.file_paths&&c.push("_download_type"),c=c.concat(non_standard_fields.ids),a(".wcml_prod_hidden_notice").prependTo("#woocommerce-product-data"),b=0;b<c.length;b++)a("#"+c[b]).attr("disabled","disabled"),a("#"+c[b]).after(a(".wcml_lock_img").clone().removeClass("wcml_lock_img").show());var d=["add_variation","link_all_variations","attribute_taxonomy","save_attributes","add_new_attribute","product_attributes .remove_row","add_attribute","select_all_attributes","select_no_attributes","edit-visibility"];for(d=d.concat(non_standard_fields.classes),1==unlock_fields.file_paths&&(d.push("upload_file_button"),d.push("insert"),d.push("delete"),a(".upload_file_button,.insert,.delete").bind({click:function(a){return!1}})),b=0;b<d.length;b++)a("."+d[b]).attr("disabled","disabled"),a("."+d[b]).after(a(".wcml_lock_img").clone().removeClass("wcml_lock_img").show());a("#visibility .edit-visibility span").bind({click:function(a){return!1}}),a(".remove_variation").each(function(){a(this).attr("disabled","disabled"),a(this).after(a(".wcml_lock_img").clone().removeClass("wcml_lock_img").show().css("float","right"))});var e=["_width","_height","_sku","_length","_weight","product_length","_regular_price","_sale_price","_sale_price_dates_from","_sale_price_dates_to"];for(1==unlock_fields.file_paths&&(e.push("_download_limit"),e.push("_download_expiry"),e.push("_wc_file_names[]"),e.push("_wc_file_urls[]")),e=e.concat(non_standard_fields.input_names),1==unlock_fields.menu_order&&e.push("menu_order"),b=0;b<e.length;b++)a('input[name="'+e[b]+'"]').attr("readonly","readonly"),a(".dimensions_field span.wrap").css("float","left"),("_width"==e[b]||"_height"==e[b]||"_length"==e[b])&&(a('input[name="'+e[b]+'"]').css("margin-right",0),a('input[name="'+e[b]+'"]').css("float","none"),a('input[name="'+e[b]+'"]').css("width","29%")),"_sale_price_dates_to"==e[b]?a('input[name="'+e[b]+'"]').after(a(".wcml_lock_img").clone().removeClass("wcml_lock_img").css("float","left").show()):a('input[name="'+e[b]+'"]').after(a(".wcml_lock_img").clone().removeClass("wcml_lock_img").show());a('#product_attributes td textarea,#product_attributes input[type="text"]').each(function(){a(this).attr("readonly","readonly"),a(this).after(a(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())}),a('#product_attributes input[type="checkbox"]').each(function(){a(this).attr("disabled","disabled"),a(this).after(a(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())}),a('form#post input[type="submit"]').click(function(){for(b=0;b<c.length;b++)a("#"+c[b]).removeAttr("disabled");a('.woocommerce_variation select,#variable_product_options .toolbar select,.woocommerce_variation input[type="checkbox"],#product_attributes input[type="checkbox"]').each(function(){a(this).removeAttr("disabled")})})});var wcml_lock_variation_fields=function(){var a=jQuery(".woocommerce_variation>h3 select").attr("disabled");if("undefined"==typeof a||a===!1){jQuery(".woocommerce_variation>h3 select, #variable_product_options .toolbar select, .show_if_variation_manage_stock select").each(function(){jQuery(this).attr("disabled","disabled"),jQuery(this).parent().append('<input type="hidden" name="'+jQuery(this).attr("name")+'" value="'+jQuery(this).val()+'" />'),jQuery(this).after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())});var b=0,c=["_width","_height","_sku","_length","_weight","product_length","_regular_price","_sale_price","_sale_price_dates_from","_sale_price_dates_to","_stock","_download_limit","_download_expiry"];for(b=0;b<c.length;b++)jQuery('input[name^="variable'+c[b]+'"]').each(function(){jQuery(this).attr("readonly","readonly"),jQuery(this).after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())});var d=["_enabled","_is_downloadable","_is_virtual","_manage_stock"];for(b=0;b<d.length;b++)jQuery('input[name^="variable'+d[b]+'"]').each(function(){jQuery(this).attr("disabled","disabled"),jQuery(this).after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())});var e=["_stock_status","_shipping_class","_tax_class"];for(b=0;b<e.length;b++)jQuery('select[name^="variable'+e[b]+'"]').each(function(){jQuery(this).attr("disabled","disabled"),jQuery(this).parent().append('<input type="hidden" name="'+jQuery(this).attr("name")+'" value="'+jQuery(this).val()+'" />'),jQuery(this).after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())});if(1==unlock_fields.file_paths){var f=["_wc_variation_file_names","_wc_variation_file_urls"];for(b=0;b<f.length;b++)jQuery('input[name^="'+f[b]+'"]').each(function(){jQuery(this).attr("readonly","readonly"),jQuery(this).after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())});var g=["upload_file_button","insert","delete"];for(b=0;b<g.length;b++)jQuery("."+g[b]).attr("disabled","disabled"),jQuery("."+g[b]).after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show().css("float","right"))}}};
1
+ jQuery(document).ready(function(a){var b,c=["_virtual","_downloadable","product-type","_backorders","_manage_stock","_stock","_stock_status","_sold_individually","comment_status","_tax_status","_tax_class","parent_id","crosssell_ids","upsell_ids","product_shipping_class"];for(1==unlock_fields.file_paths&&c.push("_download_type"),c=c.concat(non_standard_fields.ids),a(".wcml_prod_hidden_notice").prependTo("#woocommerce-product-data"),b=0;b<c.length;b++)a("#"+c[b]).attr("disabled","disabled"),a("#"+c[b]).after(a(".wcml_lock_img").clone().removeClass("wcml_lock_img").show());var d=["add_variation","link_all_variations","attribute_taxonomy","save_attributes","add_new_attribute","product_attributes .remove_row","add_attribute","select_all_attributes","select_no_attributes","edit-visibility"];for(d=d.concat(non_standard_fields.classes),1==unlock_fields.file_paths&&(d.push("upload_file_button"),d.push("insert"),d.push("delete"),a(".upload_file_button,.insert,.delete").bind({click:function(a){return!1}})),b=0;b<d.length;b++)a("."+d[b]).attr("disabled","disabled"),a("."+d[b]).after(a(".wcml_lock_img").clone().removeClass("wcml_lock_img").show());a("#visibility .edit-visibility span").bind({click:function(a){return!1}}),a(".remove_variation").each(function(){a(this).attr("disabled","disabled"),a(this).after(a(".wcml_lock_img").clone().removeClass("wcml_lock_img").show().css("float","right"))});var e=["_width","_height","_sku","_length","_weight","product_length","_regular_price","_sale_price","_sale_price_dates_from","_sale_price_dates_to"];for(1==unlock_fields.file_paths&&(e.push("_download_limit"),e.push("_download_expiry"),e.push("_wc_file_names[]"),e.push("_wc_file_urls[]")),e=e.concat(non_standard_fields.input_names),1==unlock_fields.menu_order&&e.push("menu_order"),b=0;b<e.length;b++)a('input[name="'+e[b]+'"]').attr("readonly","readonly"),a(".dimensions_field span.wrap").css("float","left"),("_width"==e[b]||"_height"==e[b]||"_length"==e[b])&&(a('input[name="'+e[b]+'"]').css("margin-right",0),a('input[name="'+e[b]+'"]').css("float","none"),a('input[name="'+e[b]+'"]').css("width","29%")),"_sale_price_dates_to"==e[b]?a('input[name="'+e[b]+'"]').after(a(".wcml_lock_img").clone().removeClass("wcml_lock_img").css("float","left").show()):a('input[name="'+e[b]+'"]').after(a(".wcml_lock_img").clone().removeClass("wcml_lock_img").show());a('#product_attributes td textarea,#product_attributes input[type="text"]').each(function(){a(this).attr("readonly","readonly"),a(this).after(a(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())}),a('#product_attributes input[type="checkbox"]').each(function(){a(this).attr("disabled","disabled"),a(this).after(a(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())}),a('form#post input[type="submit"]').click(function(){for(b=0;b<c.length;b++)a("#"+c[b]).removeAttr("disabled");a('.woocommerce_variation select,#variable_product_options .toolbar select,.woocommerce_variation input[type="checkbox"],#product_attributes input[type="checkbox"]').each(function(){a(this).removeAttr("disabled")})})});var wcml_lock_variation_fields=function(a){var b=jQuery(".woocommerce_variation>h3 select").attr("disabled");if("undefined"==typeof b||b===!1){jQuery(".woocommerce_variation>h3 select, #variable_product_options .toolbar select, .show_if_variation_manage_stock select").each(function(){jQuery(this).attr("disabled","disabled"),jQuery(this).parent().append('<input type="hidden" name="'+jQuery(this).attr("name")+'" value="'+jQuery(this).val()+'" />'),jQuery(this).after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())});var c=0,d=["_width","_height","_sku","_length","_weight","product_length","_regular_price","_sale_price","_sale_price_dates_from","_sale_price_dates_to","_stock","_download_limit","_download_expiry"];for(c=0;c<d.length;c++)jQuery('input[name^="variable'+d[c]+'"]').each(function(){jQuery(this).attr("readonly","readonly"),jQuery(this).after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())});var e=["_enabled","_is_downloadable","_is_virtual","_manage_stock"];for(c=0;c<e.length;c++)jQuery('input[name^="variable'+e[c]+'"]').each(function(){jQuery(this).attr("disabled","disabled"),jQuery(this).parent().append('<input type="hidden" name="'+jQuery(this).attr("name")+'" value="'+jQuery(this).val()+'" />'),jQuery(this).after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())});var f=["_stock_status","_shipping_class","_tax_class"];for(c=0;c<f.length;c++)jQuery('select[name^="variable'+f[c]+'"]').each(function(){jQuery(this).attr("disabled","disabled"),jQuery(this).parent().append('<input type="hidden" name="'+jQuery(this).attr("name")+'" value="'+jQuery(this).val()+'" />'),jQuery(this).after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show())});if(a)for(var g in a)1==a[g]&&(jQuery('input[name^="_wc_variation_file_names['+g+']"]').each(function(){jQuery(this).attr("readonly","readonly")}),jQuery('input[name^="_wc_variation_file_urls['+g+']"]').each(function(){jQuery(this).attr("readonly","readonly"),jQuery(this).closest("tr").find(".upload_file_button").attr("disabled","disabled"),jQuery(this).closest("tr").find(".delete").attr("disabled","disabled"),jQuery(this).closest("tr").find(".delete").after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show().css("float","right"))}),jQuery('input[name^="_wc_variation_file_urls['+g+']"]').closest("table").find(".insert").attr("disabled","disabled"),jQuery('input[name^="_wc_variation_file_urls['+g+']"]').closest("table").find(".insert").after(jQuery(".wcml_lock_img").clone().removeClass("wcml_lock_img").show().css("float","left")))}};
res/js/multi-currency.js CHANGED
@@ -26,19 +26,14 @@ jQuery( function($){
26
 
27
  WCML_Multi_Currency.setup_currencies_sorting();
28
 
29
- $(document).on('click','input[name="currency_switcher_style"]', WCML_Multi_Currency.update_currency_switcher_style);
30
-
31
- $(document).on('change','#wcml_curr_sel_orientation', WCML_Multi_Currency.set_currency_switcher_orientation);
32
-
33
- $(document).on('keyup','input[name="wcml_curr_template"]', WCML_Multi_Currency.setup_currency_switcher_template_keyup);
34
- $(document).on('change','input[name="wcml_curr_template"]', WCML_Multi_Currency.setup_currency_switcher_template_change);
35
-
36
  $(document).on('change','.currency_option_position', WCML_Multi_Currency.price_preview);
37
  $(document).on('change','.currency_option_thousand_sep', WCML_Multi_Currency.price_preview);
38
  $(document).on('change','.currency_option_decimal_sep', WCML_Multi_Currency.price_preview);
39
  $(document).on('change','.currency_option_decimals', WCML_Multi_Currency.price_preview);
40
  $(document).on('change','.currency_code select', WCML_Multi_Currency.price_preview);
41
 
 
 
42
  if($('#wcml_mc_options').length){
43
  WCML_Multi_Currency.wcml_mc_form_submitted = false;
44
  WCML_Multi_Currency.read_form_fields_status();
@@ -57,7 +52,6 @@ jQuery( function($){
57
  })
58
  }
59
 
60
-
61
  } );
62
 
63
  },
@@ -67,9 +61,9 @@ jQuery( function($){
67
  $('#multi_currency_independent').change(function(){
68
 
69
  if($(this).attr('checked') == 'checked'){
70
- $('#currency-switcher, #multi-currency-per-language-details, #online-exchange-rates').fadeIn();
71
  }else{
72
- $('#currency-switcher, #multi-currency-per-language-details, #online-exchange-rates').fadeOut();
73
  }
74
 
75
  })
@@ -132,8 +126,10 @@ jQuery( function($){
132
  $('#currency-lang-table').find('tr.default_currency select').each( function(){
133
  $(this).find("option[value='"+currency+"']").remove();
134
  });
 
 
 
135
 
136
- WCML_Multi_Currency.currency_switcher_preview();
137
 
138
  if( $('.wcml-row-currency').length == 1 ){
139
  $('#online-exchange-rates-no-currencies').next().hide();
@@ -153,11 +149,10 @@ jQuery( function($){
153
 
154
  var parent = $(this).closest('.wcml-dialog-container');
155
 
156
- var chk_rate = WCML_Multi_Currency.check_on_numeric(parent,'.ext_rate');
157
  var chk_deci = WCML_Multi_Currency.check_on_numeric(parent,'.currency_option_decimals');
158
  var chk_autosub = WCML_Multi_Currency.check_on_numeric(parent,'.abstract_amount');
159
 
160
- if(chk_rate || chk_deci || chk_autosub){
161
  return false;
162
  }
163
 
@@ -177,7 +172,9 @@ jQuery( function($){
177
  success: function(response){
178
  parent.find('.wcml-dialog-close-button').trigger('click');
179
 
180
- WCML_Multi_Currency.currency_switcher_preview();
 
 
181
 
182
  if( $('#currency_row_' + currency).length == 0 ) {
183
 
@@ -438,7 +435,6 @@ jQuery( function($){
438
 
439
  $('#wcml_currencies_order').sortable({
440
  update: function(){
441
- $('.wcml_currencies_order_ajx_resp').fadeIn();
442
  var currencies_order = [];
443
  $('#wcml_currencies_order').find('li').each(function(){
444
  currencies_order.push($(this).attr('cur'));
@@ -453,8 +449,12 @@ jQuery( function($){
453
  order: currencies_order.join(';')
454
  },
455
  success: function(resp){
456
- fadeInAjxResp('.wcml_currencies_order_ajx_resp', resp.message);
457
- WCML_Multi_Currency.currency_switcher_preview();
 
 
 
 
458
  }
459
  });
460
  }
@@ -462,57 +462,6 @@ jQuery( function($){
462
 
463
  },
464
 
465
- currency_switcher_preview: function (){
466
- var template = $('input[name="wcml_curr_template"]').val();
467
- if(!template){
468
- template = $('#currency_switcher_default').val();
469
- }
470
-
471
- var ajaxLoader = $('<span class="spinner" style="visibility: visible;">');
472
- $('#wcml_curr_sel_preview').html(ajaxLoader);
473
-
474
- $.ajax({
475
- type: "POST",
476
- url: ajaxurl,
477
- data: {
478
- action: 'wcml_currencies_switcher_preview',
479
- wcml_nonce: $('#wcml_currencies_switcher_preview_nonce').val(),
480
- switcher_type: $('input[name="currency_switcher_style"]:checked').val(),
481
- orientation: $('#wcml_curr_sel_orientation').val(),
482
- template: template
483
- },
484
- success: function(resp){
485
- $('#wcml_curr_sel_preview').html(resp);
486
- }
487
- });
488
- },
489
-
490
- update_currency_switcher_style: function(e){
491
-
492
- if( $(this).val() == 'list' ){
493
- $('#wcml_curr_sel_orientation_list_wrap').show();
494
- }else{
495
- $('#wcml_curr_sel_orientation_list_wrap').hide();
496
- }
497
- WCML_Multi_Currency.currency_switcher_preview();
498
- },
499
-
500
- set_currency_switcher_orientation: function(e){
501
- WCML_Multi_Currency.currency_switcher_preview();
502
- },
503
-
504
- setup_currency_switcher_template_keyup: function(e){
505
- discard = true;
506
- $(this).closest('.wcml-section').find('.button-wrap input').css("border-color","#1e8cbe");
507
- WCML_Multi_Currency.currency_switcher_preview();
508
- },
509
-
510
- setup_currency_switcher_template_change: function(e){
511
- if(!$(this).val()){
512
- $('input[name="wcml_curr_template"]').val($('#currency_switcher_default').val())
513
- }
514
- },
515
-
516
  price_preview: function(){
517
 
518
  var parent = $(this).closest('.wcml_currency_options');
@@ -560,8 +509,32 @@ jQuery( function($){
560
 
561
  form_fields_changed: function(){
562
  return this.mc_form_status != $('#wcml_mc_options').serialize();
563
- }
564
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
565
  }
566
 
567
 
26
 
27
  WCML_Multi_Currency.setup_currencies_sorting();
28
 
 
 
 
 
 
 
 
29
  $(document).on('change','.currency_option_position', WCML_Multi_Currency.price_preview);
30
  $(document).on('change','.currency_option_thousand_sep', WCML_Multi_Currency.price_preview);
31
  $(document).on('change','.currency_option_decimal_sep', WCML_Multi_Currency.price_preview);
32
  $(document).on('change','.currency_option_decimals', WCML_Multi_Currency.price_preview);
33
  $(document).on('change','.currency_code select', WCML_Multi_Currency.price_preview);
34
 
35
+ $(document).on('keyup','.wcml-exchange-rate', WCML_Multi_Currency.exchange_rate_check);
36
+
37
  if($('#wcml_mc_options').length){
38
  WCML_Multi_Currency.wcml_mc_form_submitted = false;
39
  WCML_Multi_Currency.read_form_fields_status();
52
  })
53
  }
54
 
 
55
  } );
56
 
57
  },
61
  $('#multi_currency_independent').change(function(){
62
 
63
  if($(this).attr('checked') == 'checked'){
64
+ $('#currency-switcher, #currency-switcher-widget, #currency-switcher-product, #multi-currency-per-language-details, #online-exchange-rates').fadeIn();
65
  }else{
66
+ $('#currency-switcher, #currency-switcher-widget, #currency-switcher-product, #multi-currency-per-language-details, #online-exchange-rates').fadeOut();
67
  }
68
 
69
  })
126
  $('#currency-lang-table').find('tr.default_currency select').each( function(){
127
  $(this).find("option[value='"+currency+"']").remove();
128
  });
129
+ $('.wcml-ui-dialog').each(function(){
130
+ WCML_Currency_Switcher_Settings.currency_switcher_preview( $(this) );
131
+ });
132
 
 
133
 
134
  if( $('.wcml-row-currency').length == 1 ){
135
  $('#online-exchange-rates-no-currencies').next().hide();
149
 
150
  var parent = $(this).closest('.wcml-dialog-container');
151
 
 
152
  var chk_deci = WCML_Multi_Currency.check_on_numeric(parent,'.currency_option_decimals');
153
  var chk_autosub = WCML_Multi_Currency.check_on_numeric(parent,'.abstract_amount');
154
 
155
+ if( chk_deci || chk_autosub ){
156
  return false;
157
  }
158
 
172
  success: function(response){
173
  parent.find('.wcml-dialog-close-button').trigger('click');
174
 
175
+ $('.wcml-ui-dialog').each(function(){
176
+ WCML_Currency_Switcher_Settings.currency_switcher_preview( $(this) );
177
+ });
178
 
179
  if( $('#currency_row_' + currency).length == 0 ) {
180
 
435
 
436
  $('#wcml_currencies_order').sortable({
437
  update: function(){
 
438
  var currencies_order = [];
439
  $('#wcml_currencies_order').find('li').each(function(){
440
  currencies_order.push($(this).attr('cur'));
449
  order: currencies_order.join(';')
450
  },
451
  success: function(resp){
452
+ if ( resp.success ) {
453
+ fadeInAjxResp('.wcml_currencies_order_ajx_resp', resp.data.message);
454
+ $('.wcml-ui-dialog').each(function(){
455
+ WCML_Currency_Switcher_Settings.currency_switcher_preview( $(this) );
456
+ });
457
+ }
458
  }
459
  });
460
  }
462
 
463
  },
464
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
465
  price_preview: function(){
466
 
467
  var parent = $(this).closest('.wcml_currency_options');
509
 
510
  form_fields_changed: function(){
511
  return this.mc_form_status != $('#wcml_mc_options').serialize();
512
+ },
513
 
514
+ exchange_rate_check: function( e ){
515
+
516
+ if (typeof KeyEvent == "undefined") {
517
+ var KeyEvent = {
518
+ DOM_SUBTRACT: 109,
519
+ DOM_DASH: 189,
520
+ DOM_E: 69
521
+ };
522
+ }
523
+
524
+ if(
525
+ $( this ).val() <= 0 ||
526
+ !WCML_Multi_Currency.is_number( $( this ).val() ) ||
527
+ e.keyCode == KeyEvent.DOM_SUBTRACT ||
528
+ e.keyCode == KeyEvent.DOM_DASH ||
529
+ e.keyCode == KeyEvent.DOM_E
530
+ ){
531
+ $('.wcml-co-set-rate .wcml-error').fadeIn();
532
+ $('.currency_options_save').attr( 'disabled', 'disabled' );
533
+ }else{
534
+ $('.wcml-co-set-rate .wcml-error').fadeOut();
535
+ $('.currency_options_save').removeAttr('disabled');
536
+ }
537
+ }
538
  }
539
 
540
 
res/js/multi-currency.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(a){WCML_Multi_Currency={_currency_languages_saving:0,init:function(){a(document).ready(function(){WCML_Multi_Currency.setup_multi_currency_toggle(),a(document).on("change",".currency_code select",WCML_Multi_Currency.select_currency),a(document).on("click",".delete_currency",WCML_Multi_Currency.delete_currency),a(document).on("click",".wcml_currency_options .currency_options_save",WCML_Multi_Currency.save_currency),a(document).on("click",".js-display-tooltip",WCML_Multi_Currency.tooltip),a(document).on("click",".currency_languages a.otgs-ico-no",WCML_Multi_Currency.enable_currency_for_language),a(document).on("click",".currency_languages a.otgs-ico-yes",WCML_Multi_Currency.disable_currency_for_language),a(document).on("change",".default_currency select",WCML_Multi_Currency.change_default_currency),WCML_Multi_Currency.setup_currencies_sorting(),a(document).on("click",'input[name="currency_switcher_style"]',WCML_Multi_Currency.update_currency_switcher_style),a(document).on("change","#wcml_curr_sel_orientation",WCML_Multi_Currency.set_currency_switcher_orientation),a(document).on("keyup",'input[name="wcml_curr_template"]',WCML_Multi_Currency.setup_currency_switcher_template_keyup),a(document).on("change",'input[name="wcml_curr_template"]',WCML_Multi_Currency.setup_currency_switcher_template_change),a(document).on("change",".currency_option_position",WCML_Multi_Currency.price_preview),a(document).on("change",".currency_option_thousand_sep",WCML_Multi_Currency.price_preview),a(document).on("change",".currency_option_decimal_sep",WCML_Multi_Currency.price_preview),a(document).on("change",".currency_option_decimals",WCML_Multi_Currency.price_preview),a(document).on("change",".currency_code select",WCML_Multi_Currency.price_preview),a("#wcml_mc_options").length&&(WCML_Multi_Currency.wcml_mc_form_submitted=!1,WCML_Multi_Currency.read_form_fields_status(),window.onbeforeunload=function(b){return!WCML_Multi_Currency.wcml_mc_form_submitted&&WCML_Multi_Currency.form_fields_changed()||WCML_Multi_Currency.is_update_currency_lang_in_progress()?a("#wcml_warn_message").val():void 0},a("#wcml_mc_options").on("submit",function(){WCML_Multi_Currency.wcml_mc_form_submitted=!0}))})},setup_multi_currency_toggle:function(){a("#multi_currency_independent").change(function(){"checked"==a(this).attr("checked")?a("#currency-switcher, #multi-currency-per-language-details, #online-exchange-rates").fadeIn():a("#currency-switcher, #multi-currency-per-language-details, #online-exchange-rates").fadeOut()})},select_currency:function(){var b=a(this).closest(".wcml_currency_options"),c=b.find(".wcml-dialog-close-button");c.attr("data-currency",a(this).val()),c.attr("data-symbol",a(this).find("option:selected").attr("data-symbol")),b.find(".this-currency").html(a(this).val())},delete_currency:function(b){b.preventDefault();var c=!1,d=a(this).data("currency"),e=a(this).data("currency_name"),f=a(this).data("currency_symbol");if(a(".currency_lang_table .wcml-row-currency-lang:first .currency_languages").each(function(){return WCML_Multi_Currency.check_currency_language(a(this).find("li").data("lang"),d)?void 0:(c=!0,!1)}),!c){a("#currency_row_"+d+" .currency_action_update").hide();var g=a('<span class="spinner" style="visibility: visible;margin:0;">');return a(this).hide(),a(this).parent().append(g).show(),a.ajax({type:"post",url:ajaxurl,data:{action:"wcml_delete_currency",wcml_nonce:a("#del_currency_nonce").val(),code:d},success:function(b){a("#currency_row_"+d).remove(),a("#currency_row_langs_"+d).remove(),a("#currency_row_del_"+d).remove(),a("#wcml_currencies_order .wcml_currencies_order_"+d).remove(),a("#wcml_currency_options_code_").prepend('<option data-symbol="'+f+'" value="'+d+'">'+e+"</option>"),a("#wcml_currency_options_code_").val(d).trigger("change"),a("#currency-lang-table").find("tr.default_currency select").each(function(){a(this).find("option[value='"+d+"']").remove()}),WCML_Multi_Currency.currency_switcher_preview(),1==a(".wcml-row-currency").length&&(a("#online-exchange-rates-no-currencies").next().hide(),a("#online-exchange-rates-no-currencies").show())},done:function(){g.remove()}}),!1}},save_currency:function(){var b=a(this).closest(".wcml-dialog-container"),c=WCML_Multi_Currency.check_on_numeric(b,".ext_rate"),d=WCML_Multi_Currency.check_on_numeric(b,".currency_option_decimals"),e=WCML_Multi_Currency.check_on_numeric(b,".abstract_amount");if(c||d||e)return!1;a(".wcml-currency-options-dialog :submit, .wcml-currency-options-dialog :button").prop("disabled",!0);var f=b.find('[name="currency_options[code]"]').val(),g=a('<span class="spinner" style="visibility:visible;position:absolute;margin-left:10px;"></span>');return g.show(),a(this).parent().prepend(g),a.ajax({url:ajaxurl,type:"POST",dataType:"json",data:b.find('[name^="currency_options"]').serialize()+"&action=wcml_save_currency&wcml_nonce="+jQuery("#wcml_save_currency_nonce").val(),success:function(c){if(b.find(".wcml-dialog-close-button").trigger("click"),WCML_Multi_Currency.currency_switcher_preview(),0==a("#currency_row_"+f).length){var d=a("#currency-table tr.wcml-row-currency:last").clone();d.attr("id","currency_row_"+f);var e=d.find(".wcml-col-edit a");e.attr("data-content","wcml_currency_options_"+f),e.attr("data-currency",f),e.data("dialog","wcml_currency_options_"+f),e.removeClass("hidden"),a("#currency-table").find("tr.default_currency").before(d);var d=a("#currency-lang-table tr.wcml-row-currency-lang:last").clone();d.attr("id","currency_row_langs_"+f),a("#currency-lang-table").find("tr.default_currency").before(d),d.find(".on a").each(function(){a(this).attr("data-currency",f)}),a("#currency-lang-table").find("tr.default_currency select").each(function(){a(this).append('<option value="'+f+'">'+f+"</option>")}),a("#wcml_currencies_order").append('<li class="wcml_currencies_order_'+f+' ui-sortable-handle" cur="'+f+'">'+c.currency_name_formatted+"</li>");var d=a("#currency-delete-table tr.wcml-row-currency-del:last").clone();d.attr("id","currency_row_del_"+f);var g=d.find(".delete_currency");g.removeClass("hidden"),g.attr("data-currency",f),g.attr("data-currency_name",c.currency_name),g.attr("data-currency_symbol",c.currency_symbol),a("#currency-delete-table").find("tr.default_currency").before(d)}a("#currency_row_"+f+" .wcml-col-currency").html(c.currency_name_formatted),a("#currency_row_"+f+" .wcml-col-rate").html(c.currency_meta_info),a("#wcml_currency_options_"+f).remove(),a("#wcml_mc_options").before(c.currency_options),a('#wcml_currency_options_code_ option[value="'+f+'"]').remove(),a("#online-exchange-rates-no-currencies").is(":visible")&&(a("#online-exchange-rates-no-currencies").hide(),a("#online-exchange-rates-no-currencies").next().show())}}),!1},check_on_numeric:function(b,c){var d=a('<span class="wcml-error">');return WCML_Multi_Currency.is_number(b.find(c).val())?(b.find(c).parent().find(".wcml-error").size()>0&&b.find(c).parent().find(".wcml-error").remove(),!1):(0==b.find(c).parent().find(".wcml-error").size()&&(b.find(c).parent().append(d),d.text(b.find(c).data("message"))),!0)},tooltip:function(){var b=a(this);a(".wp-pointer").fadeOut(100),a(this).pointer({content:"<h3>"+b.data("header")+"</h3><p>"+b.data("content")+"</p>",position:{edge:"left",align:"center",offset:"15 0"}}).pointer("open")},enable_currency_for_language:function(b){if(WCML_Multi_Currency.is_update_currency_lang_in_progress())return!1;b.preventDefault(),a(this).addClass("spinner").removeClass("otgs-ico-no").css("visibility","visible");a(this).closest("tr")[0].rowIndex;a('.default_currency select[rel="'+a(this).data("language")+'"]').append('<option value="'+a(this).data("currency")+'">'+a(this).data("currency")+"</option>"),WCML_Multi_Currency.update_currency_lang(a(this),1,0);var c=a(this).data("title-alt");a(this).data("title-alt",a(this).attr("title")),a(this).attr("title",c)},disable_currency_for_language:function(b){if(WCML_Multi_Currency.is_update_currency_lang_in_progress())return!1;b.preventDefault(),a(this).addClass("spinner").removeClass("otgs-ico-yes").css("visibility","visible");var c=a(this).data("language");if(!WCML_Multi_Currency.check_currency_language(c))return void a(this).removeClass("spinner").addClass("otgs-ico-yes");a(this).closest("tr")[0].rowIndex;a('.currency_languages select[rel="'+a(this).data("language")+'"]').val()==a(this).data("currency")?WCML_Multi_Currency.update_currency_lang(a(this),0,1):WCML_Multi_Currency.update_currency_lang(a(this),0,0),a('.default_currency select[rel="'+a(this).data("language")+'"] option[value="'+a(this).data("currency")+'"]').remove();var d=a(this).data("title-alt");a(this).data("title-alt",a(this).attr("title")),a(this).attr("title",d)},check_currency_language:function(b,c){var d=a('#currency-lang-table a.otgs-ico-yes[data-language="'+b+'"]');return c&&(d=a('#currency-lang-table a.otgs-ico-yes[data-language="'+b+'"]:not([data-currency="'+c+'"]')),0==d.length?(alert(a("#wcml_warn_disable_language_massage").val()),!1):!0},is_update_currency_lang_in_progress:function(){var a="undefined"!=typeof WCML_Multi_Currency._update_currency_lang_sync_flag&&1==WCML_Multi_Currency._update_currency_lang_sync_flag;return a},set_update_currency_lang_in_progress:function(a){WCML_Multi_Currency._update_currency_lang_sync_flag=a},update_currency_lang:function(b,c,d){WCML_Multi_Currency._currency_languages_saving++,a("#wcml_mc_options :submit").attr("disabled","disabled"),a('input[name="wcml_mc_options"]').attr("disabled","disabled");var e=b.data("language"),f=b.data("currency");discard=!0,WCML_Multi_Currency.set_update_currency_lang_in_progress(1),a.ajax({type:"post",url:ajaxurl,data:{action:"wcml_update_currency_lang",value:c,lang:e,code:f,wcml_nonce:a("#update_currency_lang_nonce").val()},success:function(){d&&WCML_Multi_Currency.update_default_currency(e,0)},complete:function(){a('input[name="wcml_mc_options"]').removeAttr("disabled"),discard=!1,b.removeClass("spinner").css("visibility","visible"),c?b.addClass("otgs-ico-yes"):b.addClass("otgs-ico-no"),WCML_Multi_Currency._currency_languages_saving--,0==WCML_Multi_Currency._currency_languages_saving&&a("#wcml_mc_options :submit").removeAttr("disabled"),WCML_Multi_Currency.set_update_currency_lang_in_progress(0)}})},change_default_currency:function(){WCML_Multi_Currency.update_default_currency(a(this).attr("rel"),a(this).val(),a(this))},update_default_currency:function(b,c,d){if(a("#wcml_mc_options_submit").attr("disabled","disabled"),d){var e=a('<span class="spinner" style="visibility: visible;float:none;position: absolute">');d.parent().append(e)}discard=!0,a.ajax({type:"post",url:ajaxurl,data:{action:"wcml_update_default_currency",lang:b,code:c,wcml_nonce:a("#wcml_update_default_currency_nonce").val()},complete:function(){discard=!1,a("#wcml_mc_options_submit").removeAttr("disabled"),d&&d.parent().find(".spinner").remove()}})},is_number:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},setup_currencies_sorting:function(){a("#wcml_currencies_order").sortable({update:function(){a(".wcml_currencies_order_ajx_resp").fadeIn();var b=[];a("#wcml_currencies_order").find("li").each(function(){b.push(a(this).attr("cur"))}),a.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"wcml_currencies_order",wcml_nonce:a("#wcml_currencies_order_order_nonce").val(),order:b.join(";")},success:function(a){fadeInAjxResp(".wcml_currencies_order_ajx_resp",a.message),WCML_Multi_Currency.currency_switcher_preview()}})}})},currency_switcher_preview:function(){var b=a('input[name="wcml_curr_template"]').val();b||(b=a("#currency_switcher_default").val());var c=a('<span class="spinner" style="visibility: visible;">');a("#wcml_curr_sel_preview").html(c),a.ajax({type:"POST",url:ajaxurl,data:{action:"wcml_currencies_switcher_preview",wcml_nonce:a("#wcml_currencies_switcher_preview_nonce").val(),switcher_type:a('input[name="currency_switcher_style"]:checked').val(),orientation:a("#wcml_curr_sel_orientation").val(),template:b},success:function(b){a("#wcml_curr_sel_preview").html(b)}})},update_currency_switcher_style:function(b){"list"==a(this).val()?a("#wcml_curr_sel_orientation_list_wrap").show():a("#wcml_curr_sel_orientation_list_wrap").hide(),WCML_Multi_Currency.currency_switcher_preview()},set_currency_switcher_orientation:function(a){WCML_Multi_Currency.currency_switcher_preview()},setup_currency_switcher_template_keyup:function(b){discard=!0,a(this).closest(".wcml-section").find(".button-wrap input").css("border-color","#1e8cbe"),WCML_Multi_Currency.currency_switcher_preview()},setup_currency_switcher_template_change:function(b){a(this).val()||a('input[name="wcml_curr_template"]').val(a("#currency_switcher_default").val())},price_preview:function(){var b=a(this).closest(".wcml_currency_options"),c=b.find(".currency_option_position").val(),d=b.find(".currency_option_thousand_sep").val(),d=b.find(".currency_option_thousand_sep").val(),e=b.find(".currency_option_decimal_sep").val(),f=a(this).closest(".wcml_currency_options").find(".wcml-dialog-close-button").attr("data-symbol"),g="56789".substr(0,b.find(".currency_option_decimals").val());""==g&&(e="");var h="";switch(c){case"left":h="{symbol}1{thousand_sep}234{decimal_sep}{decimals}";break;case"right":h="1{thousand_sep}234{decimal_sep}{decimals}{symbol}";break;case"left_space":h="{symbol}&nbsp;1{thousand_sep}234{decimal_sep}{decimals}";break;case"right_space":h="1{thousand_sep}234{decimal_sep}{decimals}&nbsp;{symbol}"}var i=h.replace(/\{symbol\}/,f).replace(/\{thousand_sep\}/,d).replace(/\{decimal_sep\}/,e).replace(/\{decimals\}/,g);return b.find(".wcml-co-preview-value").html(i),!1},read_form_fields_status:function(){this.mc_form_status=a("#wcml_mc_options").serialize()},form_fields_changed:function(){return this.mc_form_status!=a("#wcml_mc_options").serialize()}},WCML_Multi_Currency.init()});
1
+ jQuery(function(a){WCML_Multi_Currency={_currency_languages_saving:0,init:function(){a(document).ready(function(){WCML_Multi_Currency.setup_multi_currency_toggle(),a(document).on("change",".currency_code select",WCML_Multi_Currency.select_currency),a(document).on("click",".delete_currency",WCML_Multi_Currency.delete_currency),a(document).on("click",".wcml_currency_options .currency_options_save",WCML_Multi_Currency.save_currency),a(document).on("click",".js-display-tooltip",WCML_Multi_Currency.tooltip),a(document).on("click",".currency_languages a.otgs-ico-no",WCML_Multi_Currency.enable_currency_for_language),a(document).on("click",".currency_languages a.otgs-ico-yes",WCML_Multi_Currency.disable_currency_for_language),a(document).on("change",".default_currency select",WCML_Multi_Currency.change_default_currency),WCML_Multi_Currency.setup_currencies_sorting(),a(document).on("change",".currency_option_position",WCML_Multi_Currency.price_preview),a(document).on("change",".currency_option_thousand_sep",WCML_Multi_Currency.price_preview),a(document).on("change",".currency_option_decimal_sep",WCML_Multi_Currency.price_preview),a(document).on("change",".currency_option_decimals",WCML_Multi_Currency.price_preview),a(document).on("change",".currency_code select",WCML_Multi_Currency.price_preview),a(document).on("keyup",".wcml-exchange-rate",WCML_Multi_Currency.exchange_rate_check),a("#wcml_mc_options").length&&(WCML_Multi_Currency.wcml_mc_form_submitted=!1,WCML_Multi_Currency.read_form_fields_status(),window.onbeforeunload=function(b){return!WCML_Multi_Currency.wcml_mc_form_submitted&&WCML_Multi_Currency.form_fields_changed()||WCML_Multi_Currency.is_update_currency_lang_in_progress()?a("#wcml_warn_message").val():void 0},a("#wcml_mc_options").on("submit",function(){WCML_Multi_Currency.wcml_mc_form_submitted=!0}))})},setup_multi_currency_toggle:function(){a("#multi_currency_independent").change(function(){"checked"==a(this).attr("checked")?a("#currency-switcher, #currency-switcher-widget, #currency-switcher-product, #multi-currency-per-language-details, #online-exchange-rates").fadeIn():a("#currency-switcher, #currency-switcher-widget, #currency-switcher-product, #multi-currency-per-language-details, #online-exchange-rates").fadeOut()})},select_currency:function(){var b=a(this).closest(".wcml_currency_options"),c=b.find(".wcml-dialog-close-button");c.attr("data-currency",a(this).val()),c.attr("data-symbol",a(this).find("option:selected").attr("data-symbol")),b.find(".this-currency").html(a(this).val())},delete_currency:function(b){b.preventDefault();var c=!1,d=a(this).data("currency"),e=a(this).data("currency_name"),f=a(this).data("currency_symbol");if(a(".currency_lang_table .wcml-row-currency-lang:first .currency_languages").each(function(){return WCML_Multi_Currency.check_currency_language(a(this).find("li").data("lang"),d)?void 0:(c=!0,!1)}),!c){a("#currency_row_"+d+" .currency_action_update").hide();var g=a('<span class="spinner" style="visibility: visible;margin:0;">');return a(this).hide(),a(this).parent().append(g).show(),a.ajax({type:"post",url:ajaxurl,data:{action:"wcml_delete_currency",wcml_nonce:a("#del_currency_nonce").val(),code:d},success:function(b){a("#currency_row_"+d).remove(),a("#currency_row_langs_"+d).remove(),a("#currency_row_del_"+d).remove(),a("#wcml_currencies_order .wcml_currencies_order_"+d).remove(),a("#wcml_currency_options_code_").prepend('<option data-symbol="'+f+'" value="'+d+'">'+e+"</option>"),a("#wcml_currency_options_code_").val(d).trigger("change"),a("#currency-lang-table").find("tr.default_currency select").each(function(){a(this).find("option[value='"+d+"']").remove()}),a(".wcml-ui-dialog").each(function(){WCML_Currency_Switcher_Settings.currency_switcher_preview(a(this))}),1==a(".wcml-row-currency").length&&(a("#online-exchange-rates-no-currencies").next().hide(),a("#online-exchange-rates-no-currencies").show())},done:function(){g.remove()}}),!1}},save_currency:function(){var b=a(this).closest(".wcml-dialog-container"),c=WCML_Multi_Currency.check_on_numeric(b,".currency_option_decimals"),d=WCML_Multi_Currency.check_on_numeric(b,".abstract_amount");if(c||d)return!1;a(".wcml-currency-options-dialog :submit, .wcml-currency-options-dialog :button").prop("disabled",!0);var e=b.find('[name="currency_options[code]"]').val(),f=a('<span class="spinner" style="visibility:visible;position:absolute;margin-left:10px;"></span>');return f.show(),a(this).parent().prepend(f),a.ajax({url:ajaxurl,type:"POST",dataType:"json",data:b.find('[name^="currency_options"]').serialize()+"&action=wcml_save_currency&wcml_nonce="+jQuery("#wcml_save_currency_nonce").val(),success:function(c){if(b.find(".wcml-dialog-close-button").trigger("click"),a(".wcml-ui-dialog").each(function(){WCML_Currency_Switcher_Settings.currency_switcher_preview(a(this))}),0==a("#currency_row_"+e).length){var d=a("#currency-table tr.wcml-row-currency:last").clone();d.attr("id","currency_row_"+e);var f=d.find(".wcml-col-edit a");f.attr("data-content","wcml_currency_options_"+e),f.attr("data-currency",e),f.data("dialog","wcml_currency_options_"+e),f.removeClass("hidden"),a("#currency-table").find("tr.default_currency").before(d);var d=a("#currency-lang-table tr.wcml-row-currency-lang:last").clone();d.attr("id","currency_row_langs_"+e),a("#currency-lang-table").find("tr.default_currency").before(d),d.find(".on a").each(function(){a(this).attr("data-currency",e)}),a("#currency-lang-table").find("tr.default_currency select").each(function(){a(this).append('<option value="'+e+'">'+e+"</option>")}),a("#wcml_currencies_order").append('<li class="wcml_currencies_order_'+e+' ui-sortable-handle" cur="'+e+'">'+c.currency_name_formatted+"</li>");var d=a("#currency-delete-table tr.wcml-row-currency-del:last").clone();d.attr("id","currency_row_del_"+e);var g=d.find(".delete_currency");g.removeClass("hidden"),g.attr("data-currency",e),g.attr("data-currency_name",c.currency_name),g.attr("data-currency_symbol",c.currency_symbol),a("#currency-delete-table").find("tr.default_currency").before(d)}a("#currency_row_"+e+" .wcml-col-currency").html(c.currency_name_formatted),a("#currency_row_"+e+" .wcml-col-rate").html(c.currency_meta_info),a("#wcml_currency_options_"+e).remove(),a("#wcml_mc_options").before(c.currency_options),a('#wcml_currency_options_code_ option[value="'+e+'"]').remove(),a("#online-exchange-rates-no-currencies").is(":visible")&&(a("#online-exchange-rates-no-currencies").hide(),a("#online-exchange-rates-no-currencies").next().show())}}),!1},check_on_numeric:function(b,c){var d=a('<span class="wcml-error">');return WCML_Multi_Currency.is_number(b.find(c).val())?(b.find(c).parent().find(".wcml-error").size()>0&&b.find(c).parent().find(".wcml-error").remove(),!1):(0==b.find(c).parent().find(".wcml-error").size()&&(b.find(c).parent().append(d),d.text(b.find(c).data("message"))),!0)},tooltip:function(){var b=a(this);a(".wp-pointer").fadeOut(100),a(this).pointer({content:"<h3>"+b.data("header")+"</h3><p>"+b.data("content")+"</p>",position:{edge:"left",align:"center",offset:"15 0"}}).pointer("open")},enable_currency_for_language:function(b){if(WCML_Multi_Currency.is_update_currency_lang_in_progress())return!1;b.preventDefault(),a(this).addClass("spinner").removeClass("otgs-ico-no").css("visibility","visible");a(this).closest("tr")[0].rowIndex;a('.default_currency select[rel="'+a(this).data("language")+'"]').append('<option value="'+a(this).data("currency")+'">'+a(this).data("currency")+"</option>"),WCML_Multi_Currency.update_currency_lang(a(this),1,0);var c=a(this).data("title-alt");a(this).data("title-alt",a(this).attr("title")),a(this).attr("title",c)},disable_currency_for_language:function(b){if(WCML_Multi_Currency.is_update_currency_lang_in_progress())return!1;b.preventDefault(),a(this).addClass("spinner").removeClass("otgs-ico-yes").css("visibility","visible");var c=a(this).data("language");if(!WCML_Multi_Currency.check_currency_language(c))return void a(this).removeClass("spinner").addClass("otgs-ico-yes");a(this).closest("tr")[0].rowIndex;a('.currency_languages select[rel="'+a(this).data("language")+'"]').val()==a(this).data("currency")?WCML_Multi_Currency.update_currency_lang(a(this),0,1):WCML_Multi_Currency.update_currency_lang(a(this),0,0),a('.default_currency select[rel="'+a(this).data("language")+'"] option[value="'+a(this).data("currency")+'"]').remove();var d=a(this).data("title-alt");a(this).data("title-alt",a(this).attr("title")),a(this).attr("title",d)},check_currency_language:function(b,c){var d=a('#currency-lang-table a.otgs-ico-yes[data-language="'+b+'"]');return c&&(d=a('#currency-lang-table a.otgs-ico-yes[data-language="'+b+'"]:not([data-currency="'+c+'"]')),0==d.length?(alert(a("#wcml_warn_disable_language_massage").val()),!1):!0},is_update_currency_lang_in_progress:function(){var a="undefined"!=typeof WCML_Multi_Currency._update_currency_lang_sync_flag&&1==WCML_Multi_Currency._update_currency_lang_sync_flag;return a},set_update_currency_lang_in_progress:function(a){WCML_Multi_Currency._update_currency_lang_sync_flag=a},update_currency_lang:function(b,c,d){WCML_Multi_Currency._currency_languages_saving++,a("#wcml_mc_options :submit").attr("disabled","disabled"),a('input[name="wcml_mc_options"]').attr("disabled","disabled");var e=b.data("language"),f=b.data("currency");discard=!0,WCML_Multi_Currency.set_update_currency_lang_in_progress(1),a.ajax({type:"post",url:ajaxurl,data:{action:"wcml_update_currency_lang",value:c,lang:e,code:f,wcml_nonce:a("#update_currency_lang_nonce").val()},success:function(){d&&WCML_Multi_Currency.update_default_currency(e,0)},complete:function(){a('input[name="wcml_mc_options"]').removeAttr("disabled"),discard=!1,b.removeClass("spinner").css("visibility","visible"),c?b.addClass("otgs-ico-yes"):b.addClass("otgs-ico-no"),WCML_Multi_Currency._currency_languages_saving--,0==WCML_Multi_Currency._currency_languages_saving&&a("#wcml_mc_options :submit").removeAttr("disabled"),WCML_Multi_Currency.set_update_currency_lang_in_progress(0)}})},change_default_currency:function(){WCML_Multi_Currency.update_default_currency(a(this).attr("rel"),a(this).val(),a(this))},update_default_currency:function(b,c,d){if(a("#wcml_mc_options_submit").attr("disabled","disabled"),d){var e=a('<span class="spinner" style="visibility: visible;float:none;position: absolute">');d.parent().append(e)}discard=!0,a.ajax({type:"post",url:ajaxurl,data:{action:"wcml_update_default_currency",lang:b,code:c,wcml_nonce:a("#wcml_update_default_currency_nonce").val()},complete:function(){discard=!1,a("#wcml_mc_options_submit").removeAttr("disabled"),d&&d.parent().find(".spinner").remove()}})},is_number:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},setup_currencies_sorting:function(){a("#wcml_currencies_order").sortable({update:function(){var b=[];a("#wcml_currencies_order").find("li").each(function(){b.push(a(this).attr("cur"))}),a.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"wcml_currencies_order",wcml_nonce:a("#wcml_currencies_order_order_nonce").val(),order:b.join(";")},success:function(b){fadeInAjxResp(".wcml_currencies_order_ajx_resp",b.message),a(".wcml-ui-dialog").each(function(){WCML_Currency_Switcher_Settings.currency_switcher_preview(a(this))})}})}})},price_preview:function(){var b=a(this).closest(".wcml_currency_options"),c=b.find(".currency_option_position").val(),d=b.find(".currency_option_thousand_sep").val(),d=b.find(".currency_option_thousand_sep").val(),e=b.find(".currency_option_decimal_sep").val(),f=a(this).closest(".wcml_currency_options").find(".wcml-dialog-close-button").attr("data-symbol"),g="56789".substr(0,b.find(".currency_option_decimals").val());""==g&&(e="");var h="";switch(c){case"left":h="{symbol}1{thousand_sep}234{decimal_sep}{decimals}";break;case"right":h="1{thousand_sep}234{decimal_sep}{decimals}{symbol}";break;case"left_space":h="{symbol}&nbsp;1{thousand_sep}234{decimal_sep}{decimals}";break;case"right_space":h="1{thousand_sep}234{decimal_sep}{decimals}&nbsp;{symbol}"}var i=h.replace(/\{symbol\}/,f).replace(/\{thousand_sep\}/,d).replace(/\{decimal_sep\}/,e).replace(/\{decimals\}/,g);return b.find(".wcml-co-preview-value").html(i),!1},read_form_fields_status:function(){this.mc_form_status=a("#wcml_mc_options").serialize()},form_fields_changed:function(){return this.mc_form_status!=a("#wcml_mc_options").serialize()},exchange_rate_check:function(b){if("undefined"==typeof c)var c={DOM_SUBTRACT:109,DOM_DASH:189,DOM_E:69};a(this).val()<=0||!WCML_Multi_Currency.is_number(a(this).val())||b.keyCode==c.DOM_SUBTRACT||b.keyCode==c.DOM_DASH||b.keyCode==c.DOM_E?(a(".wcml-co-set-rate .wcml-error").fadeIn(),a(".currency_options_save").attr("disabled","disabled")):(a(".wcml-co-set-rate .wcml-error").fadeOut(),a(".currency_options_save").removeAttr("disabled"))}},WCML_Multi_Currency.init()});
res/js/wcml-multi-currency.js CHANGED
@@ -1,13 +1,13 @@
1
  jQuery(document).ready(function(){
2
 
3
- jQuery(document).on( 'change', '.wcml_currency_switcher', function(){
4
- wcml_load_currency( jQuery(this).val() );
5
- });
6
-
7
- jQuery(document).on( 'click', '.wcml_currency_switcher li', function(){
8
- if(jQuery(this).hasClass('wcml-active-currency')){
9
- return;
10
  }
 
11
  wcml_load_currency( jQuery(this).attr('rel') );
12
  });
13
 
@@ -16,10 +16,8 @@ jQuery(document).ready(function(){
16
  }
17
  });
18
 
19
-
20
  function wcml_load_currency( currency, force_switch ){
21
  var ajax_loader = jQuery('<img style=\"margin-left:10px;\" width=\"16\" heigth=\"16\" src=\"' + wcml_mc_settings.wcml_spinner +'\" />')
22
- jQuery('.wcml_currency_switcher').attr('disabled', 'disabled');
23
  jQuery('.wcml_currency_switcher').after();
24
  ajax_loader.insertAfter(jQuery('.wcml_currency_switcher'));
25
 
@@ -41,7 +39,6 @@ function wcml_load_currency( currency, force_switch ){
41
  }else if( typeof response.prevent_switching !== 'undefined' ){
42
  jQuery('body').append( response.prevent_switching );
43
  }else{
44
- jQuery('.wcml_currency_switcher').removeAttr('disabled');
45
  if(typeof wcml_mc_settings.w3tc !== 'undefined'){
46
  var original_url = window.location.href;
47
  original_url = original_url.replace(/&wcmlc(\=[^&]*)?(?=&|$)|wcmlc(\=[^&]*)?(&|$)/, '');
1
  jQuery(document).ready(function(){
2
 
3
+ jQuery(document).on( 'click', '.wcml_currency_switcher a', function( event ){
4
+ event.preventDefault();
5
+ if( jQuery(this).is(':disabled') || jQuery(this).parent().hasClass('wcml-cs-active-currency') || jQuery(this).hasClass('wcml-cs-active-currency')){
6
+ return false;
7
+ }else{
8
+ jQuery( this ).off( event );
 
9
  }
10
+
11
  wcml_load_currency( jQuery(this).attr('rel') );
12
  });
13
 
16
  }
17
  });
18
 
 
19
  function wcml_load_currency( currency, force_switch ){
20
  var ajax_loader = jQuery('<img style=\"margin-left:10px;\" width=\"16\" heigth=\"16\" src=\"' + wcml_mc_settings.wcml_spinner +'\" />')
 
21
  jQuery('.wcml_currency_switcher').after();
22
  ajax_loader.insertAfter(jQuery('.wcml_currency_switcher'));
23
 
39
  }else if( typeof response.prevent_switching !== 'undefined' ){
40
  jQuery('body').append( response.prevent_switching );
41
  }else{
 
42
  if(typeof wcml_mc_settings.w3tc !== 'undefined'){
43
  var original_url = window.location.href;
44
  original_url = original_url.replace(/&wcmlc(\=[^&]*)?(?=&|$)|wcmlc(\=[^&]*)?(&|$)/, '');
res/js/wcml-multi-currency.min.js CHANGED
@@ -1 +1 @@
1
- function wcml_load_currency(a,b){var c=jQuery('<img style="margin-left:10px;" width="16" heigth="16" src="'+wcml_mc_settings.wcml_spinner+'" />');jQuery(".wcml_currency_switcher").attr("disabled","disabled"),jQuery(".wcml_currency_switcher").after(),c.insertAfter(jQuery(".wcml_currency_switcher")),"undefined"==typeof b&&(b=0),jQuery.ajax({type:"post",url:woocommerce_params.ajax_url,dataType:"json",data:{action:"wcml_switch_currency",currency:a,force_switch:b,wcml_nonce:wcml_mc_settings.wcml_mc_nonce},success:function(b){if("undefined"!=typeof b.error)alert(b.error);else if("undefined"!=typeof b.prevent_switching)jQuery("body").append(b.prevent_switching);else{if(jQuery(".wcml_currency_switcher").removeAttr("disabled"),"undefined"!=typeof wcml_mc_settings.w3tc){var c=window.location.href;c=c.replace(/&wcmlc(\=[^&]*)?(?=&|$)|wcmlc(\=[^&]*)?(&|$)/,""),c=c.replace(/\?$/,"");var d=-1!=c.indexOf("?")?"&":"?",e=c+d+"wcmlc="+a}else var e=window.location.href;window.location=e}}})}jQuery(document).ready(function(){jQuery(document).on("change",".wcml_currency_switcher",function(){wcml_load_currency(jQuery(this).val())}),jQuery(document).on("click",".wcml_currency_switcher li",function(){jQuery(this).hasClass("wcml-active-currency")||wcml_load_currency(jQuery(this).attr("rel"))}),"undefined"!=typeof woocommerce_price_slider_params&&(woocommerce_price_slider_params.currency_symbol=wcml_mc_settings.current_currency.symbol)});
1
+ function wcml_load_currency(a,b){var c=jQuery('<img style="margin-left:10px;" width="16" heigth="16" src="'+wcml_mc_settings.wcml_spinner+'" />');jQuery(".wcml_currency_switcher").after(),c.insertAfter(jQuery(".wcml_currency_switcher")),"undefined"==typeof b&&(b=0),jQuery.ajax({type:"post",url:woocommerce_params.ajax_url,dataType:"json",data:{action:"wcml_switch_currency",currency:a,force_switch:b,wcml_nonce:wcml_mc_settings.wcml_mc_nonce},success:function(b){if("undefined"!=typeof b.error)alert(b.error);else if("undefined"!=typeof b.prevent_switching)jQuery("body").append(b.prevent_switching);else{if("undefined"!=typeof wcml_mc_settings.w3tc){var c=window.location.href;c=c.replace(/&wcmlc(\=[^&]*)?(?=&|$)|wcmlc(\=[^&]*)?(&|$)/,""),c=c.replace(/\?$/,"");var d=-1!=c.indexOf("?")?"&":"?",e=c+d+"wcmlc="+a}else var e=window.location.href;window.location=e}}})}jQuery(document).ready(function(){jQuery(document).on("click",".wcml_currency_switcher a",function(a){return a.preventDefault(),jQuery(this).is(":disabled")||jQuery(this).parent().hasClass("wcml-cs-active-currency")||jQuery(this).hasClass("wcml-cs-active-currency")?!1:(jQuery(this).off(a),void wcml_load_currency(jQuery(this).attr("rel")))}),"undefined"!=typeof woocommerce_price_slider_params&&(woocommerce_price_slider_params.currency_symbol=wcml_mc_settings.current_currency.symbol)});
res/js/widgets.js ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($){
2
+ $(document).on('widget-added', function (e, widget) {
3
+ var button = widget.find('.wcml-cs-widgets-edit-link');
4
+
5
+ if (button.length > 0) {
6
+ var sidebar_slug = widget.closest('.widgets-sortables').attr('id'),
7
+ link = button.attr('href');
8
+
9
+ if ('#currency-switcher/' === link.slice(-19)) {
10
+ button.attr('href', link + sidebar_slug);
11
+ }
12
+ }
13
+ });
14
+ });
15
+
res/js/widgets.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(a){a(document).on("widget-added",function(a,b){var c=b.find(".wcml-cs-widgets-edit-link");if(c.length>0){var d=b.closest(".widgets-sortables").attr("id"),e=c.attr("href");"#currency-switcher/"===e.slice(-19)&&c.attr("href",e+d)}})});
res/scss/currency-switcher.scss CHANGED
@@ -1,10 +1,6 @@
1
  @import "mixins";
2
  @import "variables";
3
 
4
- .wcml-active-currency {
5
- background-color: #E5E5E5;
6
- }
7
-
8
  ul.wcml_currency_switcher {
9
  padding: 0 !important;
10
  margin: 0 !important;
@@ -34,6 +30,41 @@ ul.wcml_currency_switcher {
34
  margin: 0;
35
  }
36
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
  .exchange-rates-online-wrap,
39
  .service-details-wrap {
1
  @import "mixins";
2
  @import "variables";
3
 
 
 
 
 
4
  ul.wcml_currency_switcher {
5
  padding: 0 !important;
6
  margin: 0 !important;
30
  margin: 0;
31
  }
32
  }
33
+ ul.dropdown.wcml_currency_switcher{
34
+ position: relative;
35
+ padding: 0;
36
+ margin: 0 !important;
37
+ list-style-type: none;
38
+ li span{
39
+ position: relative;
40
+ padding-right: calc(10px + .7em + .7em);
41
+ display: block;
42
+ padding: 5px 10px;
43
+ line-height: 1;
44
+ }
45
+ li span:after {
46
+ content: '';
47
+ vertical-align: middle;
48
+ display: inline-block;
49
+ border: .35em solid transparent;
50
+ border-top: .5em solid;
51
+ position: absolute;
52
+ right: 10px;
53
+ top: calc(50% - .175em);
54
+ }
55
+ ul.wcml-cs-submenu{
56
+ visibility: hidden;
57
+ position: absolute;
58
+ top: 100%;
59
+ right: 0;
60
+ left: 0;
61
+ border-top: 1px solid #cdcdcd;
62
+ padding: 0;
63
+ margin: 0;
64
+ list-style-type: none;
65
+ z-index: 101;
66
+ }
67
+ }
68
 
69
  .exchange-rates-online-wrap,
70
  .service-details-wrap {
res/scss/management.scss CHANGED
@@ -5,6 +5,10 @@
5
  opacity: 0.5;
6
  }
7
 
 
 
 
 
8
  .wcml-wrap {
9
  @extend %wpml-wrap;
10
  margin-bottom: 20px;
@@ -65,12 +69,23 @@
65
  margin: 0 0 $margin-sm 0;
66
  border-bottom: 1px solid #ededed;
67
  min-width: 900px;
68
- overflow: hidden;
 
 
 
 
69
  &:last-of-type {
70
  border: none;
71
  margin: 0;
72
  }
73
  }
 
 
 
 
 
 
 
74
 
75
  .wcml-section-content .wcml-section-content-inner:not(:last-child) {
76
  margin: 0 0 20px 0;
@@ -230,6 +245,8 @@ table.widefat.currency_delete_table {
230
  }
231
  }
232
 
 
 
233
  .currency_value .wcml-error,
234
  .wcml-error {
235
  font-size: 10px;
@@ -379,7 +396,9 @@ table.widefat.currency_lang_table {
379
  }
380
  }
381
 
382
- /* Currency switcher*/
 
 
383
 
384
  #wcml_currencies_order {
385
  display: block;
@@ -397,27 +416,165 @@ table.widefat.currency_lang_table {
397
  }
398
 
399
  .wcml_currencies_order_ajx_resp {
400
- padding-top: 5px;
401
- color: #E68A00;
402
- }
 
 
 
 
 
 
403
 
404
- .explanation-text {
405
- color: #999;
406
  }
407
 
408
- input[name="wcml_curr_template"] {
 
409
  width: 100%;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
410
  }
411
 
412
- .wcml_curr_style label {
413
- line-height: 30px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
414
  }
415
 
416
- .wcml-currency-preview {
417
- margin: $margin-sm 0 $margin-base;
418
- display: inline-block;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
419
  }
420
 
 
 
 
 
421
  .wcml_product_name {
422
  line-height: 20px;
423
  }
5
  opacity: 0.5;
6
  }
7
 
8
+ .display-block {
9
+ display:block;
10
+ }
11
+
12
  .wcml-wrap {
13
  @extend %wpml-wrap;
14
  margin-bottom: 20px;
69
  margin: 0 0 $margin-sm 0;
70
  border-bottom: 1px solid #ededed;
71
  min-width: 900px;
72
+ &:after {
73
+ content: '';
74
+ display: table;
75
+ clear: both;
76
+ }
77
  &:last-of-type {
78
  border: none;
79
  margin: 0;
80
  }
81
  }
82
+ .explanation-text {
83
+ color: #999;
84
+ h4+& {
85
+ margin-top: -1.1em;
86
+ margin-bottom: 1.33em;
87
+ }
88
+ }
89
 
90
  .wcml-section-content .wcml-section-content-inner:not(:last-child) {
91
  margin: 0 0 20px 0;
245
  }
246
  }
247
 
248
+
249
+
250
  .currency_value .wcml-error,
251
  .wcml-error {
252
  font-size: 10px;
396
  }
397
  }
398
 
399
+ /* ==================================================
400
+ Currency switcher
401
+ =====================================================*/
402
 
403
  #wcml_currencies_order {
404
  display: block;
416
  }
417
 
418
  .wcml_currencies_order_ajx_resp {
419
+ font-weight: 500;
420
+ margin: 0 5px;
421
+ padding: 1px 4px 2px;
422
+ border-radius: 3px;
423
+ white-space: nowrap;
424
+
425
+ //success
426
+ color: #46b450;
427
+ background-color: rgba(92, 255, 102, 0.15);
428
 
 
 
429
  }
430
 
431
+ .wcml-cs-list {
432
+ font-size: inherit;
433
  width: 100%;
434
+ border-collapse: collapse;
435
+ border: lightgrey 1px solid;
436
+ vertical-align: middle;
437
+ thead tr {
438
+ border: lightgrey 1px solid;
439
+ }
440
+ th, td {
441
+ text-align: center;
442
+ padding: 5px;
443
+ }
444
+
445
+ .wcml-cs-cell-preview {
446
+ text-align: start;
447
+ }
448
+
449
+ .wcml-cs-actions {
450
+ width: 60px;
451
+ a {
452
+ display: inline-block;
453
+ width: 20px;
454
+ cursor: pointer;
455
+ }
456
+ }
457
  }
458
 
459
+
460
+ .wcml-currency-preview-wrapper {
461
+ background-color: #fff;
462
+ padding: 15px 10px 10px;
463
+ border: 1px solid #ccc;
464
+ width: 100%;
465
+ min-width: 150px;
466
+ min-height: 120px;
467
+ box-sizing: border-box;
468
+ position: relative;
469
+ display: flex !important;
470
+ align-items: center;
471
+ justify-content: center;
472
+
473
+ .wcml-currency-preview-label {
474
+ position: absolute;
475
+ top: 5px;
476
+ left: 10px;
477
+ z-index: 101;
478
+ display: inline-block;
479
+ padding: 2px;
480
+ background: rgba(255, 255, 255, .9);
481
+ }
482
+ .spinner {
483
+ position: absolute;
484
+ bottom: 5px;
485
+ right: 0;
486
+ z-index: 101;
487
+ }
488
+ }
489
+
490
+ /**************************
491
+ Currency switcher dialog
492
+ **************************/
493
+
494
+ .wcml-cs-dialog .wcml-currency-switcher-options-form {
495
+ input {
496
+ max-width: 100%;
497
+ }
498
+ @media (min-width: 1000px) {
499
+ display: flex;
500
+ flex-wrap: wrap;
501
+ align-items: flex-start;
502
+ .wcml-currency-switcher-options {
503
+ width: 60%;
504
+ order: 1;
505
+ box-sizing: border-box;
506
+ & > h4:first-child {
507
+ margin-top: 0;
508
+ }
509
+ }
510
+ .wcml-currency-preview-wrapper {
511
+ width: 40%;
512
+ box-sizing: border-box;
513
+ order: 2;
514
+ & > div {
515
+ display: block;
516
+ }
517
+ }
518
+ }
519
+ @media (max-width: 999px) {
520
+ .wcml-currency-preview-wrapper {
521
+ margin: -17px -15px 30px -15px;
522
+ width: calc(100% + 2 * 15px);
523
+ border-left: 0;
524
+ border-right: 0;
525
+ z-index: 10;
526
+ }
527
+ }
528
  }
529
 
530
+ .wcml-cs-panel-colors {
531
+ table {
532
+ width: 100%;
533
+ max-width: 600px;
534
+ font-size: inherit;
535
+ th {
536
+ text-align: start;
537
+ }
538
+ td {
539
+ vertical-align: top;
540
+ }
541
+ }
542
+
543
+ .wp-color-result {
544
+ padding-left: 50px;
545
+ position: relative;
546
+ @media screen and (max-width: 782px) {
547
+ height: 22px;
548
+ }
549
+ &:after {
550
+ background: transparent;
551
+ border-radius: 0;
552
+ border-left: 0;
553
+ padding: 0;
554
+ right: 0;
555
+ left: 0;
556
+ position: absolute;
557
+ content: '';
558
+ }
559
+ &.wp-picker-open:after {
560
+ content: '';
561
+ }
562
+ &:not(.wp-picker-open):after {
563
+ font-family: otgs-icons;
564
+ // otgs-ico-edit
565
+ content: 'h';
566
+ color: #333;
567
+ text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.4);
568
+ font-size: 16px;
569
+ min-width: 0;
570
+ }
571
+ }
572
  }
573
 
574
+ /*==========================================================
575
+ End of Currency
576
+ ====================================================*/
577
+
578
  .wcml_product_name {
579
  line-height: 20px;
580
  }
templates/currency-switchers/legacy-dropdown-click/config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ {
2
+ "name" : "Dropdown click",
3
+ "slug" : "wcml-dropdown-click"
4
+ }
templates/currency-switchers/legacy-dropdown-click/script.js ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*jshint browser:true, devel:true */
2
+ /*global document */
3
+
4
+ var WCMLCurrecnySwitcherDropdownClick = (function() {
5
+ "use strict";
6
+
7
+ var wrapperSelector = '.js-wcml-dropdown-click';
8
+ var submenuSelector = '.js-wcml-dropdown-click-submenu';
9
+ var isOpen = false;
10
+
11
+ var toggle = function(event) {
12
+ var subMenu = this.querySelectorAll(submenuSelector)[0];
13
+
14
+ if(subMenu.style.visibility === 'visible'){
15
+ subMenu.style.visibility = 'hidden';
16
+ document.removeEventListener('click', close);
17
+ }else{
18
+ subMenu.style.visibility = 'visible';
19
+ document.addEventListener('click', close);
20
+ isOpen = true;
21
+ }
22
+
23
+ return false;
24
+ };
25
+
26
+ var close = function(){
27
+
28
+ if(!isOpen){
29
+ var switchers = document.querySelectorAll(wrapperSelector);
30
+
31
+ for(var i=0;i<switchers.length;i++){
32
+ var altLangs = switchers[i].querySelectorAll(submenuSelector)[0];
33
+ altLangs.style.visibility = 'hidden';
34
+ }
35
+ }
36
+
37
+ isOpen = false;
38
+ };
39
+
40
+ var preventDefault = function(e) {
41
+ var evt = e ? e : window.event;
42
+
43
+ if (evt.preventDefault) {
44
+ evt.preventDefault();
45
+ }
46
+
47
+ evt.returnValue = false;
48
+ };
49
+
50
+ var init = function() {
51
+ var wrappers = document.querySelectorAll(wrapperSelector);
52
+
53
+ for(var i=0; i < wrappers.length; i++ ) {
54
+ wrappers[i].addEventListener('click', toggle );
55
+ }
56
+ var links = document.querySelectorAll(wrapperSelector + ' .js-wcml-dropdown-click-toggle');
57
+ for(var j=0; j < links.length; j++) {
58
+ links[j].addEventListener('click', preventDefault );
59
+ }
60
+
61
+ };
62
+ return {
63
+
64
+ 'init': init
65
+ };
66
+
67
+ })();
68
+
69
+ document.addEventListener('DOMContentLoaded', function(){
70
+ "use strict";
71
+ WCMLCurrecnySwitcherDropdownClick.init();
72
+ });
templates/currency-switchers/legacy-dropdown-click/style.css ADDED
@@ -0,0 +1 @@
 
1
+ .wcml-dropdown-click{width:15.5em;max-width:100%}.wcml-dropdown-click>ul{position:relative;padding:0;margin:0 !important;list-style-type:none}.wcml-dropdown-click li{list-style-type:none;padding:0;margin:0;border:1px solid #cdcdcd;background-color:#fff}.wcml-dropdown-click li:hover,.wcml-dropdown-click li:focus{background-color:#f5f5f5}.wcml-dropdown-click a{display:block;text-decoration:none;padding:.5em .5em .4em;line-height:1;box-shadow:none !important;cursor:pointer}.wcml-dropdown-click a:hover{box-shadow:none !important;text-decoration:none}.wcml-dropdown-click a.wcml-cs-item-toggle{position:relative;padding-right:calc(10px + .7em + .7em)}.rtl .wcml-dropdown-click a.wcml-cs-item-toggle{padding-right:10px;padding-left:calc(10px + .7em + .7em)}.wcml-dropdown-click a.wcml-cs-item-toggle:after{content:'';vertical-align:middle;display:inline-block;border:.35em solid transparent;border-top:.5em solid;position:absolute;right:10px;top:calc(50% - .175em)}.rtl .wcml-dropdown-click a.wcml-cs-item-toggle:after{right:auto;left:10px}.wcml-dropdown-click .wcml-cs-submenu{visibility:hidden;position:absolute;top:100%;right:0;left:0;border-top:1px solid #cdcdcd;padding:0;margin:0 !important;list-style-type:none;z-index:101}.wcml-dropdown-click .wcml-cs-submenu li{padding:0;margin:0;border:solid #cdcdcd;border-width:0 1px 1px 1px}.woocommerce .wcml-dropdown-click.product{margin:1em 0}.widget .wcml-dropdown-click ul li{padding:0}.widget .wcml-dropdown-click ul li a{box-shadow:none}.widget .wcml-dropdown-click ul li a:hover{box-shadow:none;text-decoration:none}
templates/currency-switchers/legacy-dropdown-click/style.scss ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wcml-dropdown-click {
2
+ width: 15.5em;
3
+ max-width: 100%;
4
+ & > ul {
5
+ position: relative;
6
+ padding: 0;
7
+ margin: 0 !important;
8
+ list-style-type: none;
9
+ }
10
+
11
+ li {
12
+ list-style-type: none;
13
+ padding: 0;
14
+ margin: 0;
15
+ border: 1px solid #cdcdcd;
16
+ background-color: #fff;
17
+ &:hover, &:focus {
18
+ background-color: #f5f5f5;
19
+ }
20
+ }
21
+ a {
22
+ display: block;
23
+ text-decoration: none;
24
+ padding: .5em .5em .4em;
25
+ line-height: 1;
26
+ box-shadow: none !important;
27
+ cursor: pointer;
28
+ &:hover {
29
+ box-shadow: none !important;
30
+ text-decoration: none;
31
+ }
32
+
33
+ &.wcml-cs-item-toggle {
34
+ position: relative;
35
+ padding-right: calc(10px + .7em + .7em);
36
+ .rtl & {
37
+ padding-right: 10px;
38
+ padding-left: calc(10px + .7em + .7em);
39
+ }
40
+ &:after {
41
+ content: '';
42
+ vertical-align: middle;
43
+ display: inline-block;
44
+ border: .35em solid transparent;
45
+ border-top: .5em solid;
46
+ position: absolute;
47
+ right: 10px;
48
+ top: calc(50% - .175em);
49
+ .rtl & {
50
+ right: auto;
51
+ left: 10px;
52
+ }
53
+ }
54
+ }
55
+ }
56
+
57
+ .wcml-cs-submenu {
58
+ visibility: hidden;
59
+ position: absolute;
60
+ top: 100%;
61
+ right: 0;
62
+ left: 0;
63
+ border-top: 1px solid #cdcdcd;
64
+ padding: 0;
65
+ margin: 0 !important;
66
+ list-style-type: none;
67
+ z-index: 101;
68
+ li {
69
+ padding: 0;
70
+ margin: 0;
71
+ border: solid #cdcdcd;
72
+ border-width: 0 1px 1px 1px;
73
+ }
74
+ }
75
+
76
+ .woocommerce &.product {
77
+ margin: 1em 0;
78
+ }
79
+ .widget & {
80
+ ul li {
81
+ padding: 0;
82
+ a {
83
+ box-shadow: none;
84
+ &:hover {
85
+ box-shadow: none;
86
+ text-decoration: none;
87
+ }
88
+ }
89
+ }
90
+ }
91
+ }
templates/currency-switchers/legacy-dropdown-click/template.twig ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="{{ css_classes }} js-wcml-dropdown-click" >
2
+ <ul>
3
+ <li class="wcml-cs-active-currency" >
4
+ <a class="js-wcml-dropdown-click-toggle wcml-cs-item-toggle">{{ get_formatted_price( selected_currency, format )|raw }}</a>
5
+ <ul class="wcml-cs-submenu js-wcml-dropdown-click-submenu">
6
+ {% for currency in currencies %}
7
+ {% if currency != selected_currency %}
8
+ <li>
9
+ <a rel="{{ currency }}">{{ get_formatted_price( currency, format )|raw }}</a>
10
+ </li>
11
+ {% endif %}
12
+ {% endfor %}
13
+ </ul>
14
+ </li>
15
+ </ul>
16
+ </div>
templates/currency-switchers/legacy-dropdown/config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ {
2
+ "name" : "Dropdown",
3
+ "slug" : "wcml-dropdown"
4
+ }
templates/currency-switchers/legacy-dropdown/style.css ADDED
@@ -0,0 +1 @@
 
1
+ .wcml-dropdown{width:15.5em;max-width:100%}.wcml-dropdown>ul{position:relative;padding:0;margin:0 !important;list-style-type:none}.wcml-dropdown li{list-style-type:none;padding:0;margin:0;border:1px solid #cdcdcd;background-color:#fff}.wcml-dropdown li:hover,.wcml-dropdown li:focus{background-color:#f5f5f5}.wcml-dropdown li:hover.wcml-cs-active-currency .wcml-cs-submenu,.wcml-dropdown li:focus.wcml-cs-active-currency .wcml-cs-submenu{visibility:visible}.wcml-dropdown a{display:block;text-decoration:none;padding:.5em .5em .4em;line-height:1;box-shadow:none !important;cursor:pointer}.wcml-dropdown a:hover{box-shadow:none !important;text-decoration:none}.wcml-dropdown a.wcml-cs-item-toggle{position:relative;padding-right:calc(10px + .7em + .7em)}.rtl .wcml-dropdown a.wcml-cs-item-toggle{padding-right:10px;padding-left:calc(10px + .7em + .7em)}.wcml-dropdown a.wcml-cs-item-toggle:after{content:'';vertical-align:middle;display:inline-block;border:.35em solid transparent;border-top:.5em solid;position:absolute;right:10px;top:calc(50% - .175em)}.rtl .wcml-dropdown a.wcml-cs-item-toggle:after{right:auto;left:10px}.wcml-dropdown .wcml-cs-submenu{visibility:hidden;position:absolute;top:100%;right:0;left:0;border-top:1px solid #cdcdcd;padding:0;margin:0 !important;list-style-type:none;z-index:101}.wcml-dropdown .wcml-cs-submenu li{padding:0;margin:0;border:solid #cdcdcd;border-width:0 1px 1px 1px}.woocommerce .wcml-dropdown.product{margin:1em 0}.widget .wcml-dropdown ul li{padding:0}.widget .wcml-dropdown ul li a{box-shadow:none}.widget .wcml-dropdown ul li a:hover{box-shadow:none;text-decoration:none}
templates/currency-switchers/legacy-dropdown/style.scss ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wcml-dropdown {
2
+ width: 15.5em;
3
+ max-width: 100%;
4
+ & > ul {
5
+ position: relative;
6
+ padding: 0;
7
+ margin: 0 !important;
8
+ list-style-type: none;
9
+ }
10
+ li {
11
+ list-style-type: none;
12
+ padding: 0;
13
+ margin: 0;
14
+ border: 1px solid #cdcdcd;
15
+ background-color: #fff;
16
+ &:hover, &:focus {
17
+ background-color: #f5f5f5;
18
+ &.wcml-cs-active-currency {
19
+ .wcml-cs-submenu {
20
+ visibility: visible;
21
+ }
22
+ }
23
+ }
24
+ }
25
+ a {
26
+ display: block;
27
+ text-decoration: none;
28
+ padding: .5em .5em .4em;
29
+ line-height: 1;
30
+ box-shadow: none !important;
31
+ cursor: pointer;
32
+ &:hover {
33
+ box-shadow: none !important;
34
+ text-decoration: none;
35
+ }
36
+ &.wcml-cs-item-toggle {
37
+ position: relative;
38
+ padding-right: calc(10px + .7em + .7em);
39
+ .rtl & {
40
+ padding-right: 10px;
41
+ padding-left: calc(10px + .7em + .7em);
42
+ }
43
+ &:after {
44
+ content: '';
45
+ vertical-align: middle;
46
+ display: inline-block;
47
+ border: .35em solid transparent;
48
+ border-top: .5em solid;
49
+ position: absolute;
50
+ right: 10px;
51
+ top: calc(50% - .175em);
52
+ .rtl & {
53
+ right: auto;
54
+ left: 10px;
55
+ }
56
+ }
57
+ }
58
+ }
59
+
60
+ .wcml-cs-submenu {
61
+ visibility: hidden;
62
+ position: absolute;
63
+ top: 100%;
64
+ right: 0;
65
+ left: 0;
66
+ border-top: 1px solid #cdcdcd;
67
+ padding: 0;
68
+ margin: 0 !important;
69
+ list-style-type: none;
70
+ z-index: 101;
71
+ li {
72
+ padding: 0;
73
+ margin: 0;
74
+ border: solid #cdcdcd;
75
+ border-width: 0 1px 1px 1px;
76
+ }
77
+ }
78
+
79
+ .woocommerce &.product {
80
+ margin: 1em 0;
81
+ }
82
+ .widget & {
83
+ ul li {
84
+ padding: 0;
85
+ a {
86
+ box-shadow: none;
87
+ &:hover {
88
+ box-shadow: none;
89
+ text-decoration: none;
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
templates/currency-switchers/legacy-dropdown/template.twig ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="{{ css_classes }}" >
2
+ <ul>
3
+ <li class="wcml-cs-active-currency" >
4
+ <a class="wcml-cs-item-toggle">{{ get_formatted_price( selected_currency, format )|raw }}</a>
5
+ <ul class="wcml-cs-submenu">
6
+ {% for currency in currencies %}
7
+ {% if currency != selected_currency %}
8
+ <li>
9
+ <a rel="{{ currency }}">{{ get_formatted_price( currency, format )|raw }}</a>
10
+ </li>
11
+ {% endif %}
12
+ {% endfor %}
13
+ </ul>
14
+ </li>
15
+ </ul>
16
+ </div>
templates/currency-switchers/legacy-list-horizontal/config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ {
2
+ "name" : "Horizontal List",
3
+ "slug" : "wcml-horizontal-list"
4
+ }
templates/currency-switchers/legacy-list-horizontal/style.css ADDED
@@ -0,0 +1 @@
 
1
+ .wcml-horizontal-list{border:1px solid transparent;clear:both}.wcml-horizontal-list>ul{padding:0;margin:0 !important;list-style-type:none}.wcml-horizontal-list li{list-style-type:none;display:inline-block}.wcml-horizontal-list li a{display:block;text-decoration:none;padding:.5em .5em .4em;line-height:1;cursor:pointer;box-shadow:none;border-bottom:none}.wcml-currency-preview-wrapper .wcml-horizontal-list li{margin-bottom:0}.woocommerce .wcml-horizontal-list.product{margin:1em 0}
templates/currency-switchers/legacy-list-horizontal/style.scss ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wcml-horizontal-list {
2
+ border: 1px solid transparent;
3
+ clear: both;
4
+ & > ul {
5
+ padding: 0;
6
+ margin: 0 !important;
7
+ list-style-type: none;
8
+ }
9
+ li {
10
+ list-style-type: none;
11
+ display: inline-block;
12
+
13
+ a {
14
+ display: block;
15
+ text-decoration: none;
16
+ padding: .5em .5em .4em;
17
+ line-height: 1;
18
+ cursor: pointer;
19
+ box-shadow: none;
20
+ border-bottom: none;
21
+ }
22
+ }
23
+ .wcml-currency-preview-wrapper & {
24
+ li {
25
+ margin-bottom: 0;
26
+ }
27
+ }
28
+
29
+ .woocommerce &.product {
30
+ margin: 1em 0;
31
+ }
32
+ }
33
+
templates/currency-switchers/legacy-list-horizontal/template.twig ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <div class="{{ css_classes }}" >
2
+ <ul>
3
+ {% for currency in currencies %}
4
+ <li {% if( currency == selected_currency) %} class="wcml-cs-active-currency" {% endif %} >
5
+ <a rel="{{ currency }}">{{ get_formatted_price( currency, format )|raw }}</a>
6
+ </li>
7
+ {% endfor %}
8
+ </ul>
9
+ </div>
templates/currency-switchers/legacy-list-vertical/config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ {
2
+ "name" : "Vertical List",
3
+ "slug" : "wcml-vertical-list"
4
+ }
templates/currency-switchers/legacy-list-vertical/style.css ADDED
@@ -0,0 +1 @@
 
1
+ .wcml-vertical-list{max-width:100%;border:1px solid transparent;border-bottom:0;clear:both}.wcml-vertical-list>ul{padding:0;margin:0 !important;list-style-type:none}.wcml-vertical-list li{list-style-type:none;border-bottom:1px solid transparent}.wcml-vertical-list li a{display:block;text-decoration:none;padding:.5em .5em .4em;line-height:1;cursor:pointer;box-shadow:none;border-bottom:none}.wcml-currency-preview-wrapper .wcml-vertical-list li{margin-bottom:0}.woocommerce .wcml-vertical-list.product{margin:1em 0}
templates/currency-switchers/legacy-list-vertical/style.scss ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wcml-vertical-list {
2
+ max-width: 100%;
3
+ border: 1px solid transparent;
4
+ border-bottom: 0;
5
+ clear: both;
6
+ & > ul {
7
+ padding: 0;
8
+ margin: 0 !important;
9
+ list-style-type: none;
10
+ }
11
+ li {
12
+ list-style-type: none;
13
+ border-bottom: 1px solid transparent;
14
+ a {
15
+ display: block;
16
+ text-decoration: none;
17
+ padding: .5em .5em .4em;
18
+ line-height: 1;
19
+ cursor: pointer;
20
+ box-shadow: none;
21
+ border-bottom: none;
22
+ }
23
+ }
24
+ .wcml-currency-preview-wrapper & {
25
+ li {
26
+ margin-bottom: 0;
27
+ }
28
+ }
29
+
30
+ .woocommerce &.product {
31
+ margin: 1em 0;
32
+ }
33
+ }
templates/currency-switchers/legacy-list-vertical/template.twig ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <div class="{{ css_classes }}" >
2
+ <ul>
3
+ {% for currency in currencies %}
4
+ <li {% if( currency == selected_currency) %} class="wcml-cs-active-currency" {% endif %} >
5
+ <a rel="{{ currency }}">{{ get_formatted_price( currency, format )|raw }}</a>
6
+ </li>
7
+ {% endfor %}
8
+ </ul>
9
+ </div>
templates/multi-currency/currency-switcher-options-dialog.twig ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wcml-dialog hidden" id="wcml_currency_switcher_options_{{ args.currency_switcher }}" title="{{ args.title }}">
2
+
3
+ <div id="wcml_currency_switcher_options_form_{{ args.currency_switcher }}" class="wcml-currency-switcher-options-form">
4
+
5
+ <div id="wcml_curr_sel_preview_wrap" class="wcml-currency-preview-wrapper">
6
+ <strong class="wcml-currency-preview-label">{{ form.preview }}</strong>
7
+ <input type="hidden" id="wcml_currencies_switcher_preview_nonce" value="{{ form.preview_nonce }}"/>
8
+ <div id="wcml_curr_sel_preview" class="wcml-currency-preview {{ args.currency_switcher }}">
9
+ {{ form.switcher_preview|raw }}
10
+ </div>
11
+ </div>
12
+
13
+ <div id="wcml_curr_options_wrap" class="wcml-currency-switcher-options">
14
+ {% if args.currency_switcher == 'new_widget' %}
15
+
16
+ <h4>{{ form.widgets.widget_area }}</h4>
17
+ <select id="wcml-cs-widget">
18
+ <option selected disabled>{{ form.widgets.choose_label }}</option>
19
+ {% for sidebar in form.widgets.available_sidebars %}
20
+ <option value="{{ sidebar['id'] }}">{{ sidebar['name'] }}</option>
21
+ {% endfor %}
22
+ </select>
23
+
24
+ {% endif %}
25
+
26
+ <h4>{{ form.switcher_style.label }}</h4>
27
+ <ul class="wcml_curr_style">
28
+ <li>
29
+ <label>
30
+ <select id="currency_switcher_style">
31
+ <optgroup label="{{ form.switcher_style.core }}">
32
+ {% for switcher_template_id,switcher_template in args.switcher_templates['core'] %}
33
+ <option value="{{ switcher_template_id }}" {% if( args.switcher_style == switcher_template_id) %}selected="selected"{% endif %}>{{ switcher_template['name'] }}</option>
34
+ {% endfor %}
35
+ </optgroup>
36
+ <optgroup label="{{ form.switcher_style.custom }}">
37
+ {% for switcher_template_id,switcher_template in args.switcher_templates['custom'] %}
38
+ <option value="{{ switcher_template_id }}" {% if( args.switcher_style == switcher_template_id) %}selected="selected"{% endif %}>{{ switcher_template['name'] }}</option>
39
+ {% endfor %}
40
+ </optgroup>
41
+ </select>
42
+ </label>
43
+ </li>
44
+ </ul>
45
+
46
+ <h4>{{ form.template.label }}</h4>
47
+ <input type="text" name="wcml_curr_template" size="50" value="{{ args.template }}"/>
48
+ <p class="explanation-text">
49
+ <span class="display-block">{{ form.template.template_tip }}</span>
50
+ <span class="display-block">{{ form.template.parameters }}: {{ form.template.parameters_list }}</span>
51
+ <span class="display-block js-toggle-cs-style" {% if(args.style != 'list') %}style="display: none;"{% endif %}>{{ form.switcher_style.allowed_tags }}</span>
52
+ </p>
53
+ <input type="hidden" id="currency_switcher_default" value="{{ args.template_default }}"/>
54
+
55
+ {% if args.currency_switcher != 'product' %}
56
+ <h4>{{ form.widgets.widget_title }}</h4>
57
+ <input type="text" name="wcml_cs_widget_title" size="50" value="{{ args.widget_title }}"/>
58
+ {% endif %}
59
+
60
+ <div class="js-wcml-cs-panel-colors wcml-cs-panel-colors">
61
+ <h4>{{ form.colors.label }}</h4>
62
+
63
+ <label for="wcml-cs-{{ id }}-colorpicker-preset">{{ form.colors.theme }}</label>
64
+ <select name="wcml-cs-{{ id }}-colorpicker-preset" class="js-wcml-cs-colorpicker-preset">
65
+ <option selected disabled>-- {{ form.colors.select_option_choose }} --</option>
66
+ {% for scheme_id, scheme in color_schemes %}
67
+ <option value="{{ scheme_id }}">{{ scheme.label }}</option>
68
+ {% endfor %}
69
+ </select>
70
+
71
+ <div>
72
+ <table>
73
+ <tr>
74
+ <td>
75
+ </td>
76
+ <th>{{ form.colors.normal }}</th>
77
+ <th>{{ form.colors.hover }}</th>
78
+ </tr>
79
+ {% for option_id, option in options %}
80
+ <tr>
81
+ <td>{{ option }}</td>
82
+ {% if args.options[ option_id ~ '_normal' ] is not null %}
83
+ <td class="js-wcml-cs-colorpicker-wrapper">
84
+ <input class="js-wcml-cs-colorpicker js-wcml-cs-color-{{ option_id }}_normal" type="text" size="7"
85
+ id="wcml-cs-{{ option_id }}-normal" name="{{ option_id }}_normal"
86
+ value="{{ args.options[ option_id ~ '_normal' ] }}" style="">
87
+ </td>
88
+ {% endif %}
89
+ {% if args.options[ option_id ~ '_hover' ] is not null %}
90
+ <td class="js-wcml-cs-colorpicker-wrapper">
91
+ <input class="js-wcml-cs-colorpicker js-wcml-cs-color-{{ option_id }}_hover" type="text" size="7"
92
+ id="wcml-cs-{{ option_id }}-hover" name="{{ option_id }}_hover"
93
+ value="{{ args.options[ option_id ~ '_hover' ] }}" style="">
94
+ </td>
95
+ {% endif %}
96
+ </tr>
97
+ {% endfor %}
98
+ </table>
99
+
100
+ </div>
101
+ </div>
102
+ </div>
103
+
104
+ </div>
105
+ <footer class="wpml-dialog-footer">
106
+ <input type="button" class="cancel wcml-dialog-close-button wpml-dialog-close-button alignleft" value="{{ form.cancel }}"/>&nbsp;
107
+ <input type="submit" class="wcml-dialog-close-button wpml-dialog-close-button button-primary currency_switcher_save alignright"
108
+ value="{{ form.save }}" data-switcher="{{ args.current_switcher }}" data-stay="1" />
109
+ <input type="hidden" id="wcml_currencies_switcher_save_settings_nonce" value="{{ form.save_settings_nonce }}"/>
110
+ <input type="hidden" id="wcml_currencies_switcher_id" value="{{ args.currency_switcher }}"/>
111
+ </footer>
112
+
113
+ </div>
114
+
templates/multi-currency/currency-switcher-options.twig CHANGED
@@ -1,84 +1,160 @@
1
  <div class="wcml-section" id="currency-switcher" {% if multi_currency_on is empty %}style="display:none"{% endif %}>
 
 
 
 
2
 
 
3
 
4
- <div class="wcml-section-header">
5
- <h3>{{ currency_switcher.headers.main }}</h3>
 
 
 
 
 
 
 
 
 
 
6
  </div>
7
 
8
- <div class="wcml-section-content">
9
-
10
- <div id="wcml_curr_sel_preview_wrap" class="wcml-section-content-inner text-center">
11
- <p><strong>{{ currency_switcher.preview_text}}</strong></p>
12
- <input type="hidden" id="wcml_currencies_switcher_preview_nonce" value="{{ currency_switcher.preview_nonce }}"/>
13
- <div id="wcml_curr_sel_preview" class="wcml-currency-preview">
14
- {{ currency_switcher.preview|raw }}
15
- </div>
16
- </div>
17
-
18
-
19
- <div class="wcml-section-content-inner">
20
- <h4>{{ currency_switcher.headers.style }}</h4>
21
- <ul class="wcml_curr_style">
22
- <li>
23
- <label for="wcml_curr_sel_stype">
24
- <input type="radio" name="currency_switcher_style" value="dropdown"
25
- {% if(currency_switcher.style is empty or currency_switcher.style == 'dropdown') %}checked="checked"{% endif %} />
26
- {{ currency_switcher.options.dropdown }}
27
- </label>
28
- </li>
29
- <li>
30
- <label for="wcml_curr_sel_orientation">
31
- <input type="radio" name="currency_switcher_style" value="list" {% if(currency_switcher.style == 'list') %}checked="checked"{% endif %} />
32
- {{ currency_switcher.options.list }}
33
- </label>
34
- <span id="wcml_curr_sel_orientation_list_wrap" {% if(currency_switcher.style != 'list') %}style="display: none;"{% endif %}>
35
- <select id="wcml_curr_sel_orientation" name="wcml_curr_sel_orientation">
36
- <option value="vertical">{{ currency_switcher.options.vertical }}</option>
37
- <option value="horizontal" {% if(currency_switcher.orientation == 'horizontal') %}selected="selected"{% endif %}>{{ currency_switcher.options.horizontal }}</option>
38
- </select>
39
- <p class="explanation-text">{{ currency_switcher.options.allowed_tags }}</p>
40
- </span>
41
- </li>
42
- </ul>
43
- </div>
44
-
45
-
46
- <div class="wcml-section-content-inner">
47
- <h4>{{ currency_switcher.headers.order }}</h4>
48
 
49
- <ul id="wcml_currencies_order">
50
- {% for code in currency_switcher.order %}
51
- <li class="wcml_currencies_order_{{ code }}" cur="{{ code }}">{{ attribute(wc_currencies, code) }} ({{ get_currency_symbol(code)|raw }})</li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  {% endfor %}
53
- </ul>
54
- <span style="display:none;" class="wcml_currencies_order_ajx_resp"></span>
55
- <input type="hidden" id="wcml_currencies_order_order_nonce" value="{{ currency_switcher.order_nonce }}"/>
56
-
57
- <p class="explanation-text">{{ currency_switcher.order_tip }}</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  </div>
 
 
 
 
59
 
60
- <div class="wcml-section-content-inner">
61
- <h4>{{ currency_switcher.headers.parameters }}</h4>
62
- <span class="explanation-text">{{ currency_switcher.headers.parameters_list }}</span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
 
64
- <h4>{{ currency_switcher.headers.template }}</h4>
65
- <input type="text" name="wcml_curr_template" value="{{ currency_switcher.template }}"/>
66
- <span class="explanation-text">{{ currency_switcher.template_tip }}</span>
67
- <input type="hidden" id="currency_switcher_default" value="{{ currency_switcher.template_default }}"/>
 
 
 
 
 
 
 
 
 
68
  </div>
69
-
70
- <div class="wcml-section-content-inner">
71
- <h4>{{ currency_switcher.headers.visibility }}</h4>
72
- <ul class="wcml_curr_visibility">
73
- <li>
74
- <label>
75
- <input type="checkbox" name="currency_switcher_product_visibility" value="1" {%if currency_switcher.visibility_on%}checked="checked"{% endif %}>
76
- {{ currency_switcher.visibility_label }}
77
- </label>
78
- </li>
79
- </ul>
80
- </div>
81
-
82
  </div>
83
-
84
- </div>
1
  <div class="wcml-section" id="currency-switcher" {% if multi_currency_on is empty %}style="display:none"{% endif %}>
2
+ <div class="wcml-section-header">
3
+ <h3>{{ currency_switcher.headers.main }}</h3>
4
+ <p>{{ currency_switcher.headers.main_desc }}</p>
5
+ </div>
6
 
7
+ <div class="wcml-section-content">
8
 
9
+ <div class="wcml-section-content-inner">
10
+ <h4>
11
+ {{ currency_switcher.headers.order }}
12
+ <span style="display:none;" class="wcml_currencies_order_ajx_resp"></span>
13
+ </h4>
14
+ <p class="explanation-text">{{ currency_switcher.order_tip }}</p>
15
+ <ul id="wcml_currencies_order" class="wcml-cs-currencies-order">
16
+ {% for code in currency_switcher.order %}
17
+ <li class="wcml_currencies_order_{{ code }}" cur="{{ code }}">{{ attribute( wc_currencies, code) }} ({{ get_currency_symbol(code)|raw }})</li>
18
+ {% endfor %}
19
+ </ul>
20
+ <input type="hidden" id="wcml_currencies_order_order_nonce" value="{{ currency_switcher.order_nonce }}"/>
21
  </div>
22
 
23
+ <div class="wcml-section-content-inner">
24
+ <h4>{{ currency_switcher.headers.additional_css }}</h4>
25
+ <textarea class="large-text" name="currency_switcher_additional_css" rows="5">{{ currency_switcher.additional_css }}</textarea>
26
+ </div>
27
+ </div>
28
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
+ <div class="wcml-section" id="currency-switcher-widget" {% if multi_currency_on is empty %}style="display:none"{% endif %}>
31
+ <div class="wcml-section-header">
32
+ <h3>{{ currency_switcher.headers.widget }}</h3>
33
+ </div>
34
+ <div class="wcml-section-content">
35
+ <div class="wcml-section-content-inner">
36
+ <table class="wcml-cs-list" {% if currency_switcher.widget_currency_switchers is empty %} style="display: none;" {% endif %}>
37
+ <thead>
38
+ <tr>
39
+ <th>{{ currency_switcher.headers.preview }}</th>
40
+ <th>{{ currency_switcher.headers.position }}</th>
41
+ <th>{{ currency_switcher.headers.actions }}</th>
42
+ </tr>
43
+ </thead>
44
+ <tbody>
45
+ {% for widget_currency_switcher in currency_switcher.widget_currency_switchers %}
46
+ <tr>
47
+ <td class="wcml-cs-cell-preview">
48
+ <div class="wcml-currency-preview-wrapper">
49
+ <div id="wcml_curr_sel_preview" class="wcml-currency-preview {{ widget_currency_switcher['id'] }}">
50
+ {{ currency_switcher.preview[ widget_currency_switcher['id'] ] |raw }}
51
+ </div>
52
+ </div>
53
+ </td>
54
+ <td class="wcml-cs-widget-name">
55
+ {{ widget_currency_switcher['name'] }}
56
+ </td>
57
+ <td class="wcml-cs-actions">
58
+ <a title="{{ currency_switcher.headers.edit }}"
59
+ class="edit_currency_switcher js-wcml-cs-dialog-trigger"
60
+ data-switcher="{{ widget_currency_switcher['id'] }}"
61
+ data-dialog="wcml_currency_switcher_options_{{ widget_currency_switcher['id'] }}"
62
+ data-content="wcml_currency_switcher_options_{{ widget_currency_switcher['id'] }}"
63
+ data-height="800" data-width="700">
64
+ <i class="otgs-ico-edit"></i>
65
+ </a>
66
+ <a title="{{ currency_switcher.headers.delete }}" class="delete_currency_switcher" data-switcher="{{ widget_currency_switcher['id'] }}" href="#">
67
+ <i class="otgs-ico-delete" title="{{ currency_switcher.headers.delete }}"></i>
68
+ </a>
69
+ </td>
70
+ </tr>
71
  {% endfor %}
72
+ <tr class="wcml-cs-empty-row" style="display: none">
73
+ <td class="wcml-cs-cell-preview">
74
+ <div class="wcml-currency-preview-wrapper">
75
+ <div id="wcml_curr_sel_preview" class="wcml-currency-preview"></div>
76
+ </div>
77
+ </td>
78
+ <td class="wcml-cs-widget-name">
79
+ </td>
80
+ <td class="wcml-cs-actions">
81
+ <a title="{{ currency_switcher.headers.edit }}"
82
+ class="edit_currency_switcher js-wcml-cs-dialog-trigger"
83
+ data-switcher=""
84
+ data-dialog=""
85
+ data-content=""
86
+ data-height="800" data-width="700">
87
+ <i class="otgs-ico-edit"></i>
88
+ </a>
89
+ <a title="{{ currency_switcher.headers.delete }}" class="delete_currency_switcher" data-switcher="" href="#">
90
+ <i class="otgs-ico-delete" title="{{ currency_switcher.headers.delete }}"></i>
91
+ </a>
92
+ </td>
93
+ </tr>
94
+ </tbody>
95
+ </table>
96
+ <div class="tablenav top clearfix">
97
+ <button type="button" class="button button-secondary alignright wcml_add_cs_sidebar js-wcml-cs-dialog-trigger"
98
+ data-switcher="new_widget"
99
+ data-dialog="wcml_currency_switcher_options_new_widget"
100
+ data-content="wcml_currency_switcher_options_new_widget"
101
+ data-height="800" data-width="700"
102
+ {% if currency_switcher.available_sidebars is empty %}style="display:none"{% endif %}>
103
+ <i class="otgs-ico-add otgs-ico-sm"></i>
104
+ {{ currency_switcher.headers.add_widget }}
105
+ </button>
106
  </div>
107
+ <input type="hidden" id="wcml_delete_currency_switcher_nonce" value="{{ currency_switcher.delete_nonce }}"/>
108
+ </div>
109
+ </div>
110
+ </div>
111
 
112
+ <div class="wcml-section" id="currency-switcher-product" {% if multi_currency_on is empty %}style="display:none"{% endif %}>
113
+ <div class="wcml-section-header">
114
+ <h3>{{ currency_switcher.headers.product_page }}</h3>
115
+ </div>
116
+ <div class="wcml-section-content">
117
+ <div class="wcml-section-content-inner">
118
+ <ul class="wcml_curr_visibility">
119
+ <li>
120
+ <label>
121
+ <input type="checkbox" name="currency_switcher_product_visibility" value="1" {%if currency_switcher.visibility_on %}checked="checked"{% endif %}>
122
+ {{ currency_switcher.visibility_label }}
123
+ </label>
124
+ </li>
125
+ </ul>
126
+ <div>
127
+ <table class="wcml-cs-list" {%if not currency_switcher.visibility_on %} style="display:none" {% endif %}>
128
+ <thead>
129
+ <tr>
130
+ <th>{{ currency_switcher.headers.preview }}</th>
131
+ <th>{{ currency_switcher.headers.action }}</th>
132
+ </tr>
133
+ </thead>
134
+ <tbody>
135
+ <tr>
136
+ <td class="wcml-cs-cell-preview">
137
+ <div class="wcml-currency-preview-wrapper">
138
+ <div id="wcml_curr_sel_preview" class="wcml-currency-preview product">
139
+ {{ currency_switcher.preview[ 'product' ] |raw }}
140
+ </div>
141
+ </div>
142
+ </td>
143
 
144
+ <td class="wcml-cs-actions">
145
+ <a title="{{ currency_switcher.headers.edit }}"
146
+ class="edit_currency_switcher js-wcml-cs-dialog-trigger"
147
+ data-switcher="product"
148
+ data-dialog="wcml_currency_switcher_options_product"
149
+ data-content="wcml_currency_switcher_options_product"
150
+ data-height="800" data-width="700">
151
+ <i class="otgs-ico-edit"></i>
152
+ </a>
153
+ </td>
154
+ </tr>
155
+ </tbody>
156
+ </table>
157
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  </div>
159
+ </div>
160
+ </div>
templates/multi-currency/custom-currency-options.twig CHANGED
@@ -23,12 +23,12 @@
23
  <label for="wcml_currency_options_rate_{{ args.currency_code }}">{{ form.rate.label }}</label>
24
  <div class="wcml-co-set-rate">
25
  1 {{ args.default_currency }} = <input name="currency_options[rate]" size="5" type="number"
26
- class="ext_rate{% if automatic_rates %} wcml-tip{% endif %}"
27
- step="0.01" value="{{ args.currency.rate }}" data-message="{{ form.rate.only_numeric }}"
28
  id="wcml_currency_options_rate_{{ args.currency_code }}"
29
  {% if automatic_rates %}readonly="readonly" data-tip="{{ automatic_rates_tip }}"{% endif %}/>
30
  <span class="this-currency">{{ current_currency }}</span>
31
-
32
  {% if args.currency.updated %}
33
  <small>
34
  {{ form.rate.set_on }} <i>{{ form.rate.previous }}</i>
23
  <label for="wcml_currency_options_rate_{{ args.currency_code }}">{{ form.rate.label }}</label>
24
  <div class="wcml-co-set-rate">
25
  1 {{ args.default_currency }} = <input name="currency_options[rate]" size="5" type="number"
26
+ class="wcml-exchange-rate{% if automatic_rates %} wcml-tip{% endif %}"
27
+ min="{{ form.rate.min }}" step="{{ form.rate.step }}" value="{{ args.currency.rate }}" data-message="{{ form.rate.only_numeric }}"
28
  id="wcml_currency_options_rate_{{ args.currency_code }}"
29
  {% if automatic_rates %}readonly="readonly" data-tip="{{ automatic_rates_tip }}"{% endif %}/>
30
  <span class="this-currency">{{ current_currency }}</span>
31
+ <span class="wcml-error" style="display: none">{{ form.number_error }}</span>
32
  {% if args.currency.updated %}
33
  <small>
34
  {{ form.rate.set_on }} <i>{{ form.rate.previous }}</i>
templates/multi-currency/custom-prices.twig CHANGED
@@ -42,7 +42,7 @@
42
  {% for key, custom_price in currency.custom_price %}
43
  <p>
44
  <label>{{ strings[key] }} ( {{ currency.currency_symbol|raw }} )</label>
45
- <input type="{{ currency.wc_input_type|e }}" size="5"
46
  name="_custom_variation{{ key }}{{ currency.custom_id }}"
47
  class="wc_input_price wcml_input_price short wcml{{ key }}"
48
  value="{{ custom_price }}" step="any" min="0" />
@@ -107,7 +107,7 @@
107
  {% for key, readonly_price in currency.readonly_price %}
108
  <p>
109
  <label>{{ strings[key] }} ( {{ currency.currency_symbol|raw }} )</label>
110
- <input type="number" size="5"
111
  name="_readonly{{ key }}"
112
  class="wc_input_price short"
113
  value="{{ readonly_price|e }}"
42
  {% for key, custom_price in currency.custom_price %}
43
  <p>
44
  <label>{{ strings[key] }} ( {{ currency.currency_symbol|raw }} )</label>
45
+ <input type="text"
46
  name="_custom_variation{{ key }}{{ currency.custom_id }}"
47
  class="wc_input_price wcml_input_price short wcml{{ key }}"
48
  value="{{ custom_price }}" step="any" min="0" />
107
  {% for key, readonly_price in currency.readonly_price %}
108
  <p>
109
  <label>{{ strings[key] }} ( {{ currency.currency_symbol|raw }} )</label>
110
+ <input type="text"
111
  name="_readonly{{ key }}"
112
  class="wc_input_price short"
113
  value="{{ readonly_price|e }}"
templates/multi-currency/multi-currency.twig CHANGED
@@ -245,6 +245,8 @@
245
 
246
  {% include 'exchange-rates.twig' with exchange_rates %}
247
 
 
 
248
  {% include 'currency-switcher-options.twig' %}
249
 
250
  <input type="hidden" id="wcml_warn_message" value="{{ form.navigate_warn }}" />
@@ -256,5 +258,4 @@
256
 
257
  {% endif %}
258
 
259
-
260
  </form>
245
 
246
  {% include 'exchange-rates.twig' with exchange_rates %}
247
 
248
+ {{ wp_do_action( 'wcml_before_currency_switcher_options' ) }}
249
+
250
  {% include 'currency-switcher-options.twig' %}
251
 
252
  <input type="hidden" id="wcml_warn_message" value="{{ form.navigate_warn }}" />
258
 
259
  {% endif %}
260
 
 
261
  </form>
templates/setup/attributes.twig CHANGED
@@ -1,4 +1,4 @@
1
- <h1>{{ strings.heading }}</h1>
2
 
3
  {% if attributes %}
4
  <ul class="no-bullets" >
1
+ <h1>{{ strings.heading|raw }}</h1>
2
 
3
  {% if attributes %}
4
  <ul class="no-bullets" >
vendor/autoload.php CHANGED
@@ -2,6 +2,6 @@
2
 
3
  // autoload.php @generated by Composer
4
 
5
- require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitb173854862956f3a90ab8075e30fc2fd::getLoader();
2
 
3
  // autoload.php @generated by Composer
4
 
5
+ require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitef9433f3fca31466e8742a1ca02f75ff::getLoader();
vendor/autoload_52.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
- return ComposerAutoloaderInit91bd182407667d11f5f394323aa28270::getLoader();
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
+ return ComposerAutoloaderInitdcb2d84aacc54fb27dd147868cd9a7cf::getLoader();
vendor/composer/ClassLoader.php CHANGED
@@ -53,8 +53,9 @@ class ClassLoader
53
 
54
  private $useIncludePath = false;
55
  private $classMap = array();
56
-
57
  private $classMapAuthoritative = false;
 
 
58
 
59
  public function getPrefixes()
60
  {
@@ -271,6 +272,26 @@ class ClassLoader
271
  return $this->classMapAuthoritative;
272
  }
273
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  /**
275
  * Registers this instance as an autoloader.
276
  *
@@ -313,29 +334,34 @@ class ClassLoader
313
  */
314
  public function findFile($class)
315
  {
316
- // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
317
- if ('\\' == $class[0]) {
318
- $class = substr($class, 1);
319
- }
320
-
321
  // class map lookup
322
  if (isset($this->classMap[$class])) {
323
  return $this->classMap[$class];
324
  }
325
- if ($this->classMapAuthoritative) {
326
  return false;
327
  }
 
 
 
 
 
 
328
 
329
  $file = $this->findFileWithExtension($class, '.php');
330
 
331
  // Search for Hack files if we are running on HHVM
332
- if ($file === null && defined('HHVM_VERSION')) {
333
  $file = $this->findFileWithExtension($class, '.hh');
334
  }
335
 
336
- if ($file === null) {
 
 
 
 
337
  // Remember that this class does not exist.
338
- return $this->classMap[$class] = false;
339
  }
340
 
341
  return $file;
@@ -399,6 +425,8 @@ class ClassLoader
399
  if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
400
  return $file;
401
  }
 
 
402
  }
403
  }
404
 
53
 
54
  private $useIncludePath = false;
55
  private $classMap = array();
 
56
  private $classMapAuthoritative = false;
57
+ private $missingClasses = array();
58
+ private $apcuPrefix;
59
 
60
  public function getPrefixes()
61
  {
272
  return $this->classMapAuthoritative;
273
  }
274
 
275
+ /**
276
+ * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
277
+ *
278
+ * @param string|null $apcuPrefix
279
+ */
280
+ public function setApcuPrefix($apcuPrefix)
281
+ {
282
+ $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
283
+ }
284
+
285
+ /**
286
+ * The APCu prefix in use, or null if APCu caching is not enabled.
287
+ *
288
+ * @return string|null
289
+ */
290
+ public function getApcuPrefix()
291
+ {
292
+ return $this->apcuPrefix;
293
+ }
294
+
295
  /**
296
  * Registers this instance as an autoloader.
297
  *
334
  */
335
  public function findFile($class)
336
  {
 
 
 
 
 
337
  // class map lookup
338
  if (isset($this->classMap[$class])) {
339
  return $this->classMap[$class];
340
  }
341
+ if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
342
  return false;
343
  }
344
+ if (null !== $this->apcuPrefix) {
345
+ $file = apcu_fetch($this->apcuPrefix.$class, $hit);
346
+ if ($hit) {
347
+ return $file;
348
+ }
349
+ }
350
 
351
  $file = $this->findFileWithExtension($class, '.php');
352
 
353
  // Search for Hack files if we are running on HHVM
354
+ if (false === $file && defined('HHVM_VERSION')) {
355
  $file = $this->findFileWithExtension($class, '.hh');
356
  }
357
 
358
+ if (null !== $this->apcuPrefix) {
359
+ apcu_add($this->apcuPrefix.$class, $file);
360
+ }
361
+
362
+ if (false === $file) {
363
  // Remember that this class does not exist.
364
+ $this->missingClasses[$class] = true;
365
  }
366
 
367
  return $file;
425
  if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
426
  return $file;
427
  }
428
+
429
+ return false;
430
  }
431
  }
432
 
vendor/composer/autoload_classmap.php CHANGED
@@ -6,7 +6,275 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
- 'Deprecated_WC_Functions' => $baseDir . '/inc/deprecated-WC-functions.php',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  'WCML_Accommodation_Bookings' => $baseDir . '/compatibility/class-wcml-accommodation-bookings.php',
11
  'WCML_Admin_Currency_Selector' => $baseDir . '/inc/currencies/class-wcml-admin-currency-selector.php',
12
  'WCML_Admin_Menus' => $baseDir . '/inc/admin-menus/class-wcml-admin-menus.php',
@@ -29,9 +297,12 @@ return array(
29
  'WCML_Composite_Products' => $baseDir . '/compatibility/class-wcml-composite-products.php',
30
  'WCML_Coupons' => $baseDir . '/inc/class-wcml-coupons.php',
31
  'WCML_Currencies' => $baseDir . '/inc/currencies/class-wcml-currencies.php',
32
- 'WCML_Currency_Switcher' => $baseDir . '/inc/currencies/class-wcml-currency-switcher.php',
33
- 'WCML_Currency_Switcher_UI' => $baseDir . '/inc/template-classes/multi-currency/class-wcml-currency-switcher-ui.php',
34
- 'WCML_Currency_Switcher_Widget' => $baseDir . '/inc/currencies/class-wcml-currency-switcher-widget.php',
 
 
 
35
  'WCML_Custom_Currency_Options' => $baseDir . '/inc/template-classes/multi-currency/class-wcml-custom-currency-options.php',
36
  'WCML_Custom_Files_UI' => $baseDir . '/inc/template-classes/class-wcml-custom-files-ui.php',
37
  'WCML_Custom_Prices' => $baseDir . '/inc/currencies/class-wcml-custom-prices.php',
@@ -42,6 +313,7 @@ return array(
42
  'WCML_Dynamic_Pricing' => $baseDir . '/compatibility/class-wcml-dynamic-pricing.php',
43
  'WCML_Editor_Save_Filters' => $baseDir . '/inc/translation-editor/class-wcml-editor-save-filters.php',
44
  'WCML_Editor_UI_Product_Job' => $baseDir . '/inc/translation-editor/class-wcml-editor-ui-product-job.php',
 
45
  'WCML_Emails' => $baseDir . '/inc/class-wcml-emails.php',
46
  'WCML_Endpoints' => $baseDir . '/inc/class-wcml-endpoints.php',
47
  'WCML_Exchange_Rate_Service' => $baseDir . '/inc/abstracts/class-wcml-exchange-rate-service.php',
@@ -83,9 +355,11 @@ return array(
83
  'WCML_Pointers' => $baseDir . '/inc/admin-menus/class-wcml-pointers.php',
84
  'WCML_Product_Addons' => $baseDir . '/compatibility/class-wcml-product-addons.php',
85
  'WCML_Product_Bundles' => $baseDir . '/compatibility/class-wcml-product-bundles.php',
 
86
  'WCML_Products' => $baseDir . '/inc/class-wcml-products.php',
87
  'WCML_Products_Screen_Options' => $baseDir . '/inc/class-wcml-products-screen-options.php',
88
  'WCML_Products_UI' => $baseDir . '/inc/template-classes/class-wcml-products-ui.php',
 
89
  'WCML_Removed_Cart_Items_UI' => $baseDir . '/inc/template-classes/class-wcml-removed-cart-items-ui.php',
90
  'WCML_Reports' => $baseDir . '/inc/class-wcml-reports.php',
91
  'WCML_Requests' => $baseDir . '/inc/class-wcml-requests.php',
@@ -116,6 +390,7 @@ return array(
116
  'WCML_Tab_Manager' => $baseDir . '/compatibility/class-wcml-tab-manager.php',
117
  'WCML_Table_Rate_Shipping' => $baseDir . '/compatibility/class-wcml-table-rate-shipping.php',
118
  'WCML_Terms' => $baseDir . '/inc/class-wcml-terms.php',
 
119
  'WCML_Translation_Editor' => $baseDir . '/inc/translation-editor/class-wcml-translation-editor.php',
120
  'WCML_Troubleshooting' => $baseDir . '/inc/class-wcml-troubleshooting.php',
121
  'WCML_Troubleshooting_UI' => $baseDir . '/inc/template-classes/class-wcml-troubleshooting-ui.php',
@@ -127,6 +402,7 @@ return array(
127
  'WCML_WC_Ajax_Cart' => $baseDir . '/compatibility/class-wcml-wc-ajax-cart.php',
128
  'WCML_WC_Gateways' => $baseDir . '/inc/class-wcml-wc-gateways.php',
129
  'WCML_WC_Name_Your_Price' => $baseDir . '/compatibility/class-wcml-wc-name-your-price.php',
 
130
  'WCML_WC_Shipping' => $baseDir . '/inc/class-wcml-wc-shipping.php',
131
  'WCML_WC_Strings' => $baseDir . '/inc/class-wcml-wc-strings.php',
132
  'WCML_WC_Subscriptions' => $baseDir . '/compatibility/class-wcml-wc-subscriptions.php',
@@ -138,15 +414,15 @@ return array(
138
  'WCML_wcExporter' => $baseDir . '/compatibility/class-wcml-wcexporter.php',
139
  'WCML_xDomain_Data' => $baseDir . '/inc/class-wcml-xdomain-data.php',
140
  'WPML_Auto_Loader' => $vendorDir . '/wpml/commons/src/wpml-auto-loader.php',
141
- 'WPML_Cache_Directory' => $vendorDir . '/wpml/commons/src/cache/class-wpml-cache-directory.php',
142
- 'WPML_Dependencies' => $vendorDir . '/wpml/commons/src/dependencies/class-wpml-dependencies.php',
143
  'WPML_Notice' => $vendorDir . '/wpml/commons/src/notices/class-wpml-notice.php',
144
  'WPML_Notice_Action' => $vendorDir . '/wpml/commons/src/notices/class-wpml-notice-action.php',
145
  'WPML_Notice_Render' => $vendorDir . '/wpml/commons/src/notices/class-wpml-notice-render.php',
146
  'WPML_Notices' => $vendorDir . '/wpml/commons/src/notices/class-wpml-notices.php',
147
- 'WPML_Templates_Factory' => $baseDir . '/inc/template-classes/class-wpml-templates-factory.php',
148
  'WPML_Twig_WP_Plugin_Extension' => $vendorDir . '/wpml/commons/src/twig/twig-extensions/wpml-twig-wp-plugin-extension.php',
149
  'WPML_WP_API' => $vendorDir . '/wpml/commons/src/wpml-wp/class-wpml-wp-api.php',
150
  'WooCommerce_Functions_Wrapper' => $baseDir . '/inc/woocommerce-functions-wrapper.php',
151
  'woocommerce_wpml' => $baseDir . '/inc/class-woocommerce-wpml.php',
 
 
152
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
+ 'Composer\\Installers\\AglInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AglInstaller.php',
10
+ 'Composer\\Installers\\AimeosInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AimeosInstaller.php',
11
+ 'Composer\\Installers\\AnnotateCmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php',
12
+ 'Composer\\Installers\\AsgardInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AsgardInstaller.php',
13
+ 'Composer\\Installers\\AttogramInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AttogramInstaller.php',
14
+ 'Composer\\Installers\\BaseInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/BaseInstaller.php',
15
+ 'Composer\\Installers\\BitrixInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/BitrixInstaller.php',
16
+ 'Composer\\Installers\\BonefishInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/BonefishInstaller.php',
17
+ 'Composer\\Installers\\CakePHPInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CakePHPInstaller.php',
18
+ 'Composer\\Installers\\ChefInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ChefInstaller.php',
19
+ 'Composer\\Installers\\ClanCatsFrameworkInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php',
20
+ 'Composer\\Installers\\CockpitInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CockpitInstaller.php',
21
+ 'Composer\\Installers\\CodeIgniterInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php',
22
+ 'Composer\\Installers\\Concrete5Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Concrete5Installer.php',
23
+ 'Composer\\Installers\\CraftInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CraftInstaller.php',
24
+ 'Composer\\Installers\\CroogoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CroogoInstaller.php',
25
+ 'Composer\\Installers\\DecibelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DecibelInstaller.php',
26
+ 'Composer\\Installers\\DokuWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DokuWikiInstaller.php',
27
+ 'Composer\\Installers\\DolibarrInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DolibarrInstaller.php',
28
+ 'Composer\\Installers\\DrupalInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DrupalInstaller.php',
29
+ 'Composer\\Installers\\ElggInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ElggInstaller.php',
30
+ 'Composer\\Installers\\ExpressionEngineInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php',
31
+ 'Composer\\Installers\\FuelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/FuelInstaller.php',
32
+ 'Composer\\Installers\\FuelphpInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/FuelphpInstaller.php',
33
+ 'Composer\\Installers\\GravInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/GravInstaller.php',
34
+ 'Composer\\Installers\\HuradInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/HuradInstaller.php',
35
+ 'Composer\\Installers\\ImageCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ImageCMSInstaller.php',
36
+ 'Composer\\Installers\\Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Installer.php',
37
+ 'Composer\\Installers\\JoomlaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/JoomlaInstaller.php',
38
+ 'Composer\\Installers\\KirbyInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KirbyInstaller.php',
39
+ 'Composer\\Installers\\KodiCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KodiCMSInstaller.php',
40
+ 'Composer\\Installers\\KohanaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KohanaInstaller.php',
41
+ 'Composer\\Installers\\LaravelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LaravelInstaller.php',
42
+ 'Composer\\Installers\\LithiumInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LithiumInstaller.php',
43
+ 'Composer\\Installers\\MODULEWorkInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php',
44
+ 'Composer\\Installers\\MODXEvoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MODXEvoInstaller.php',
45
+ 'Composer\\Installers\\MagentoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MagentoInstaller.php',
46
+ 'Composer\\Installers\\MakoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MakoInstaller.php',
47
+ 'Composer\\Installers\\MauticInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MauticInstaller.php',
48
+ 'Composer\\Installers\\MediaWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MediaWikiInstaller.php',
49
+ 'Composer\\Installers\\MicroweberInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MicroweberInstaller.php',
50
+ 'Composer\\Installers\\MoodleInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MoodleInstaller.php',
51
+ 'Composer\\Installers\\OctoberInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OctoberInstaller.php',
52
+ 'Composer\\Installers\\OxidInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OxidInstaller.php',
53
+ 'Composer\\Installers\\PPIInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PPIInstaller.php',
54
+ 'Composer\\Installers\\PhiftyInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PhiftyInstaller.php',
55
+ 'Composer\\Installers\\PhpBBInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PhpBBInstaller.php',
56
+ 'Composer\\Installers\\PimcoreInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PimcoreInstaller.php',
57
+ 'Composer\\Installers\\PiwikInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PiwikInstaller.php',
58
+ 'Composer\\Installers\\PlentymarketsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php',
59
+ 'Composer\\Installers\\Plugin' => $vendorDir . '/composer/installers/src/Composer/Installers/Plugin.php',
60
+ 'Composer\\Installers\\PrestashopInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PrestashopInstaller.php',
61
+ 'Composer\\Installers\\PuppetInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PuppetInstaller.php',
62
+ 'Composer\\Installers\\RadPHPInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php',
63
+ 'Composer\\Installers\\ReIndexInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php',
64
+ 'Composer\\Installers\\RedaxoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php',
65
+ 'Composer\\Installers\\RoundcubeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RoundcubeInstaller.php',
66
+ 'Composer\\Installers\\SMFInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SMFInstaller.php',
67
+ 'Composer\\Installers\\ShopwareInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ShopwareInstaller.php',
68
+ 'Composer\\Installers\\SilverStripeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SilverStripeInstaller.php',
69
+ 'Composer\\Installers\\Symfony1Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Symfony1Installer.php',
70
+ 'Composer\\Installers\\TYPO3CmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php',
71
+ 'Composer\\Installers\\TYPO3FlowInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php',
72
+ 'Composer\\Installers\\TheliaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TheliaInstaller.php',
73
+ 'Composer\\Installers\\TuskInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TuskInstaller.php',
74
+ 'Composer\\Installers\\VanillaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/VanillaInstaller.php',
75
+ 'Composer\\Installers\\WHMCSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/WHMCSInstaller.php',
76
+ 'Composer\\Installers\\WolfCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/WolfCMSInstaller.php',
77
+ 'Composer\\Installers\\WordPressInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/WordPressInstaller.php',
78
+ 'Composer\\Installers\\YawikInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/YawikInstaller.php',
79
+ 'Composer\\Installers\\ZendInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ZendInstaller.php',
80
+ 'Composer\\Installers\\ZikulaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ZikulaInstaller.php',
81
+ 'Twig_Autoloader' => $vendorDir . '/twig/twig/lib/Twig/Autoloader.php',
82
+ 'Twig_BaseNodeVisitor' => $vendorDir . '/twig/twig/lib/Twig/BaseNodeVisitor.php',
83
+ 'Twig_CacheInterface' => $vendorDir . '/twig/twig/lib/Twig/CacheInterface.php',
84
+ 'Twig_Cache_Filesystem' => $vendorDir . '/twig/twig/lib/Twig/Cache/Filesystem.php',
85
+ 'Twig_Cache_Null' => $vendorDir . '/twig/twig/lib/Twig/Cache/Null.php',
86
+ 'Twig_Compiler' => $vendorDir . '/twig/twig/lib/Twig/Compiler.php',
87
+ 'Twig_CompilerInterface' => $vendorDir . '/twig/twig/lib/Twig/CompilerInterface.php',
88
+ 'Twig_ContainerRuntimeLoader' => $vendorDir . '/twig/twig/lib/Twig/ContainerRuntimeLoader.php',
89
+ 'Twig_Environment' => $vendorDir . '/twig/twig/lib/Twig/Environment.php',
90
+ 'Twig_Error' => $vendorDir . '/twig/twig/lib/Twig/Error.php',
91
+ 'Twig_Error_Loader' => $vendorDir . '/twig/twig/lib/Twig/Error/Loader.php',
92
+ 'Twig_Error_Runtime' => $vendorDir . '/twig/twig/lib/Twig/Error/Runtime.php',
93
+ 'Twig_Error_Syntax' => $vendorDir . '/twig/twig/lib/Twig/Error/Syntax.php',
94
+ 'Twig_ExistsLoaderInterface' => $vendorDir . '/twig/twig/lib/Twig/ExistsLoaderInterface.php',
95
+ 'Twig_ExpressionParser' => $vendorDir . '/twig/twig/lib/Twig/ExpressionParser.php',
96
+ 'Twig_Extension' => $vendorDir . '/twig/twig/lib/Twig/Extension.php',
97
+ 'Twig_ExtensionInterface' => $vendorDir . '/twig/twig/lib/Twig/ExtensionInterface.php',
98
+ 'Twig_Extension_Core' => $vendorDir . '/twig/twig/lib/Twig/Extension/Core.php',
99
+ 'Twig_Extension_Debug' => $vendorDir . '/twig/twig/lib/Twig/Extension/Debug.php',
100
+ 'Twig_Extension_Escaper' => $vendorDir . '/twig/twig/lib/Twig/Extension/Escaper.php',
101
+ 'Twig_Extension_GlobalsInterface' => $vendorDir . '/twig/twig/lib/Twig/Extension/GlobalsInterface.php',
102
+ 'Twig_Extension_InitRuntimeInterface' => $vendorDir . '/twig/twig/lib/Twig/Extension/InitRuntimeInterface.php',
103
+ 'Twig_Extension_Optimizer' => $vendorDir . '/twig/twig/lib/Twig/Extension/Optimizer.php',
104
+ 'Twig_Extension_Profiler' => $vendorDir . '/twig/twig/lib/Twig/Extension/Profiler.php',
105
+ 'Twig_Extension_Sandbox' => $vendorDir . '/twig/twig/lib/Twig/Extension/Sandbox.php',
106
+ 'Twig_Extension_Staging' => $vendorDir . '/twig/twig/lib/Twig/Extension/Staging.php',
107
+ 'Twig_Extension_StringLoader' => $vendorDir . '/twig/twig/lib/Twig/Extension/StringLoader.php',
108
+ 'Twig_FactoryRuntimeLoader' => $vendorDir . '/twig/twig/lib/Twig/FactoryRuntimeLoader.php',
109
+ 'Twig_FileExtensionEscapingStrategy' => $vendorDir . '/twig/twig/lib/Twig/FileExtensionEscapingStrategy.php',
110
+ 'Twig_Filter' => $vendorDir . '/twig/twig/lib/Twig/Filter.php',
111
+ 'Twig_FilterCallableInterface' => $vendorDir . '/twig/twig/lib/Twig/FilterCallableInterface.php',
112
+ 'Twig_FilterInterface' => $vendorDir . '/twig/twig/lib/Twig/FilterInterface.php',
113
+ 'Twig_Filter_Function' => $vendorDir . '/twig/twig/lib/Twig/Filter/Function.php',
114
+ 'Twig_Filter_Method' => $vendorDir . '/twig/twig/lib/Twig/Filter/Method.php',
115
+ 'Twig_Filter_Node' => $vendorDir . '/twig/twig/lib/Twig/Filter/Node.php',
116
+ 'Twig_Function' => $vendorDir . '/twig/twig/lib/Twig/Function.php',
117
+ 'Twig_FunctionCallableInterface' => $vendorDir . '/twig/twig/lib/Twig/FunctionCallableInterface.php',
118
+ 'Twig_FunctionInterface' => $vendorDir . '/twig/twig/lib/Twig/FunctionInterface.php',
119
+ 'Twig_Function_Function' => $vendorDir . '/twig/twig/lib/Twig/Function/Function.php',
120
+ 'Twig_Function_Method' => $vendorDir . '/twig/twig/lib/Twig/Function/Method.php',
121
+ 'Twig_Function_Node' => $vendorDir . '/twig/twig/lib/Twig/Function/Node.php',
122
+ 'Twig_Lexer' => $vendorDir . '/twig/twig/lib/Twig/Lexer.php',
123
+ 'Twig_LexerInterface' => $vendorDir . '/twig/twig/lib/Twig/LexerInterface.php',
124
+ 'Twig_LoaderInterface' => $vendorDir . '/twig/twig/lib/Twig/LoaderInterface.php',
125
+ 'Twig_Loader_Array' => $vendorDir . '/twig/twig/lib/Twig/Loader/Array.php',
126
+ 'Twig_Loader_Chain' => $vendorDir . '/twig/twig/lib/Twig/Loader/Chain.php',
127
+ 'Twig_Loader_Filesystem' => $vendorDir . '/twig/twig/lib/Twig/Loader/Filesystem.php',
128
+ 'Twig_Loader_String' => $vendorDir . '/twig/twig/lib/Twig/Loader/String.php',
129
+ 'Twig_Markup' => $vendorDir . '/twig/twig/lib/Twig/Markup.php',
130
+ 'Twig_Node' => $vendorDir . '/twig/twig/lib/Twig/Node.php',
131
+ 'Twig_NodeCaptureInterface' => $vendorDir . '/twig/twig/lib/Twig/NodeCaptureInterface.php',
132
+ 'Twig_NodeInterface' => $vendorDir . '/twig/twig/lib/Twig/NodeInterface.php',
133
+ 'Twig_NodeOutputInterface' => $vendorDir . '/twig/twig/lib/Twig/NodeOutputInterface.php',
134
+ 'Twig_NodeTraverser' => $vendorDir . '/twig/twig/lib/Twig/NodeTraverser.php',
135
+ 'Twig_NodeVisitorInterface' => $vendorDir . '/twig/twig/lib/Twig/NodeVisitorInterface.php',
136
+ 'Twig_NodeVisitor_Escaper' => $vendorDir . '/twig/twig/lib/Twig/NodeVisitor/Escaper.php',
137
+ 'Twig_NodeVisitor_Optimizer' => $vendorDir . '/twig/twig/lib/Twig/NodeVisitor/Optimizer.php',
138
+ 'Twig_NodeVisitor_SafeAnalysis' => $vendorDir . '/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php',
139
+ 'Twig_NodeVisitor_Sandbox' => $vendorDir . '/twig/twig/lib/Twig/NodeVisitor/Sandbox.php',
140
+ 'Twig_Node_AutoEscape' => $vendorDir . '/twig/twig/lib/Twig/Node/AutoEscape.php',
141
+ 'Twig_Node_Block' => $vendorDir . '/twig/twig/lib/Twig/Node/Block.php',
142
+ 'Twig_Node_BlockReference' => $vendorDir . '/twig/twig/lib/Twig/Node/BlockReference.php',
143
+ 'Twig_Node_Body' => $vendorDir . '/twig/twig/lib/Twig/Node/Body.php',
144
+ 'Twig_Node_CheckSecurity' => $vendorDir . '/twig/twig/lib/Twig/Node/CheckSecurity.php',
145
+ 'Twig_Node_Do' => $vendorDir . '/twig/twig/lib/Twig/Node/Do.php',
146
+ 'Twig_Node_Embed' => $vendorDir . '/twig/twig/lib/Twig/Node/Embed.php',
147
+ 'Twig_Node_Expression' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression.php',
148
+ 'Twig_Node_Expression_Array' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Array.php',
149
+ 'Twig_Node_Expression_AssignName' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/AssignName.php',
150
+ 'Twig_Node_Expression_Binary' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary.php',
151
+ 'Twig_Node_Expression_Binary_Add' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Add.php',
152
+ 'Twig_Node_Expression_Binary_And' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/And.php',
153
+ 'Twig_Node_Expression_Binary_BitwiseAnd' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php',
154
+ 'Twig_Node_Expression_Binary_BitwiseOr' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php',
155
+ 'Twig_Node_Expression_Binary_BitwiseXor' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php',
156
+ 'Twig_Node_Expression_Binary_Concat' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php',
157
+ 'Twig_Node_Expression_Binary_Div' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Div.php',
158
+ 'Twig_Node_Expression_Binary_EndsWith' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php',
159
+ 'Twig_Node_Expression_Binary_Equal' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php',
160
+ 'Twig_Node_Expression_Binary_FloorDiv' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php',
161
+ 'Twig_Node_Expression_Binary_Greater' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php',
162
+ 'Twig_Node_Expression_Binary_GreaterEqual' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php',
163
+ 'Twig_Node_Expression_Binary_In' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/In.php',
164
+ 'Twig_Node_Expression_Binary_Less' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Less.php',
165
+ 'Twig_Node_Expression_Binary_LessEqual' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php',
166
+ 'Twig_Node_Expression_Binary_Matches' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Matches.php',
167
+ 'Twig_Node_Expression_Binary_Mod' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php',
168
+ 'Twig_Node_Expression_Binary_Mul' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php',
169
+ 'Twig_Node_Expression_Binary_NotEqual' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php',
170
+ 'Twig_Node_Expression_Binary_NotIn' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php',
171
+ 'Twig_Node_Expression_Binary_Or' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Or.php',
172
+ 'Twig_Node_Expression_Binary_Power' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Power.php',
173
+ 'Twig_Node_Expression_Binary_Range' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Range.php',
174
+ 'Twig_Node_Expression_Binary_StartsWith' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php',
175
+ 'Twig_Node_Expression_Binary_Sub' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php',
176
+ 'Twig_Node_Expression_BlockReference' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/BlockReference.php',
177
+ 'Twig_Node_Expression_Call' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Call.php',
178
+ 'Twig_Node_Expression_Conditional' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Conditional.php',
179
+ 'Twig_Node_Expression_Constant' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Constant.php',
180
+ 'Twig_Node_Expression_ExtensionReference' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php',
181
+ 'Twig_Node_Expression_Filter' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Filter.php',
182
+ 'Twig_Node_Expression_Filter_Default' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Filter/Default.php',
183
+ 'Twig_Node_Expression_Function' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Function.php',
184
+ 'Twig_Node_Expression_GetAttr' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/GetAttr.php',
185
+ 'Twig_Node_Expression_MethodCall' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/MethodCall.php',
186
+ 'Twig_Node_Expression_Name' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Name.php',
187
+ 'Twig_Node_Expression_NullCoalesce' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/NullCoalesce.php',
188
+ 'Twig_Node_Expression_Parent' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Parent.php',
189
+ 'Twig_Node_Expression_TempName' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/TempName.php',
190
+ 'Twig_Node_Expression_Test' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test.php',
191
+ 'Twig_Node_Expression_Test_Constant' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Constant.php',
192
+ 'Twig_Node_Expression_Test_Defined' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Defined.php',
193
+ 'Twig_Node_Expression_Test_Divisibleby' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php',
194
+ 'Twig_Node_Expression_Test_Even' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Even.php',
195
+ 'Twig_Node_Expression_Test_Null' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Null.php',
196
+ 'Twig_Node_Expression_Test_Odd' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Odd.php',
197
+ 'Twig_Node_Expression_Test_Sameas' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php',
198
+ 'Twig_Node_Expression_Unary' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Unary.php',
199
+ 'Twig_Node_Expression_Unary_Neg' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php',
200
+ 'Twig_Node_Expression_Unary_Not' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Unary/Not.php',
201
+ 'Twig_Node_Expression_Unary_Pos' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php',
202
+ 'Twig_Node_Flush' => $vendorDir . '/twig/twig/lib/Twig/Node/Flush.php',
203
+ 'Twig_Node_For' => $vendorDir . '/twig/twig/lib/Twig/Node/For.php',
204
+ 'Twig_Node_ForLoop' => $vendorDir . '/twig/twig/lib/Twig/Node/ForLoop.php',
205
+ 'Twig_Node_If' => $vendorDir . '/twig/twig/lib/Twig/Node/If.php',
206
+ 'Twig_Node_Import' => $vendorDir . '/twig/twig/lib/Twig/Node/Import.php',
207
+ 'Twig_Node_Include' => $vendorDir . '/twig/twig/lib/Twig/Node/Include.php',
208
+ 'Twig_Node_Macro' => $vendorDir . '/twig/twig/lib/Twig/Node/Macro.php',
209
+ 'Twig_Node_Module' => $vendorDir . '/twig/twig/lib/Twig/Node/Module.php',
210
+ 'Twig_Node_Print' => $vendorDir . '/twig/twig/lib/Twig/Node/Print.php',
211
+ 'Twig_Node_Sandbox' => $vendorDir . '/twig/twig/lib/Twig/Node/Sandbox.php',
212
+ 'Twig_Node_SandboxedPrint' => $vendorDir . '/twig/twig/lib/Twig/Node/SandboxedPrint.php',
213
+ 'Twig_Node_Set' => $vendorDir . '/twig/twig/lib/Twig/Node/Set.php',
214
+ 'Twig_Node_SetTemp' => $vendorDir . '/twig/twig/lib/Twig/Node/SetTemp.php',
215
+ 'Twig_Node_Spaceless' => $vendorDir . '/twig/twig/lib/Twig/Node/Spaceless.php',
216
+ 'Twig_Node_Text' => $vendorDir . '/twig/twig/lib/Twig/Node/Text.php',
217
+ 'Twig_Node_With' => $vendorDir . '/twig/twig/lib/Twig/Node/With.php',
218
+ 'Twig_Parser' => $vendorDir . '/twig/twig/lib/Twig/Parser.php',
219
+ 'Twig_ParserInterface' => $vendorDir . '/twig/twig/lib/Twig/ParserInterface.php',
220
+ 'Twig_Profiler_Dumper_Blackfire' => $vendorDir . '/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php',
221
+ 'Twig_Profiler_Dumper_Html' => $vendorDir . '/twig/twig/lib/Twig/Profiler/Dumper/Html.php',
222
+ 'Twig_Profiler_Dumper_Text' => $vendorDir . '/twig/twig/lib/Twig/Profiler/Dumper/Text.php',
223
+ 'Twig_Profiler_NodeVisitor_Profiler' => $vendorDir . '/twig/twig/lib/Twig/Profiler/NodeVisitor/Profiler.php',
224
+ 'Twig_Profiler_Node_EnterProfile' => $vendorDir . '/twig/twig/lib/Twig/Profiler/Node/EnterProfile.php',
225
+ 'Twig_Profiler_Node_LeaveProfile' => $vendorDir . '/twig/twig/lib/Twig/Profiler/Node/LeaveProfile.php',
226
+ 'Twig_Profiler_Profile' => $vendorDir . '/twig/twig/lib/Twig/Profiler/Profile.php',
227
+ 'Twig_RuntimeLoaderInterface' => $vendorDir . '/twig/twig/lib/Twig/RuntimeLoaderInterface.php',
228
+ 'Twig_Sandbox_SecurityError' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityError.php',
229
+ 'Twig_Sandbox_SecurityNotAllowedFilterError' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFilterError.php',
230
+ 'Twig_Sandbox_SecurityNotAllowedFunctionError' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFunctionError.php',
231
+ 'Twig_Sandbox_SecurityNotAllowedMethodError' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedMethodError.php',
232
+ 'Twig_Sandbox_SecurityNotAllowedPropertyError' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedPropertyError.php',
233
+ 'Twig_Sandbox_SecurityNotAllowedTagError' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php',
234
+ 'Twig_Sandbox_SecurityPolicy' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php',
235
+ 'Twig_Sandbox_SecurityPolicyInterface' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php',
236
+ 'Twig_SimpleFilter' => $vendorDir . '/twig/twig/lib/Twig/SimpleFilter.php',
237
+ 'Twig_SimpleFunction' => $vendorDir . '/twig/twig/lib/Twig/SimpleFunction.php',
238
+ 'Twig_SimpleTest' => $vendorDir . '/twig/twig/lib/Twig/SimpleTest.php',
239
+ 'Twig_Source' => $vendorDir . '/twig/twig/lib/Twig/Source.php',
240
+ 'Twig_SourceContextLoaderInterface' => $vendorDir . '/twig/twig/lib/Twig/SourceContextLoaderInterface.php',
241
+ 'Twig_Template' => $vendorDir . '/twig/twig/lib/Twig/Template.php',
242
+ 'Twig_TemplateInterface' => $vendorDir . '/twig/twig/lib/Twig/TemplateInterface.php',
243
+ 'Twig_TemplateWrapper' => $vendorDir . '/twig/twig/lib/Twig/TemplateWrapper.php',
244
+ 'Twig_Test' => $vendorDir . '/twig/twig/lib/Twig/Test.php',
245
+ 'Twig_TestCallableInterface' => $vendorDir . '/twig/twig/lib/Twig/TestCallableInterface.php',
246
+ 'Twig_TestInterface' => $vendorDir . '/twig/twig/lib/Twig/TestInterface.php',
247
+ 'Twig_Test_Function' => $vendorDir . '/twig/twig/lib/Twig/Test/Function.php',
248
+ 'Twig_Test_IntegrationTestCase' => $vendorDir . '/twig/twig/lib/Twig/Test/IntegrationTestCase.php',
249
+ 'Twig_Test_Method' => $vendorDir . '/twig/twig/lib/Twig/Test/Method.php',
250
+ 'Twig_Test_Node' => $vendorDir . '/twig/twig/lib/Twig/Test/Node.php',
251
+ 'Twig_Test_NodeTestCase' => $vendorDir . '/twig/twig/lib/Twig/Test/NodeTestCase.php',
252
+ 'Twig_Token' => $vendorDir . '/twig/twig/lib/Twig/Token.php',
253
+ 'Twig_TokenParser' => $vendorDir . '/twig/twig/lib/Twig/TokenParser.php',
254
+ 'Twig_TokenParserBroker' => $vendorDir . '/twig/twig/lib/Twig/TokenParserBroker.php',
255
+ 'Twig_TokenParserBrokerInterface' => $vendorDir . '/twig/twig/lib/Twig/TokenParserBrokerInterface.php',
256
+ 'Twig_TokenParserInterface' => $vendorDir . '/twig/twig/lib/Twig/TokenParserInterface.php',
257
+ 'Twig_TokenParser_AutoEscape' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/AutoEscape.php',
258
+ 'Twig_TokenParser_Block' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Block.php',
259
+ 'Twig_TokenParser_Do' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Do.php',
260
+ 'Twig_TokenParser_Embed' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Embed.php',
261
+ 'Twig_TokenParser_Extends' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Extends.php',
262
+ 'Twig_TokenParser_Filter' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Filter.php',
263
+ 'Twig_TokenParser_Flush' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Flush.php',
264
+ 'Twig_TokenParser_For' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/For.php',
265
+ 'Twig_TokenParser_From' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/From.php',
266
+ 'Twig_TokenParser_If' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/If.php',
267
+ 'Twig_TokenParser_Import' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Import.php',
268
+ 'Twig_TokenParser_Include' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Include.php',
269
+ 'Twig_TokenParser_Macro' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Macro.php',
270
+ 'Twig_TokenParser_Sandbox' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Sandbox.php',
271
+ 'Twig_TokenParser_Set' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Set.php',
272
+ 'Twig_TokenParser_Spaceless' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Spaceless.php',
273
+ 'Twig_TokenParser_Use' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Use.php',
274
+ 'Twig_TokenParser_With' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/With.php',
275
+ 'Twig_TokenStream' => $vendorDir . '/twig/twig/lib/Twig/TokenStream.php',
276
+ 'Twig_Util_DeprecationCollector' => $vendorDir . '/twig/twig/lib/Twig/Util/DeprecationCollector.php',
277
+ 'Twig_Util_TemplateDirIterator' => $vendorDir . '/twig/twig/lib/Twig/Util/TemplateDirIterator.php',
278
  'WCML_Accommodation_Bookings' => $baseDir . '/compatibility/class-wcml-accommodation-bookings.php',
279
  'WCML_Admin_Currency_Selector' => $baseDir . '/inc/currencies/class-wcml-admin-currency-selector.php',
280
  'WCML_Admin_Menus' => $baseDir . '/inc/admin-menus/class-wcml-admin-menus.php',
297
  'WCML_Composite_Products' => $baseDir . '/compatibility/class-wcml-composite-products.php',
298
  'WCML_Coupons' => $baseDir . '/inc/class-wcml-coupons.php',
299
  'WCML_Currencies' => $baseDir . '/inc/currencies/class-wcml-currencies.php',
300
+ 'WCML_Currency_Switcher' => $baseDir . '/inc/currencies/currency-switcher/class-wcml-currency-switcher.php',
301
+ 'WCML_Currency_Switcher_Ajax' => $baseDir . '/inc/currencies/currency-switcher/class-wcml-currency-switcher-ajax.php',
302
+ 'WCML_Currency_Switcher_Options_Dialog' => $baseDir . '/inc/template-classes/currency-switcher/class-wcml-currency-switcher-options-dialog.php',
303
+ 'WCML_Currency_Switcher_Template' => $baseDir . '/inc/template-classes/currency-switcher/class-wcml-currency-switcher-template.php',
304
+ 'WCML_Currency_Switcher_Templates' => $baseDir . '/inc/currencies/currency-switcher/class-wcml-currency-switcher-templates.php',
305
+ 'WCML_Currency_Switcher_Widget' => $baseDir . '/inc/currencies/currency-switcher/class-wcml-currency-switcher-widget.php',
306
  'WCML_Custom_Currency_Options' => $baseDir . '/inc/template-classes/multi-currency/class-wcml-custom-currency-options.php',
307
  'WCML_Custom_Files_UI' => $baseDir . '/inc/template-classes/class-wcml-custom-files-ui.php',
308
  'WCML_Custom_Prices' => $baseDir . '/inc/currencies/class-wcml-custom-prices.php',
313
  'WCML_Dynamic_Pricing' => $baseDir . '/compatibility/class-wcml-dynamic-pricing.php',
314
  'WCML_Editor_Save_Filters' => $baseDir . '/inc/translation-editor/class-wcml-editor-save-filters.php',
315
  'WCML_Editor_UI_Product_Job' => $baseDir . '/inc/translation-editor/class-wcml-editor-ui-product-job.php',
316
+ 'WCML_Editor_UI_WYSIWYG_Field' => $baseDir . '/inc/translation-editor/class-wcml-editor-ui-wysiwyg-field.php',
317
  'WCML_Emails' => $baseDir . '/inc/class-wcml-emails.php',
318
  'WCML_Endpoints' => $baseDir . '/inc/class-wcml-endpoints.php',
319
  'WCML_Exchange_Rate_Service' => $baseDir . '/inc/abstracts/class-wcml-exchange-rate-service.php',
355
  'WCML_Pointers' => $baseDir . '/inc/admin-menus/class-wcml-pointers.php',
356
  'WCML_Product_Addons' => $baseDir . '/compatibility/class-wcml-product-addons.php',
357
  'WCML_Product_Bundles' => $baseDir . '/compatibility/class-wcml-product-bundles.php',
358
+ 'WCML_Product_Bundles_Legacy' => $baseDir . '/compatibility/class-wcml-product-bundles-legacy.php',
359
  'WCML_Products' => $baseDir . '/inc/class-wcml-products.php',
360
  'WCML_Products_Screen_Options' => $baseDir . '/inc/class-wcml-products-screen-options.php',
361
  'WCML_Products_UI' => $baseDir . '/inc/template-classes/class-wcml-products-ui.php',
362
+ 'WCML_REST_API_Support' => $baseDir . '/inc/rest-api-support/class-wcml-rest-api-suport.php',
363
  'WCML_Removed_Cart_Items_UI' => $baseDir . '/inc/template-classes/class-wcml-removed-cart-items-ui.php',
364
  'WCML_Reports' => $baseDir . '/inc/class-wcml-reports.php',
365
  'WCML_Requests' => $baseDir . '/inc/class-wcml-requests.php',
390
  'WCML_Tab_Manager' => $baseDir . '/compatibility/class-wcml-tab-manager.php',
391
  'WCML_Table_Rate_Shipping' => $baseDir . '/compatibility/class-wcml-table-rate-shipping.php',
392
  'WCML_Terms' => $baseDir . '/inc/class-wcml-terms.php',
393
+ 'WCML_The_Events_Calendar' => $baseDir . '/compatibility/class-wcml-the-events-calendar.php',
394
  'WCML_Translation_Editor' => $baseDir . '/inc/translation-editor/class-wcml-translation-editor.php',
395
  'WCML_Troubleshooting' => $baseDir . '/inc/class-wcml-troubleshooting.php',
396
  'WCML_Troubleshooting_UI' => $baseDir . '/inc/template-classes/class-wcml-troubleshooting-ui.php',
402
  'WCML_WC_Ajax_Cart' => $baseDir . '/compatibility/class-wcml-wc-ajax-cart.php',
403
  'WCML_WC_Gateways' => $baseDir . '/inc/class-wcml-wc-gateways.php',
404
  'WCML_WC_Name_Your_Price' => $baseDir . '/compatibility/class-wcml-wc-name-your-price.php',
405
+ 'WCML_WC_Product_Bundles_Items' => $baseDir . '/compatibility/includes/class-wcml-wc-product-bundles-items.php',
406
  'WCML_WC_Shipping' => $baseDir . '/inc/class-wcml-wc-shipping.php',
407
  'WCML_WC_Strings' => $baseDir . '/inc/class-wcml-wc-strings.php',
408
  'WCML_WC_Subscriptions' => $baseDir . '/compatibility/class-wcml-wc-subscriptions.php',
414
  'WCML_wcExporter' => $baseDir . '/compatibility/class-wcml-wcexporter.php',
415
  'WCML_xDomain_Data' => $baseDir . '/inc/class-wcml-xdomain-data.php',
416
  'WPML_Auto_Loader' => $vendorDir . '/wpml/commons/src/wpml-auto-loader.php',
 
 
417
  'WPML_Notice' => $vendorDir . '/wpml/commons/src/notices/class-wpml-notice.php',
418
  'WPML_Notice_Action' => $vendorDir . '/wpml/commons/src/notices/class-wpml-notice-action.php',
419
  'WPML_Notice_Render' => $vendorDir . '/wpml/commons/src/notices/class-wpml-notice-render.php',
420
  'WPML_Notices' => $vendorDir . '/wpml/commons/src/notices/class-wpml-notices.php',
421
+ 'WPML_Templates_Factory' => $vendorDir . '/wpml/commons/src/templating/class-wpml-templates-factory.php',
422
  'WPML_Twig_WP_Plugin_Extension' => $vendorDir . '/wpml/commons/src/twig/twig-extensions/wpml-twig-wp-plugin-extension.php',
423
  'WPML_WP_API' => $vendorDir . '/wpml/commons/src/wpml-wp/class-wpml-wp-api.php',
424
  'WooCommerce_Functions_Wrapper' => $baseDir . '/inc/woocommerce-functions-wrapper.php',
425
  'woocommerce_wpml' => $baseDir . '/inc/class-woocommerce-wpml.php',
426
+ 'xrstf\\Composer52\\AutoloadGenerator' => $vendorDir . '/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php',
427
+ 'xrstf\\Composer52\\Generator' => $vendorDir . '/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php',
428
  );
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitb173854862956f3a90ab8075e30fc2fd
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInitb173854862956f3a90ab8075e30fc2fd
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitb173854862956f3a90ab8075e30fc2fd', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitb173854862956f3a90ab8075e30fc2fd', 'loadClassLoader'));
25
 
26
- $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInitb173854862956f3a90ab8075e30fc2fd::getInitializer($loader));
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 ComposerAutoloaderInitef9433f3fca31466e8742a1ca02f75ff
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitef9433f3fca31466e8742a1ca02f75ff', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitef9433f3fca31466e8742a1ca02f75ff', '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\ComposerStaticInitef9433f3fca31466e8742a1ca02f75ff::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 ComposerAutoloaderInit91bd182407667d11f5f394323aa28270 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit91bd182407667d11f5f394323aa28270 {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit91bd182407667d11f5f394323aa28270', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit91bd182407667d11f5f394323aa28270', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
+ class ComposerAutoloaderInitdcb2d84aacc54fb27dd147868cd9a7cf {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitdcb2d84aacc54fb27dd147868cd9a7cf', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitdcb2d84aacc54fb27dd147868cd9a7cf', '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 ComposerStaticInitb173854862956f3a90ab8075e30fc2fd
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'C' =>
@@ -38,7 +38,275 @@ class ComposerStaticInitb173854862956f3a90ab8075e30fc2fd
38
  );
39
 
40
  public static $classMap = array (
41
- 'Deprecated_WC_Functions' => __DIR__ . '/../..' . '/inc/deprecated-WC-functions.php',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  'WCML_Accommodation_Bookings' => __DIR__ . '/../..' . '/compatibility/class-wcml-accommodation-bookings.php',
43
  'WCML_Admin_Currency_Selector' => __DIR__ . '/../..' . '/inc/currencies/class-wcml-admin-currency-selector.php',
44
  'WCML_Admin_Menus' => __DIR__ . '/../..' . '/inc/admin-menus/class-wcml-admin-menus.php',
@@ -61,9 +329,12 @@ class ComposerStaticInitb173854862956f3a90ab8075e30fc2fd
61
  'WCML_Composite_Products' => __DIR__ . '/../..' . '/compatibility/class-wcml-composite-products.php',
62
  'WCML_Coupons' => __DIR__ . '/../..' . '/inc/class-wcml-coupons.php',
63
  'WCML_Currencies' => __DIR__ . '/../..' . '/inc/currencies/class-wcml-currencies.php',
64
- 'WCML_Currency_Switcher' => __DIR__ . '/../..' . '/inc/currencies/class-wcml-currency-switcher.php',
65
- 'WCML_Currency_Switcher_UI' => __DIR__ . '/../..' . '/inc/template-classes/multi-currency/class-wcml-currency-switcher-ui.php',
66
- 'WCML_Currency_Switcher_Widget' => __DIR__ . '/../..' . '/inc/currencies/class-wcml-currency-switcher-widget.php',
 
 
 
67
  'WCML_Custom_Currency_Options' => __DIR__ . '/../..' . '/inc/template-classes/multi-currency/class-wcml-custom-currency-options.php',
68
  'WCML_Custom_Files_UI' => __DIR__ . '/../..' . '/inc/template-classes/class-wcml-custom-files-ui.php',
69
  'WCML_Custom_Prices' => __DIR__ . '/../..' . '/inc/currencies/class-wcml-custom-prices.php',
@@ -74,6 +345,7 @@ class ComposerStaticInitb173854862956f3a90ab8075e30fc2fd
74
  'WCML_Dynamic_Pricing' => __DIR__ . '/../..' . '/compatibility/class-wcml-dynamic-pricing.php',
75
  'WCML_Editor_Save_Filters' => __DIR__ . '/../..' . '/inc/translation-editor/class-wcml-editor-save-filters.php',
76
  'WCML_Editor_UI_Product_Job' => __DIR__ . '/../..' . '/inc/translation-editor/class-wcml-editor-ui-product-job.php',
 
77
  'WCML_Emails' => __DIR__ . '/../..' . '/inc/class-wcml-emails.php',
78
  'WCML_Endpoints' => __DIR__ . '/../..' . '/inc/class-wcml-endpoints.php',
79
  'WCML_Exchange_Rate_Service' => __DIR__ . '/../..' . '/inc/abstracts/class-wcml-exchange-rate-service.php',
@@ -115,9 +387,11 @@ class ComposerStaticInitb173854862956f3a90ab8075e30fc2fd
115
  'WCML_Pointers' => __DIR__ . '/../..' . '/inc/admin-menus/class-wcml-pointers.php',
116
  'WCML_Product_Addons' => __DIR__ . '/../..' . '/compatibility/class-wcml-product-addons.php',
117
  'WCML_Product_Bundles' => __DIR__ . '/../..' . '/compatibility/class-wcml-product-bundles.php',
 
118
  'WCML_Products' => __DIR__ . '/../..' . '/inc/class-wcml-products.php',
119
  'WCML_Products_Screen_Options' => __DIR__ . '/../..' . '/inc/class-wcml-products-screen-options.php',
120
  'WCML_Products_UI' => __DIR__ . '/../..' . '/inc/template-classes/class-wcml-products-ui.php',
 
121
  'WCML_Removed_Cart_Items_UI' => __DIR__ . '/../..' . '/inc/template-classes/class-wcml-removed-cart-items-ui.php',
122
  'WCML_Reports' => __DIR__ . '/../..' . '/inc/class-wcml-reports.php',
123
  'WCML_Requests' => __DIR__ . '/../..' . '/inc/class-wcml-requests.php',
@@ -148,6 +422,7 @@ class ComposerStaticInitb173854862956f3a90ab8075e30fc2fd
148
  'WCML_Tab_Manager' => __DIR__ . '/../..' . '/compatibility/class-wcml-tab-manager.php',
149
  'WCML_Table_Rate_Shipping' => __DIR__ . '/../..' . '/compatibility/class-wcml-table-rate-shipping.php',
150
  'WCML_Terms' => __DIR__ . '/../..' . '/inc/class-wcml-terms.php',
 
151
  'WCML_Translation_Editor' => __DIR__ . '/../..' . '/inc/translation-editor/class-wcml-translation-editor.php',
152
  'WCML_Troubleshooting' => __DIR__ . '/../..' . '/inc/class-wcml-troubleshooting.php',
153
  'WCML_Troubleshooting_UI' => __DIR__ . '/../..' . '/inc/template-classes/class-wcml-troubleshooting-ui.php',
@@ -159,6 +434,7 @@ class ComposerStaticInitb173854862956f3a90ab8075e30fc2fd
159
  'WCML_WC_Ajax_Cart' => __DIR__ . '/../..' . '/compatibility/class-wcml-wc-ajax-cart.php',
160
  'WCML_WC_Gateways' => __DIR__ . '/../..' . '/inc/class-wcml-wc-gateways.php',
161
  'WCML_WC_Name_Your_Price' => __DIR__ . '/../..' . '/compatibility/class-wcml-wc-name-your-price.php',
 
162
  'WCML_WC_Shipping' => __DIR__ . '/../..' . '/inc/class-wcml-wc-shipping.php',
163
  'WCML_WC_Strings' => __DIR__ . '/../..' . '/inc/class-wcml-wc-strings.php',
164
  'WCML_WC_Subscriptions' => __DIR__ . '/../..' . '/compatibility/class-wcml-wc-subscriptions.php',
@@ -170,26 +446,26 @@ class ComposerStaticInitb173854862956f3a90ab8075e30fc2fd
170
  'WCML_wcExporter' => __DIR__ . '/../..' . '/compatibility/class-wcml-wcexporter.php',
171
  'WCML_xDomain_Data' => __DIR__ . '/../..' . '/inc/class-wcml-xdomain-data.php',
172
  'WPML_Auto_Loader' => __DIR__ . '/..' . '/wpml/commons/src/wpml-auto-loader.php',
173
- 'WPML_Cache_Directory' => __DIR__ . '/..' . '/wpml/commons/src/cache/class-wpml-cache-directory.php',
174
- 'WPML_Dependencies' => __DIR__ . '/..' . '/wpml/commons/src/dependencies/class-wpml-dependencies.php',
175
  'WPML_Notice' => __DIR__ . '/..' . '/wpml/commons/src/notices/class-wpml-notice.php',
176
  'WPML_Notice_Action' => __DIR__ . '/..' . '/wpml/commons/src/notices/class-wpml-notice-action.php',
177
  'WPML_Notice_Render' => __DIR__ . '/..' . '/wpml/commons/src/notices/class-wpml-notice-render.php',
178
  'WPML_Notices' => __DIR__ . '/..' . '/wpml/commons/src/notices/class-wpml-notices.php',
179
- 'WPML_Templates_Factory' => __DIR__ . '/../..' . '/inc/template-classes/class-wpml-templates-factory.php',
180
  'WPML_Twig_WP_Plugin_Extension' => __DIR__ . '/..' . '/wpml/commons/src/twig/twig-extensions/wpml-twig-wp-plugin-extension.php',
181
  'WPML_WP_API' => __DIR__ . '/..' . '/wpml/commons/src/wpml-wp/class-wpml-wp-api.php',
182
  'WooCommerce_Functions_Wrapper' => __DIR__ . '/../..' . '/inc/woocommerce-functions-wrapper.php',
183
  'woocommerce_wpml' => __DIR__ . '/../..' . '/inc/class-woocommerce-wpml.php',
 
 
184
  );
185
 
186
  public static function getInitializer(ClassLoader $loader)
187
  {
188
  return \Closure::bind(function () use ($loader) {
189
- $loader->prefixLengthsPsr4 = ComposerStaticInitb173854862956f3a90ab8075e30fc2fd::$prefixLengthsPsr4;
190
- $loader->prefixDirsPsr4 = ComposerStaticInitb173854862956f3a90ab8075e30fc2fd::$prefixDirsPsr4;
191
- $loader->prefixesPsr0 = ComposerStaticInitb173854862956f3a90ab8075e30fc2fd::$prefixesPsr0;
192
- $loader->classMap = ComposerStaticInitb173854862956f3a90ab8075e30fc2fd::$classMap;
193
 
194
  }, null, ClassLoader::class);
195
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitef9433f3fca31466e8742a1ca02f75ff
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'C' =>
38
  );
39
 
40
  public static $classMap = array (
41
+ 'Composer\\Installers\\AglInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AglInstaller.php',
42
+ 'Composer\\Installers\\AimeosInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AimeosInstaller.php',
43
+ 'Composer\\Installers\\AnnotateCmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php',
44
+ 'Composer\\Installers\\AsgardInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AsgardInstaller.php',
45
+ 'Composer\\Installers\\AttogramInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AttogramInstaller.php',
46
+ 'Composer\\Installers\\BaseInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/BaseInstaller.php',
47
+ 'Composer\\Installers\\BitrixInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/BitrixInstaller.php',
48
+ 'Composer\\Installers\\BonefishInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/BonefishInstaller.php',
49
+ 'Composer\\Installers\\CakePHPInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CakePHPInstaller.php',
50
+ 'Composer\\Installers\\ChefInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ChefInstaller.php',
51
+ 'Composer\\Installers\\ClanCatsFrameworkInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php',
52
+ 'Composer\\Installers\\CockpitInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CockpitInstaller.php',
53
+ 'Composer\\Installers\\CodeIgniterInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php',
54
+ 'Composer\\Installers\\Concrete5Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Concrete5Installer.php',
55
+ 'Composer\\Installers\\CraftInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CraftInstaller.php',
56
+ 'Composer\\Installers\\CroogoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CroogoInstaller.php',
57
+ 'Composer\\Installers\\DecibelInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DecibelInstaller.php',
58
+ 'Composer\\Installers\\DokuWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DokuWikiInstaller.php',
59
+ 'Composer\\Installers\\DolibarrInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DolibarrInstaller.php',
60
+ 'Composer\\Installers\\DrupalInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DrupalInstaller.php',
61
+ 'Composer\\Installers\\ElggInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ElggInstaller.php',
62
+ 'Composer\\Installers\\ExpressionEngineInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php',
63
+ 'Composer\\Installers\\FuelInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/FuelInstaller.php',
64
+ 'Composer\\Installers\\FuelphpInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/FuelphpInstaller.php',
65
+ 'Composer\\Installers\\GravInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/GravInstaller.php',
66
+ 'Composer\\Installers\\HuradInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/HuradInstaller.php',
67
+ 'Composer\\Installers\\ImageCMSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ImageCMSInstaller.php',
68
+ 'Composer\\Installers\\Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Installer.php',
69
+ 'Composer\\Installers\\JoomlaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/JoomlaInstaller.php',
70
+ 'Composer\\Installers\\KirbyInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KirbyInstaller.php',
71
+ 'Composer\\Installers\\KodiCMSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KodiCMSInstaller.php',
72
+ 'Composer\\Installers\\KohanaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KohanaInstaller.php',
73
+ 'Composer\\Installers\\LaravelInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LaravelInstaller.php',
74
+ 'Composer\\Installers\\LithiumInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LithiumInstaller.php',
75
+ 'Composer\\Installers\\MODULEWorkInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php',
76
+ 'Composer\\Installers\\MODXEvoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MODXEvoInstaller.php',
77
+ 'Composer\\Installers\\MagentoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MagentoInstaller.php',
78
+ 'Composer\\Installers\\MakoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MakoInstaller.php',
79
+ 'Composer\\Installers\\MauticInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MauticInstaller.php',
80
+ 'Composer\\Installers\\MediaWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MediaWikiInstaller.php',
81
+ 'Composer\\Installers\\MicroweberInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MicroweberInstaller.php',
82
+ 'Composer\\Installers\\MoodleInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MoodleInstaller.php',
83
+ 'Composer\\Installers\\OctoberInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OctoberInstaller.php',
84
+ 'Composer\\Installers\\OxidInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OxidInstaller.php',
85
+ 'Composer\\Installers\\PPIInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PPIInstaller.php',
86
+ 'Composer\\Installers\\PhiftyInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PhiftyInstaller.php',
87
+ 'Composer\\Installers\\PhpBBInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PhpBBInstaller.php',
88
+ 'Composer\\Installers\\PimcoreInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PimcoreInstaller.php',
89
+ 'Composer\\Installers\\PiwikInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PiwikInstaller.php',
90
+ 'Composer\\Installers\\PlentymarketsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php',
91
+ 'Composer\\Installers\\Plugin' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Plugin.php',
92
+ 'Composer\\Installers\\PrestashopInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PrestashopInstaller.php',
93
+ 'Composer\\Installers\\PuppetInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PuppetInstaller.php',
94
+ 'Composer\\Installers\\RadPHPInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php',
95
+ 'Composer\\Installers\\ReIndexInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php',
96
+ 'Composer\\Installers\\RedaxoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php',
97
+ 'Composer\\Installers\\RoundcubeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RoundcubeInstaller.php',
98
+ 'Composer\\Installers\\SMFInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SMFInstaller.php',
99
+ 'Composer\\Installers\\ShopwareInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ShopwareInstaller.php',
100
+ 'Composer\\Installers\\SilverStripeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SilverStripeInstaller.php',
101
+ 'Composer\\Installers\\Symfony1Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Symfony1Installer.php',
102
+ 'Composer\\Installers\\TYPO3CmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php',
103
+ 'Composer\\Installers\\TYPO3FlowInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php',
104
+ 'Composer\\Installers\\TheliaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TheliaInstaller.php',
105
+ 'Composer\\Installers\\TuskInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TuskInstaller.php',
106
+ 'Composer\\Installers\\VanillaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/VanillaInstaller.php',
107
+ 'Composer\\Installers\\WHMCSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/WHMCSInstaller.php',
108
+ 'Composer\\Installers\\WolfCMSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/WolfCMSInstaller.php',
109
+ 'Composer\\Installers\\WordPressInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/WordPressInstaller.php',
110
+ 'Composer\\Installers\\YawikInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/YawikInstaller.php',
111
+ 'Composer\\Installers\\ZendInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ZendInstaller.php',
112
+ 'Composer\\Installers\\ZikulaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ZikulaInstaller.php',
113
+ 'Twig_Autoloader' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Autoloader.php',
114
+ 'Twig_BaseNodeVisitor' => __DIR__ . '/..' . '/twig/twig/lib/Twig/BaseNodeVisitor.php',
115
+ 'Twig_CacheInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/CacheInterface.php',
116
+ 'Twig_Cache_Filesystem' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Cache/Filesystem.php',
117
+ 'Twig_Cache_Null' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Cache/Null.php',
118
+ 'Twig_Compiler' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Compiler.php',
119
+ 'Twig_CompilerInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/CompilerInterface.php',
120
+ 'Twig_ContainerRuntimeLoader' => __DIR__ . '/..' . '/twig/twig/lib/Twig/ContainerRuntimeLoader.php',
121
+ 'Twig_Environment' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Environment.php',
122
+ 'Twig_Error' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Error.php',
123
+ 'Twig_Error_Loader' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Error/Loader.php',
124
+ 'Twig_Error_Runtime' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Error/Runtime.php',
125
+ 'Twig_Error_Syntax' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Error/Syntax.php',
126
+ 'Twig_ExistsLoaderInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/ExistsLoaderInterface.php',
127
+ 'Twig_ExpressionParser' => __DIR__ . '/..' . '/twig/twig/lib/Twig/ExpressionParser.php',
128
+ 'Twig_Extension' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension.php',
129
+ 'Twig_ExtensionInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/ExtensionInterface.php',
130
+ 'Twig_Extension_Core' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Core.php',
131
+ 'Twig_Extension_Debug' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Debug.php',
132
+ 'Twig_Extension_Escaper' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Escaper.php',
133
+ 'Twig_Extension_GlobalsInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/GlobalsInterface.php',
134
+ 'Twig_Extension_InitRuntimeInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/InitRuntimeInterface.php',
135
+ 'Twig_Extension_Optimizer' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Optimizer.php',
136
+ 'Twig_Extension_Profiler' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Profiler.php',
137
+ 'Twig_Extension_Sandbox' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Sandbox.php',
138
+ 'Twig_Extension_Staging' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Staging.php',
139
+ 'Twig_Extension_StringLoader' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/StringLoader.php',
140
+ 'Twig_FactoryRuntimeLoader' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FactoryRuntimeLoader.php',
141
+ 'Twig_FileExtensionEscapingStrategy' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FileExtensionEscapingStrategy.php',
142
+ 'Twig_Filter' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Filter.php',
143
+ 'Twig_FilterCallableInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FilterCallableInterface.php',
144
+ 'Twig_FilterInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FilterInterface.php',
145
+ 'Twig_Filter_Function' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Filter/Function.php',
146
+ 'Twig_Filter_Method' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Filter/Method.php',
147
+ 'Twig_Filter_Node' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Filter/Node.php',
148
+ 'Twig_Function' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Function.php',
149
+ 'Twig_FunctionCallableInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FunctionCallableInterface.php',
150
+ 'Twig_FunctionInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FunctionInterface.php',
151
+ 'Twig_Function_Function' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Function/Function.php',
152
+ 'Twig_Function_Method' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Function/Method.php',
153
+ 'Twig_Function_Node' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Function/Node.php',
154
+ 'Twig_Lexer' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Lexer.php',
155
+ 'Twig_LexerInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/LexerInterface.php',
156
+ 'Twig_LoaderInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/LoaderInterface.php',
157
+ 'Twig_Loader_Array' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Loader/Array.php',
158
+ 'Twig_Loader_Chain' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Loader/Chain.php',
159
+ 'Twig_Loader_Filesystem' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Loader/Filesystem.php',
160
+ 'Twig_Loader_String' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Loader/String.php',
161
+ 'Twig_Markup' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Markup.php',
162
+ 'Twig_Node' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node.php',
163
+ 'Twig_NodeCaptureInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeCaptureInterface.php',
164
+ 'Twig_NodeInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeInterface.php',
165
+ 'Twig_NodeOutputInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeOutputInterface.php',
166
+ 'Twig_NodeTraverser' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeTraverser.php',
167
+ 'Twig_NodeVisitorInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeVisitorInterface.php',
168
+ 'Twig_NodeVisitor_Escaper' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeVisitor/Escaper.php',
169
+ 'Twig_NodeVisitor_Optimizer' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeVisitor/Optimizer.php',
170
+ 'Twig_NodeVisitor_SafeAnalysis' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php',
171
+ 'Twig_NodeVisitor_Sandbox' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeVisitor/Sandbox.php',
172
+ 'Twig_Node_AutoEscape' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/AutoEscape.php',
173
+ 'Twig_Node_Block' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Block.php',
174
+ 'Twig_Node_BlockReference' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/BlockReference.php',
175
+ 'Twig_Node_Body' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Body.php',
176
+ 'Twig_Node_CheckSecurity' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/CheckSecurity.php',
177
+ 'Twig_Node_Do' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Do.php',
178
+ 'Twig_Node_Embed' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Embed.php',
179
+ 'Twig_Node_Expression' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression.php',
180
+ 'Twig_Node_Expression_Array' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Array.php',
181
+ 'Twig_Node_Expression_AssignName' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/AssignName.php',
182
+ 'Twig_Node_Expression_Binary' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary.php',
183
+ 'Twig_Node_Expression_Binary_Add' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Add.php',
184
+ 'Twig_Node_Expression_Binary_And' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/And.php',
185
+ 'Twig_Node_Expression_Binary_BitwiseAnd' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php',
186
+ 'Twig_Node_Expression_Binary_BitwiseOr' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php',
187
+ 'Twig_Node_Expression_Binary_BitwiseXor' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php',
188
+ 'Twig_Node_Expression_Binary_Concat' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php',
189
+ 'Twig_Node_Expression_Binary_Div' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Div.php',
190
+ 'Twig_Node_Expression_Binary_EndsWith' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php',
191
+ 'Twig_Node_Expression_Binary_Equal' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php',
192
+ 'Twig_Node_Expression_Binary_FloorDiv' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php',
193
+ 'Twig_Node_Expression_Binary_Greater' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php',
194
+ 'Twig_Node_Expression_Binary_GreaterEqual' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php',
195
+ 'Twig_Node_Expression_Binary_In' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/In.php',
196
+ 'Twig_Node_Expression_Binary_Less' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Less.php',
197
+ 'Twig_Node_Expression_Binary_LessEqual' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php',
198
+ 'Twig_Node_Expression_Binary_Matches' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Matches.php',
199
+ 'Twig_Node_Expression_Binary_Mod' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php',
200
+ 'Twig_Node_Expression_Binary_Mul' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php',
201
+ 'Twig_Node_Expression_Binary_NotEqual' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php',
202
+ 'Twig_Node_Expression_Binary_NotIn' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php',
203
+ 'Twig_Node_Expression_Binary_Or' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Or.php',
204
+ 'Twig_Node_Expression_Binary_Power' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Power.php',
205
+ 'Twig_Node_Expression_Binary_Range' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Range.php',
206
+ 'Twig_Node_Expression_Binary_StartsWith' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php',
207
+ 'Twig_Node_Expression_Binary_Sub' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php',
208
+ 'Twig_Node_Expression_BlockReference' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/BlockReference.php',
209
+ 'Twig_Node_Expression_Call' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Call.php',
210
+ 'Twig_Node_Expression_Conditional' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Conditional.php',
211
+ 'Twig_Node_Expression_Constant' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Constant.php',
212
+ 'Twig_Node_Expression_ExtensionReference' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php',
213
+ 'Twig_Node_Expression_Filter' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Filter.php',
214
+ 'Twig_Node_Expression_Filter_Default' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Filter/Default.php',
215
+ 'Twig_Node_Expression_Function' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Function.php',
216
+ 'Twig_Node_Expression_GetAttr' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/GetAttr.php',
217
+ 'Twig_Node_Expression_MethodCall' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/MethodCall.php',
218
+ 'Twig_Node_Expression_Name' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Name.php',
219
+ 'Twig_Node_Expression_NullCoalesce' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/NullCoalesce.php',
220
+ 'Twig_Node_Expression_Parent' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Parent.php',
221
+ 'Twig_Node_Expression_TempName' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/TempName.php',
222
+ 'Twig_Node_Expression_Test' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test.php',
223
+ 'Twig_Node_Expression_Test_Constant' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test/Constant.php',
224
+ 'Twig_Node_Expression_Test_Defined' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test/Defined.php',
225
+ 'Twig_Node_Expression_Test_Divisibleby' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php',
226
+ 'Twig_Node_Expression_Test_Even' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test/Even.php',
227
+ 'Twig_Node_Expression_Test_Null' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test/Null.php',
228
+ 'Twig_Node_Expression_Test_Odd' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test/Odd.php',
229
+ 'Twig_Node_Expression_Test_Sameas' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php',
230
+ 'Twig_Node_Expression_Unary' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Unary.php',
231
+ 'Twig_Node_Expression_Unary_Neg' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php',
232
+ 'Twig_Node_Expression_Unary_Not' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Unary/Not.php',
233
+ 'Twig_Node_Expression_Unary_Pos' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php',
234
+ 'Twig_Node_Flush' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Flush.php',
235
+ 'Twig_Node_For' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/For.php',
236
+ 'Twig_Node_ForLoop' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/ForLoop.php',
237
+ 'Twig_Node_If' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/If.php',
238
+ 'Twig_Node_Import' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Import.php',
239
+ 'Twig_Node_Include' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Include.php',
240
+ 'Twig_Node_Macro' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Macro.php',
241
+ 'Twig_Node_Module' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Module.php',
242
+ 'Twig_Node_Print' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Print.php',
243
+ 'Twig_Node_Sandbox' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Sandbox.php',
244
+ 'Twig_Node_SandboxedPrint' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/SandboxedPrint.php',
245
+ 'Twig_Node_Set' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Set.php',
246
+ 'Twig_Node_SetTemp' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/SetTemp.php',
247
+ 'Twig_Node_Spaceless' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Spaceless.php',
248
+ 'Twig_Node_Text' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Text.php',
249
+ 'Twig_Node_With' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/With.php',
250
+ 'Twig_Parser' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Parser.php',
251
+ 'Twig_ParserInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/ParserInterface.php',
252
+ 'Twig_Profiler_Dumper_Blackfire' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php',
253
+ 'Twig_Profiler_Dumper_Html' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/Dumper/Html.php',
254
+ 'Twig_Profiler_Dumper_Text' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/Dumper/Text.php',
255
+ 'Twig_Profiler_NodeVisitor_Profiler' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/NodeVisitor/Profiler.php',
256
+ 'Twig_Profiler_Node_EnterProfile' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/Node/EnterProfile.php',
257
+ 'Twig_Profiler_Node_LeaveProfile' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/Node/LeaveProfile.php',
258
+ 'Twig_Profiler_Profile' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/Profile.php',
259
+ 'Twig_RuntimeLoaderInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/RuntimeLoaderInterface.php',
260
+ 'Twig_Sandbox_SecurityError' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityError.php',
261
+ 'Twig_Sandbox_SecurityNotAllowedFilterError' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFilterError.php',
262
+ 'Twig_Sandbox_SecurityNotAllowedFunctionError' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFunctionError.php',
263
+ 'Twig_Sandbox_SecurityNotAllowedMethodError' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedMethodError.php',
264
+ 'Twig_Sandbox_SecurityNotAllowedPropertyError' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedPropertyError.php',
265
+ 'Twig_Sandbox_SecurityNotAllowedTagError' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php',
266
+ 'Twig_Sandbox_SecurityPolicy' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php',
267
+ 'Twig_Sandbox_SecurityPolicyInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php',
268
+ 'Twig_SimpleFilter' => __DIR__ . '/..' . '/twig/twig/lib/Twig/SimpleFilter.php',
269
+ 'Twig_SimpleFunction' => __DIR__ . '/..' . '/twig/twig/lib/Twig/SimpleFunction.php',
270
+ 'Twig_SimpleTest' => __DIR__ . '/..' . '/twig/twig/lib/Twig/SimpleTest.php',
271
+ 'Twig_Source' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Source.php',
272
+ 'Twig_SourceContextLoaderInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/SourceContextLoaderInterface.php',
273
+ 'Twig_Template' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Template.php',
274
+ 'Twig_TemplateInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TemplateInterface.php',
275
+ 'Twig_TemplateWrapper' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TemplateWrapper.php',
276
+ 'Twig_Test' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Test.php',
277
+ 'Twig_TestCallableInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TestCallableInterface.php',
278
+ 'Twig_TestInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TestInterface.php',
279
+ 'Twig_Test_Function' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Test/Function.php',
280
+ 'Twig_Test_IntegrationTestCase' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Test/IntegrationTestCase.php',
281
+ 'Twig_Test_Method' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Test/Method.php',
282
+ 'Twig_Test_Node' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Test/Node.php',
283
+ 'Twig_Test_NodeTestCase' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Test/NodeTestCase.php',
284
+ 'Twig_Token' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Token.php',
285
+ 'Twig_TokenParser' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser.php',
286
+ 'Twig_TokenParserBroker' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParserBroker.php',
287
+ 'Twig_TokenParserBrokerInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParserBrokerInterface.php',
288
+ 'Twig_TokenParserInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParserInterface.php',
289
+ 'Twig_TokenParser_AutoEscape' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/AutoEscape.php',
290
+ 'Twig_TokenParser_Block' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Block.php',
291
+ 'Twig_TokenParser_Do' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Do.php',
292
+ 'Twig_TokenParser_Embed' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Embed.php',
293
+ 'Twig_TokenParser_Extends' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Extends.php',
294
+ 'Twig_TokenParser_Filter' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Filter.php',
295
+ 'Twig_TokenParser_Flush' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Flush.php',
296
+ 'Twig_TokenParser_For' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/For.php',
297
+ 'Twig_TokenParser_From' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/From.php',
298
+ 'Twig_TokenParser_If' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/If.php',
299
+ 'Twig_TokenParser_Import' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Import.php',
300
+ 'Twig_TokenParser_Include' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Include.php',
301
+ 'Twig_TokenParser_Macro' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Macro.php',
302
+ 'Twig_TokenParser_Sandbox' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Sandbox.php',
303
+ 'Twig_TokenParser_Set' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Set.php',
304
+ 'Twig_TokenParser_Spaceless' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Spaceless.php',
305
+ 'Twig_TokenParser_Use' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Use.php',
306
+ 'Twig_TokenParser_With' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/With.php',
307
+ 'Twig_TokenStream' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenStream.php',
308
+ 'Twig_Util_DeprecationCollector' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Util/DeprecationCollector.php',
309
+ 'Twig_Util_TemplateDirIterator' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Util/TemplateDirIterator.php',
310
  'WCML_Accommodation_Bookings' => __DIR__ . '/../..' . '/compatibility/class-wcml-accommodation-bookings.php',
311
  'WCML_Admin_Currency_Selector' => __DIR__ . '/../..' . '/inc/currencies/class-wcml-admin-currency-selector.php',
312
  'WCML_Admin_Menus' => __DIR__ . '/../..' . '/inc/admin-menus/class-wcml-admin-menus.php',
329
  'WCML_Composite_Products' => __DIR__ . '/../..' . '/compatibility/class-wcml-composite-products.php',
330
  'WCML_Coupons' => __DIR__ . '/../..' . '/inc/class-wcml-coupons.php',
331
  'WCML_Currencies' => __DIR__ . '/../..' . '/inc/currencies/class-wcml-currencies.php',
332
+ 'WCML_Currency_Switcher' => __DIR__ . '/../..' . '/inc/currencies/currency-switcher/class-wcml-currency-switcher.php',
333
+ 'WCML_Currency_Switcher_Ajax' => __DIR__ . '/../..' . '/inc/currencies/currency-switcher/class-wcml-currency-switcher-ajax.php',
334
+ 'WCML_Currency_Switcher_Options_Dialog' => __DIR__ . '/../..' . '/inc/template-classes/currency-switcher/class-wcml-currency-switcher-options-dialog.php',
335
+ 'WCML_Currency_Switcher_Template' => __DIR__ . '/../..' . '/inc/template-classes/currency-switcher/class-wcml-currency-switcher-template.php',
336
+ 'WCML_Currency_Switcher_Templates' => __DIR__ . '/../..' . '/inc/currencies/currency-switcher/class-wcml-currency-switcher-templates.php',
337
+ 'WCML_Currency_Switcher_Widget' => __DIR__ . '/../..' . '/inc/currencies/currency-switcher/class-wcml-currency-switcher-widget.php',
338
  'WCML_Custom_Currency_Options' => __DIR__ . '/../..' . '/inc/template-classes/multi-currency/class-wcml-custom-currency-options.php',
339
  'WCML_Custom_Files_UI' => __DIR__ . '/../..' . '/inc/template-classes/class-wcml-custom-files-ui.php',
340
  'WCML_Custom_Prices' => __DIR__ . '/../..' . '/inc/currencies/class-wcml-custom-prices.php',
345
  'WCML_Dynamic_Pricing' => __DIR__ . '/../..' . '/compatibility/class-wcml-dynamic-pricing.php',
346
  'WCML_Editor_Save_Filters' => __DIR__ . '/../..' . '/inc/translation-editor/class-wcml-editor-save-filters.php',
347
  'WCML_Editor_UI_Product_Job' => __DIR__ . '/../..' . '/inc/translation-editor/class-wcml-editor-ui-product-job.php',
348
+ 'WCML_Editor_UI_WYSIWYG_Field' => __DIR__ . '/../..' . '/inc/translation-editor/class-wcml-editor-ui-wysiwyg-field.php',
349
  'WCML_Emails' => __DIR__ . '/../..' . '/inc/class-wcml-emails.php',
350
  'WCML_Endpoints' => __DIR__ . '/../..' . '/inc/class-wcml-endpoints.php',
351
  'WCML_Exchange_Rate_Service' => __DIR__ . '/../..' . '/inc/abstracts/class-wcml-exchange-rate-service.php',
387
  'WCML_Pointers' => __DIR__ . '/../..' . '/inc/admin-menus/class-wcml-pointers.php',
388
  'WCML_Product_Addons' => __DIR__ . '/../..' . '/compatibility/class-wcml-product-addons.php',
389
  'WCML_Product_Bundles' => __DIR__ . '/../..' . '/compatibility/class-wcml-product-bundles.php',
390
+ 'WCML_Product_Bundles_Legacy' => __DIR__ . '/../..' . '/compatibility/class-wcml-product-bundles-legacy.php',
391
  'WCML_Products' => __DIR__ . '/../..' . '/inc/class-wcml-products.php',
392
  'WCML_Products_Screen_Options' => __DIR__ . '/../..' . '/inc/class-wcml-products-screen-options.php',
393
  'WCML_Products_UI' => __DIR__ . '/../..' . '/inc/template-classes/class-wcml-products-ui.php',
394
+ 'WCML_REST_API_Support' => __DIR__ . '/../..' . '/inc/rest-api-support/class-wcml-rest-api-suport.php',
395
  'WCML_Removed_Cart_Items_UI' => __DIR__ . '/../..' . '/inc/template-classes/class-wcml-removed-cart-items-ui.php',
396
  'WCML_Reports' => __DIR__ . '/../..' . '/inc/class-wcml-reports.php',
397
  'WCML_Requests' => __DIR__ . '/../..' . '/inc/class-wcml-requests.php',
422
  'WCML_Tab_Manager' => __DIR__ . '/../..' . '/compatibility/class-wcml-tab-manager.php',
423
  'WCML_Table_Rate_Shipping' => __DIR__ . '/../..' . '/compatibility/class-wcml-table-rate-shipping.php',
424
  'WCML_Terms' => __DIR__ . '/../..' . '/inc/class-wcml-terms.php',
425
+ 'WCML_The_Events_Calendar' => __DIR__ . '/../..' . '/compatibility/class-wcml-the-events-calendar.php',
426
  'WCML_Translation_Editor' => __DIR__ . '/../..' . '/inc/translation-editor/class-wcml-translation-editor.php',
427
  'WCML_Troubleshooting' => __DIR__ . '/../..' . '/inc/class-wcml-troubleshooting.php',
428
  'WCML_Troubleshooting_UI' => __DIR__ . '/../..' . '/inc/template-classes/class-wcml-troubleshooting-ui.php',
434
  'WCML_WC_Ajax_Cart' => __DIR__ . '/../..' . '/compatibility/class-wcml-wc-ajax-cart.php',
435
  'WCML_WC_Gateways' => __DIR__ . '/../..' . '/inc/class-wcml-wc-gateways.php',
436
  'WCML_WC_Name_Your_Price' => __DIR__ . '/../..' . '/compatibility/class-wcml-wc-name-your-price.php',
437
+ 'WCML_WC_Product_Bundles_Items' => __DIR__ . '/../..' . '/compatibility/includes/class-wcml-wc-product-bundles-items.php',
438
  'WCML_WC_Shipping' => __DIR__ . '/../..' . '/inc/class-wcml-wc-shipping.php',
439
  'WCML_WC_Strings' => __DIR__ . '/../..' . '/inc/class-wcml-wc-strings.php',
440
  'WCML_WC_Subscriptions' => __DIR__ . '/../..' . '/compatibility/class-wcml-wc-subscriptions.php',
446
  'WCML_wcExporter' => __DIR__ . '/../..' . '/compatibility/class-wcml-wcexporter.php',
447
  'WCML_xDomain_Data' => __DIR__ . '/../..' . '/inc/class-wcml-xdomain-data.php',
448
  'WPML_Auto_Loader' => __DIR__ . '/..' . '/wpml/commons/src/wpml-auto-loader.php',
 
 
449
  'WPML_Notice' => __DIR__ . '/..' . '/wpml/commons/src/notices/class-wpml-notice.php',
450
  'WPML_Notice_Action' => __DIR__ . '/..' . '/wpml/commons/src/notices/class-wpml-notice-action.php',
451
  'WPML_Notice_Render' => __DIR__ . '/..' . '/wpml/commons/src/notices/class-wpml-notice-render.php',
452
  'WPML_Notices' => __DIR__ . '/..' . '/wpml/commons/src/notices/class-wpml-notices.php',
453
+ 'WPML_Templates_Factory' => __DIR__ . '/..' . '/wpml/commons/src/templating/class-wpml-templates-factory.php',
454
  'WPML_Twig_WP_Plugin_Extension' => __DIR__ . '/..' . '/wpml/commons/src/twig/twig-extensions/wpml-twig-wp-plugin-extension.php',
455
  'WPML_WP_API' => __DIR__ . '/..' . '/wpml/commons/src/wpml-wp/class-wpml-wp-api.php',
456
  'WooCommerce_Functions_Wrapper' => __DIR__ . '/../..' . '/inc/woocommerce-functions-wrapper.php',
457
  'woocommerce_wpml' => __DIR__ . '/../..' . '/inc/class-woocommerce-wpml.php',
458
+ 'xrstf\\Composer52\\AutoloadGenerator' => __DIR__ . '/..' . '/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php',
459
+ 'xrstf\\Composer52\\Generator' => __DIR__ . '/..' . '/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php',
460
  );
461
 
462
  public static function getInitializer(ClassLoader $loader)
463
  {
464
  return \Closure::bind(function () use ($loader) {
465
+ $loader->prefixLengthsPsr4 = ComposerStaticInitef9433f3fca31466e8742a1ca02f75ff::$prefixLengthsPsr4;
466
+ $loader->prefixDirsPsr4 = ComposerStaticInitef9433f3fca31466e8742a1ca02f75ff::$prefixDirsPsr4;
467
+ $loader->prefixesPsr0 = ComposerStaticInitef9433f3fca31466e8742a1ca02f75ff::$prefixesPsr0;
468
+ $loader->classMap = ComposerStaticInitef9433f3fca31466e8742a1ca02f75ff::$classMap;
469
 
470
  }, null, ClassLoader::class);
471
  }
vendor/otgs/installer/includes/class-installer-dependencies.php CHANGED
@@ -1,278 +1,278 @@
1
- <?php
2
-
3
- class Installer_Dependencies{
4
-
5
- private $uploading_allowed = null;
6
- private $is_win_paths_exception = array();
7
-
8
-
9
- function __construct(){
10
-
11
- add_action( 'admin_init', array( $this, 'prevent_plugins_update_on_plugins_page' ), 100);
12
-
13
-
14
-
15
- global $pagenow;
16
- if($pagenow == 'update.php'){
17
- if(isset($_GET['action']) && $_GET['action'] == 'update-selected'){
18
- add_action('admin_head', array($this, 'prevent_plugins_update_on_updates_screen')); //iframe/bulk
19
- }else{
20
- add_action('all_admin_notices', array($this, 'prevent_plugins_update_on_updates_screen')); //regular/singular
21
- }
22
- }
23
- add_action('wp_ajax_update-plugin', array($this, 'prevent_plugins_update_on_updates_screen'), 0); // high priority, before WP
24
-
25
- }
26
-
27
- public function is_win_paths_exception($repository_id){
28
-
29
- if(!isset($this->is_win_paths_exception[$repository_id])) {
30
-
31
- $this->is_win_paths_exception[$repository_id] = false;
32
-
33
- if ( strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN' ) {
34
-
35
- $windows_max_path_length = 256;
36
- $longest_path['wpml'] = 109;
37
- $longest_path['toolset'] = 99;
38
-
39
- $margin = 15;
40
-
41
- $upgrade_path_length = strlen( WP_CONTENT_DIR . '/upgrade' );
42
-
43
- $installer_settings = WP_Installer()->settings;
44
-
45
- if ( is_array( $installer_settings['repositories'][$repository_id]['data']['downloads']['plugins'] ) ) {
46
- $a_plugin = current( $installer_settings['repositories'][$repository_id]['data']['downloads']['plugins'] );
47
- $url = WP_Installer()->append_site_key_to_download_url( $a_plugin['url'], 'xxxxxx', $repository_id );
48
- $tmpfname = wp_tempnam( $url );
49
-
50
- $tmpname_length = strlen( basename( $tmpfname ) ) - 4; // -.tmp
51
-
52
- if ( $upgrade_path_length + $tmpname_length + $longest_path[$repository_id] + $margin > $windows_max_path_length ) {
53
-
54
- $this->is_win_paths_exception[$repository_id] = true;
55
-
56
- }
57
-
58
- }
59
-
60
-
61
- }
62
-
63
- }
64
-
65
- return $this->is_win_paths_exception[$repository_id];
66
-
67
- }
68
-
69
- public function is_uploading_allowed(){
70
-
71
- if(!isset($this->uploading_allowed)){
72
- require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
73
- require_once WP_Installer()->plugin_path() . '/includes/installer-upgrader-skins.php';
74
-
75
- $upgrader_skins = new Installer_Upgrader_Skins(); //use our custom (mute) Skin
76
- $upgrader = new Plugin_Upgrader($upgrader_skins);
77
-
78
- ob_start();
79
- $res = $upgrader->fs_connect( array(WP_CONTENT_DIR, WP_PLUGIN_DIR) );
80
- ob_end_clean();
81
-
82
- if ( ! $res || is_wp_error( $res ) ) {
83
- $this->uploading_allowed = false;
84
- }else{
85
- $this->uploading_allowed = true;
86
- }
87
- }
88
-
89
- return $this->uploading_allowed;
90
-
91
- }
92
-
93
- public function cant_download($repository_id){
94
-
95
- return !$this->is_uploading_allowed() || $this->is_win_paths_exception($repository_id);
96
-
97
- }
98
-
99
- public function win_paths_exception_message(){
100
- return __('Downloading is not possible. WordPress cannot create required folders because of the
101
- 256 characters limitation of the current Windows environment.', 'installer');
102
- }
103
-
104
- public function prevent_plugins_update_on_plugins_page(){
105
-
106
- $plugins = get_site_transient( 'update_plugins' );
107
- if ( isset($plugins->response) && is_array($plugins->response) ) {
108
- $plugins_with_updates = array_keys( $plugins->response );
109
- }
110
-
111
- if( !empty($plugins_with_updates) ) {
112
-
113
- $plugins = get_plugins();
114
-
115
- $installer_settings = WP_Installer()->settings;
116
- foreach ($installer_settings['repositories'] as $repository_id => $repository) {
117
-
118
- if ($this->is_win_paths_exception($repository_id)) {
119
-
120
- $repositories_plugins = array();
121
- foreach ($repository['data']['packages'] as $package) {
122
- foreach ($package['products'] as $product) {
123
- foreach ($product['plugins'] as $plugin_slug) {
124
- $download = $installer_settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
125
- if ( empty($download['free-on-wporg']) ) {
126
- $repositories_plugins[$download['slug']] = $download['name'];
127
- }
128
- }
129
- }
130
- }
131
-
132
- foreach ($plugins as $plugin_id => $plugin) {
133
-
134
- if( in_array( $plugin_id, $plugins_with_updates ) ) {
135
-
136
- $wp_plugin_slug = dirname($plugin_id);
137
- if (empty($wp_plugin_slug)) {
138
- $wp_plugin_slug = basename($plugin_id, '.php');
139
- }
140
-
141
- foreach ($repositories_plugins as $slug => $name) {
142
- if ($wp_plugin_slug == $slug || $name == $plugin['Name'] || $name == $plugin['Title']) { //match order: slug, name, title
143
-
144
- remove_action("after_plugin_row_$plugin_id", 'wp_plugin_update_row', 10, 2);
145
- add_action("after_plugin_row_$plugin_id", array($this, 'wp_plugin_update_row_win_exception'), 10, 2);
146
-
147
- }
148
- }
149
-
150
- }
151
-
152
- }
153
-
154
- }
155
-
156
-
157
- }
158
-
159
- }
160
-
161
- }
162
-
163
- public function wp_plugin_update_row_win_exception(){
164
- $wp_list_table = _get_list_table('WP_Plugins_List_Table');
165
- echo '<tr class="plugin-update-tr">';
166
- echo '<td class="plugin-update colspanchange" colspan="' . esc_attr( $wp_list_table->get_column_count() ) .
167
- '"><div class="update-message">' . $this->win_paths_exception_message() . '</div></td>';
168
- echo '</tr>';
169
- }
170
-
171
- public function prevent_plugins_update_on_updates_screen(){
172
-
173
- if ( isset($_REQUEST['action']) ) {
174
-
175
- $action = isset($_REQUEST['action']) ? sanitize_text_field ( $_REQUEST['action'] ) : '';
176
-
177
- $installer_settings = WP_Installer()->settings;
178
-
179
- //bulk mode
180
- if('update-selected' == $action) {
181
-
182
- global $plugins;
183
-
184
- if(isset($plugins) && is_array($plugins)) {
185
-
186
- foreach ($plugins as $k => $plugin) {
187
-
188
- $wp_plugin_slug = dirname($plugin);
189
-
190
- foreach ($installer_settings['repositories'] as $repository_id => $repository) {
191
-
192
- if( $this->is_win_paths_exception($repository_id) ){
193
-
194
- foreach ($repository['data']['packages'] as $package) {
195
-
196
- foreach ($package['products'] as $product) {
197
-
198
- foreach ($product['plugins'] as $plugin_slug) {
199
-
200
- $download = $installer_settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
201
-
202
- if ($download['slug'] == $wp_plugin_slug && empty($download['free-on-wporg']) ) {
203
-
204
- echo '<div class="updated error"><p>' . $this->win_paths_exception_message() .
205
- ' <strong>(' . $download['name'] . ')</strong>' . '</p></div>';
206
- unset($plugins[$k]);
207
-
208
- break(3);
209
-
210
- }
211
-
212
- }
213
-
214
- }
215
-
216
- }
217
-
218
-
219
- }
220
-
221
- }
222
-
223
- }
224
-
225
- }
226
-
227
- }
228
-
229
-
230
- if( 'upgrade-plugin' == $action || 'update-plugin' == $action ) {
231
-
232
- $plugin = isset($_REQUEST['plugin']) ? trim( sanitize_text_field ( $_REQUEST['plugin'] ) ) : '';
233
-
234
- $wp_plugin_slug = dirname($plugin);
235
-
236
- foreach($installer_settings['repositories'] as $repository_id => $repository){
237
-
238
- if( $this->is_win_paths_exception( $repository_id ) ) {
239
- foreach ($repository['data']['packages'] as $package) {
240
-
241
- foreach($package['products'] as $product) {
242
-
243
- foreach($product['plugins'] as $plugin_slug) {
244
- $download = $installer_settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
245
-
246
- //match by folder, will change to match by name and folder
247
- if ( $download['slug'] == $wp_plugin_slug && empty ($download['free-on-wporg'] ) ) {
248
-
249
- echo '<div class="updated error"><p>' . $this->win_paths_exception_message() . '</p></div>';
250
-
251
- echo '<div class="wrap">';
252
- echo '<h2>' . __('Update Plugin') . '</h2>';
253
- echo '<a href="' . admin_url('update-core.php') . '">' . __('Return to the updates page', 'installer') . '</a>';
254
- echo '</div>';
255
- require_once(ABSPATH . 'wp-admin/admin-footer.php');
256
- exit;
257
-
258
- }
259
-
260
- }
261
-
262
- }
263
-
264
- }
265
- }
266
-
267
- }
268
-
269
- }
270
- }
271
-
272
- }
273
-
274
-
275
- }
276
-
277
-
278
-
1
+ <?php
2
+
3
+ class Installer_Dependencies{
4
+
5
+ private $uploading_allowed = null;
6
+ private $is_win_paths_exception = array();
7
+
8
+
9
+ function __construct(){
10
+
11
+ add_action( 'admin_init', array( $this, 'prevent_plugins_update_on_plugins_page' ), 100);
12
+
13
+
14
+
15
+ global $pagenow;
16
+ if($pagenow == 'update.php'){
17
+ if(isset($_GET['action']) && $_GET['action'] == 'update-selected'){
18
+ add_action('admin_head', array($this, 'prevent_plugins_update_on_updates_screen')); //iframe/bulk
19
+ }else{
20
+ add_action('all_admin_notices', array($this, 'prevent_plugins_update_on_updates_screen')); //regular/singular
21
+ }
22
+ }
23
+ add_action('wp_ajax_update-plugin', array($this, 'prevent_plugins_update_on_updates_screen'), 0); // high priority, before WP
24
+
25
+ }
26
+
27
+ public function is_win_paths_exception($repository_id){
28
+
29
+ if(!isset($this->is_win_paths_exception[$repository_id])) {
30
+
31
+ $this->is_win_paths_exception[$repository_id] = false;
32
+
33
+ if ( strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN' ) {
34
+
35
+ $windows_max_path_length = 256;
36
+ $longest_path['wpml'] = 109;
37
+ $longest_path['toolset'] = 99;
38
+
39
+ $margin = 15;
40
+
41
+ $upgrade_path_length = strlen( WP_CONTENT_DIR . '/upgrade' );
42
+
43
+ $installer_settings = WP_Installer()->settings;
44
+
45
+ if ( is_array( $installer_settings['repositories'][$repository_id]['data']['downloads']['plugins'] ) ) {
46
+ $a_plugin = current( $installer_settings['repositories'][$repository_id]['data']['downloads']['plugins'] );
47
+ $url = WP_Installer()->append_site_key_to_download_url( $a_plugin['url'], 'xxxxxx', $repository_id );
48
+ $tmpfname = wp_tempnam( $url );
49
+
50
+ $tmpname_length = strlen( basename( $tmpfname ) ) - 4; // -.tmp
51
+
52
+ if ( $upgrade_path_length + $tmpname_length + $longest_path[$repository_id] + $margin > $windows_max_path_length ) {
53
+
54
+ $this->is_win_paths_exception[$repository_id] = true;
55
+
56
+ }
57
+
58
+ }
59
+
60
+
61
+ }
62
+
63
+ }
64
+
65
+ return $this->is_win_paths_exception[$repository_id];
66
+
67
+ }
68
+
69
+ public function is_uploading_allowed(){
70
+
71
+ if(!isset($this->uploading_allowed)){
72
+ require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
73
+ require_once WP_Installer()->plugin_path() . '/includes/installer-upgrader-skins.php';
74
+
75
+ $upgrader_skins = new Installer_Upgrader_Skins(); //use our custom (mute) Skin
76
+ $upgrader = new Plugin_Upgrader($upgrader_skins);
77
+
78
+ ob_start();
79
+ $res = $upgrader->fs_connect( array(WP_CONTENT_DIR, WP_PLUGIN_DIR) );
80
+ ob_end_clean();
81
+
82
+ if ( ! $res || is_wp_error( $res ) ) {
83
+ $this->uploading_allowed = false;
84
+ }else{
85
+ $this->uploading_allowed = true;
86
+ }
87
+ }
88
+
89
+ return $this->uploading_allowed;
90
+
91
+ }
92
+
93
+ public function cant_download($repository_id){
94
+
95
+ return !$this->is_uploading_allowed() || $this->is_win_paths_exception($repository_id);
96
+
97
+ }
98
+
99
+ public function win_paths_exception_message(){
100
+ return __('Downloading is not possible. WordPress cannot create required folders because of the
101
+ 256 characters limitation of the current Windows environment.', 'installer');
102
+ }
103
+
104
+ public function prevent_plugins_update_on_plugins_page(){
105
+
106
+ $plugins = get_site_transient( 'update_plugins' );
107
+ if ( isset($plugins->response) && is_array($plugins->response) ) {
108
+ $plugins_with_updates = array_keys( $plugins->response );
109
+ }
110
+
111
+ if( !empty($plugins_with_updates) ) {
112
+
113
+ $plugins = get_plugins();
114
+
115
+ $installer_settings = WP_Installer()->settings;
116
+ foreach ($installer_settings['repositories'] as $repository_id => $repository) {
117
+
118
+ if ($this->is_win_paths_exception($repository_id)) {
119
+
120
+ $repositories_plugins = array();
121
+ foreach ($repository['data']['packages'] as $package) {
122
+ foreach ($package['products'] as $product) {
123
+ foreach ($product['plugins'] as $plugin_slug) {
124
+ $download = $installer_settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
125
+ if ( empty($download['free-on-wporg']) ) {
126
+ $repositories_plugins[$download['slug']] = $download['name'];
127
+ }
128
+ }
129
+ }
130
+ }
131
+
132
+ foreach ($plugins as $plugin_id => $plugin) {
133
+
134
+ if( in_array( $plugin_id, $plugins_with_updates ) ) {
135
+
136
+ $wp_plugin_slug = dirname($plugin_id);
137
+ if (empty($wp_plugin_slug)) {
138
+ $wp_plugin_slug = basename($plugin_id, '.php');
139
+ }
140
+
141
+ foreach ($repositories_plugins as $slug => $name) {
142
+ if ($wp_plugin_slug == $slug || $name == $plugin['Name'] || $name == $plugin['Title']) { //match order: slug, name, title
143
+
144
+ remove_action("after_plugin_row_$plugin_id", 'wp_plugin_update_row', 10, 2);
145
+ add_action("after_plugin_row_$plugin_id", array($this, 'wp_plugin_update_row_win_exception'), 10, 2);
146
+
147
+ }
148
+ }
149
+
150
+ }
151
+
152
+ }
153
+
154
+ }
155
+
156
+
157
+ }
158
+
159
+ }
160
+
161
+ }
162
+
163
+ public function wp_plugin_update_row_win_exception(){
164
+ $wp_list_table = _get_list_table('WP_Plugins_List_Table');
165
+ echo '<tr class="plugin-update-tr">';
166
+ echo '<td class="plugin-update colspanchange" colspan="' . esc_attr( $wp_list_table->get_column_count() ) .
167
+ '"><div class="update-message">' . $this->win_paths_exception_message() . '</div></td>';
168
+ echo '</tr>';
169
+ }
170
+
171
+ public function prevent_plugins_update_on_updates_screen(){
172
+
173
+ if ( isset($_REQUEST['action']) ) {
174
+
175
+ $action = isset($_REQUEST['action']) ? sanitize_text_field ( $_REQUEST['action'] ) : '';
176
+
177
+ $installer_settings = WP_Installer()->settings;
178
+
179
+ //bulk mode
180
+ if('update-selected' == $action) {
181
+
182
+ global $plugins;
183
+
184
+ if(isset($plugins) && is_array($plugins)) {
185
+
186
+ foreach ($plugins as $k => $plugin) {
187
+
188
+ $wp_plugin_slug = dirname($plugin);
189
+
190
+ foreach ($installer_settings['repositories'] as $repository_id => $repository) {
191
+
192
+ if( $this->is_win_paths_exception($repository_id) ){
193
+
194
+ foreach ($repository['data']['packages'] as $package) {
195
+
196
+ foreach ($package['products'] as $product) {
197
+
198
+ foreach ($product['plugins'] as $plugin_slug) {
199
+
200
+ $download = $installer_settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
201
+
202
+ if ($download['slug'] == $wp_plugin_slug && empty($download['free-on-wporg']) ) {
203
+
204
+ echo '<div class="updated error"><p>' . $this->win_paths_exception_message() .
205
+ ' <strong>(' . $download['name'] . ')</strong>' . '</p></div>';
206
+ unset($plugins[$k]);
207
+
208
+ break(3);
209
+
210
+ }
211
+
212
+ }
213
+
214
+ }
215
+
216
+ }
217
+
218
+
219
+ }
220
+
221
+ }
222
+
223
+ }
224
+
225
+ }
226
+
227
+ }
228
+
229
+
230
+ if( 'upgrade-plugin' == $action || 'update-plugin' == $action ) {
231
+
232
+ $plugin = isset($_REQUEST['plugin']) ? trim( sanitize_text_field ( $_REQUEST['plugin'] ) ) : '';
233
+
234
+ $wp_plugin_slug = dirname($plugin);
235
+
236
+ foreach($installer_settings['repositories'] as $repository_id => $repository){
237
+
238
+ if( $this->is_win_paths_exception( $repository_id ) ) {
239
+ foreach ($repository['data']['packages'] as $package) {
240
+
241
+ foreach($package['products'] as $product) {
242
+
243
+ foreach($product['plugins'] as $plugin_slug) {
244
+ $download = $installer_settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
245
+
246
+ //match by folder, will change to match by name and folder
247
+ if ( $download['slug'] == $wp_plugin_slug && empty ($download['free-on-wporg'] ) ) {
248
+
249
+ echo '<div class="updated error"><p>' . $this->win_paths_exception_message() . '</p></div>';
250
+
251
+ echo '<div class="wrap">';
252
+ echo '<h2>' . __('Update Plugin') . '</h2>';
253
+ echo '<a href="' . admin_url('update-core.php') . '">' . __('Return to the updates page', 'installer') . '</a>';
254
+ echo '</div>';
255
+ require_once(ABSPATH . 'wp-admin/admin-footer.php');
256
+ exit;
257
+
258
+ }
259
+
260
+ }
261
+
262
+ }
263
+
264
+ }
265
+ }
266
+
267
+ }
268
+
269
+ }
270
+ }
271
+
272
+ }
273
+
274
+
275
+ }
276
+
277
+
278
+
vendor/otgs/installer/includes/class-installer-theme.php CHANGED
@@ -1,979 +1,979 @@
1
- <?php
2
- /**
3
- * Installer Class for Theme Support
4
- *
5
- * Supports automatic updates and installation of Toolset/WPML Themes
6
- *
7
- * @class Installer_Theme_Class
8
- * @version 1.6
9
- * @category Class
10
- * @author OnTheGoSystems
11
- */
12
-
13
- if ( !defined( 'ABSPATH' ) ) {
14
- exit;
15
- }
16
-
17
- /**
18
- * Installer_Theme_Class
19
- */
20
- class Installer_Theme_Class {
21
-
22
- /** Theme Repository */
23
- private $theme_repo;
24
-
25
- /** Repository API */
26
- private $repository_api;
27
-
28
- /** Repository Theme Products */
29
- private $repository_theme_products;
30
-
31
- /** Site URL */
32
- private $installer_site_url;
33
-
34
- /** Site Key */
35
- private $installer_site_key;
36
-
37
- /** The Themes Option */
38
- protected $installer_themes_option;
39
-
40
- /** Update settings */
41
- protected $installer_themes_available_updates;
42
-
43
- /** The Themes */
44
- protected $installer_themes = array();
45
-
46
- /** Repository with themes */
47
- protected $installer_repo_with_themes;
48
-
49
- /** Active tab */
50
- protected $installer_theme_active_tab;
51
-
52
- /** Theme user registration */
53
- protected $theme_user_registration;
54
-
55
- /** Client active subscription */
56
- protected $installer_theme_subscription_type;
57
-
58
- public function __construct() {
59
-
60
- /** Properties */
61
-
62
- //Get installer repositories
63
- $installer_repositories = WP_Installer()->get_repositories();
64
-
65
- //Get repos with themes
66
- $repos_with_themes = $this->installer_theme_reposities_that_has_themes( $installer_repositories );
67
-
68
- if ( is_array( $repos_with_themes ) ) {
69
- //Assign to property
70
- $this->installer_repo_with_themes = $repos_with_themes;
71
-
72
- //Let's looped through repos with themes
73
- foreach ( $repos_with_themes as $k => $repo ) {
74
-
75
- //$repo could be 'toolset' or 'wpml'
76
- //Assign each repo with theme to property
77
- $this->theme_repo[] = $repo;
78
-
79
- if ( (isset($installer_repositories[$repo]['api-url'])) && (isset($installer_repositories[$repo]['products'])) ) {
80
-
81
- //Define the rest of the properties based on the given repo
82
- $this->repository_api[$repo] = $installer_repositories[$repo]['api-url'];
83
- $this->repository_theme_products[$repo] = $installer_repositories[$repo]['products'];
84
- $this->installer_site_url[$repo] = WP_Installer()->get_installer_site_url( $repo );
85
- $this->installer_site_key[$repo] = WP_Installer()->get_site_key( $repo );
86
- $this->theme_user_registration[$repo] = false;
87
-
88
- if ( WP_Installer()->repository_has_valid_subscription( $repo ) ) {
89
-
90
- $this->installer_theme_subscription_type = WP_Installer()->get_subscription_type_for_repository( $repo );
91
- $this->installer_themes_option[$repo] = 'wp_installer_' . $repo . '_themes';
92
- $this->installer_themes_available_updates[$repo] = 'wp_installer_' . $repo . '_updated_themes';
93
- $this->installer_theme_active_tab = '';
94
-
95
- //We only set themes available to this validated subscription
96
- $this->installer_theme_available( $repo, $this->installer_theme_subscription_type );
97
-
98
- add_action( 'installer_themes_support_set_up', array($this, 'installer_theme_sets_active_tab_on_init'), 10 );
99
- $this->theme_user_registration[$repo] = true;
100
- }
101
-
102
- /** We are ready.. let's initialize .... */
103
- $this->init();
104
- }
105
- }
106
- add_action( 'installer_themes_support_set_up', array($this, 'installer_theme_loaded_hooks') );
107
- }
108
- }
109
-
110
- /** Init */
111
- public function init() {
112
- add_action( 'admin_enqueue_scripts', array($this, 'installer_theme_enqueue_scripts') );
113
- add_filter( 'themes_api', array($this, 'installer_theme_api_override'), 10, 3 );
114
- add_filter( 'themes_api_result', array($this, 'installer_theme_api_override_response'), 10, 3 );
115
- add_filter( 'site_transient_update_themes', array($this, 'installer_theme_upgrade_check'), 10, 1 );
116
- add_action( 'http_api_debug', array($this, 'installer_theme_sync_native_wp_api'), 10, 5 );
117
- add_filter( 'installer_theme_hook_response_theme', array($this, 'installer_theme_add_num_ratings'), 10, 1 );
118
- add_filter( 'themes_update_check_locales', array($this, 'installer_theme_sync_call_wp_theme_api'), 10, 1 );
119
- add_filter( 'admin_url', array($this, 'installer_theme_add_query_arg_tab'), 10, 3 );
120
- add_filter( 'network_admin_url', array($this, 'installer_theme_add_query_arg_tab'), 10, 2 );
121
- add_action( 'wp_ajax_installer_theme_frontend_selected_tab', array($this, 'installer_theme_frontend_selected_tab'), 0 );
122
- add_action( 'wp_loaded', array($this, 'installer_themes_support_set_up_func') );
123
- }
124
-
125
- /** Enqueue scripts */
126
- public function installer_theme_enqueue_scripts() {
127
- $current_screen = $this->installer_theme_current_screen();
128
- $commercial_plugin_screen = $this->installer_theme_is_commercial_plugin_screen( $current_screen );
129
- if ( ('theme-install' == $current_screen) || ($commercial_plugin_screen) || ('theme-install-network' == $current_screen) ) {
130
- $repo_with_themes = $this->installer_repo_with_themes;
131
- $js_array = array();
132
- if ( is_array( $repo_with_themes ) ) {
133
- foreach ( $repo_with_themes as $k => $v ) {
134
-
135
- //Hyperlink text
136
- $theme_repo_name = $this->installer_theme_get_repo_product_name( $v );
137
- $the_hyperlink_text = esc_js( $theme_repo_name );
138
-
139
- if ( is_multisite() ) {
140
- $admin_url_passed = network_admin_url();
141
- } else {
142
- $admin_url_passed = admin_url();
143
- }
144
-
145
- //Define
146
- $js_array[$v] = array(
147
- 'the_hyperlink_text' => $the_hyperlink_text,
148
- 'registration_status' => $this->theme_user_registration[$v],
149
- 'is_commercial_plugin_tab' => $commercial_plugin_screen,
150
- 'registration_url' => $admin_url_passed . 'plugin-install.php?tab=commercial#installer_repo_' . $v
151
- );
152
-
153
- }
154
- }
155
-
156
- if ( !(empty($js_array)) ) {
157
- wp_enqueue_script( 'installer-theme-install', WP_Installer()->res_url() . '/res/js/installer_theme_install.js', array('jquery', 'installer-admin'), WP_Installer()->version() );
158
- $installer_ajax_url = admin_url( 'admin-ajax.php' );
159
-
160
- if ( is_ssl() ) {
161
- $installer_ajax_url = str_replace( 'http://', 'https://', $installer_ajax_url );
162
- } else {
163
- $installer_ajax_url = str_replace( 'https://', 'http://', $installer_ajax_url );
164
- }
165
-
166
- //Case where user is subscribed to a subscription that does not have themes
167
- $subscription_js_check = $this->installer_theme_subscription_does_not_have_theme( $js_array );
168
-
169
- wp_localize_script( 'installer-theme-install', 'installer_theme_install_localize',
170
- array(
171
- 'js_array_installer' => $js_array,
172
- 'ajaxurl' => $installer_ajax_url,
173
- 'no_associated_themes' => $subscription_js_check,
174
- 'installer_theme_frontend_selected_tab_nonce' => wp_create_nonce( 'installer_theme_frontend_selected_tab' )
175
- )
176
- );
177
- }
178
- }
179
- }
180
-
181
- /** Case where user is subscribed to a subscription that does not have themes */
182
- protected function installer_theme_subscription_does_not_have_theme( $js_array ) {
183
-
184
- $any_subscription_has_theme = array();
185
- $number_of_registrations = array();
186
-
187
- //Step1, we looped through JS array
188
- foreach ( $js_array as $repo_slug => $js_details ) {
189
-
190
- //Step2, checked if user is registered
191
- if ( isset($this->theme_user_registration[$repo_slug]) ) {
192
- $registration_status = $this->theme_user_registration[$repo_slug];
193
- if ( $registration_status ) {
194
-
195
- //Registered
196
- $number_of_registrations[] = $repo_slug;
197
-
198
- //Step3, we checked if the $repo_slug has available theme
199
- $themes_available = false;
200
- if ( isset($this->installer_themes[$repo_slug]) ) {
201
- $themes_available = $this->installer_themes[$repo_slug];
202
- if ( !(empty($themes_available)) ) {
203
- //This subscription has theme
204
- $themes_available = true;
205
- }
206
- }
207
-
208
- if ( $themes_available ) {
209
- $any_subscription_has_theme[] = $repo_slug;
210
- }
211
- }
212
- }
213
-
214
- }
215
-
216
- //Step4, we are done looping, check if there are any repos that have themes
217
- if ( empty($registration_status) ) {
218
-
219
- //No registration on any repos
220
- return FALSE;
221
-
222
- } elseif ( !(empty($registration_status)) ) {
223
-
224
- //Has some registration on some repos
225
- //We then checked if this user has any active subscriptions
226
- if ( empty($any_subscription_has_theme) ) {
227
- //No subscription
228
- return TRUE;
229
- } else {
230
- //Has subscription found
231
- return FALSE;
232
- }
233
- }
234
- }
235
-
236
- /** Check if its the commercial plugin screen */
237
- private function installer_theme_is_commercial_plugin_screen( $current_screen ) {
238
- $commercial = false;
239
- if ( ('plugin-install' == $current_screen) || ('plugin-install-network' == $current_screen) ) {
240
- if ( isset($_GET['tab']) ) {
241
- $tab = sanitize_text_field( $_GET['tab'] );
242
- if ( 'commercial' == $tab ) {
243
- $commercial = true;
244
- }
245
- }
246
- }
247
- return $commercial;
248
- }
249
-
250
- /** Current screen */
251
- private function installer_theme_current_screen() {
252
-
253
- $current_screen_loaded = false;
254
-
255
- if ( function_exists( 'get_current_screen' ) ) {
256
-
257
- $screen_output = get_current_screen();
258
- $current_screen_loaded = $screen_output->id;
259
-
260
- }
261
-
262
- return $current_screen_loaded;
263
-
264
- }
265
-
266
- /** Override WordPress Themes API */
267
- public function installer_theme_api_override( $api_boolean, $action, $args ) {
268
-
269
- //Let's checked if user is browsing our themes
270
- if ( isset($args->browse) ) {
271
- $browse = $args->browse;
272
- if ( in_array( $browse, $this->theme_repo ) ) {
273
- //Uniquely validated for our Themes
274
- if ( 'query_themes' == $action ) {
275
- //User is querying or asking information about our themes, let's override
276
- $api_boolean = true;
277
- }
278
- }
279
- } elseif ( isset($args->slug) ) {
280
- //We are installing our themes
281
- $theme_to_install = $args->slug;
282
-
283
- //Lets uniquely validate if this belongs to us
284
- //Check if this is OTGS theme
285
- $validate_check = $this->installer_themes_belong_to_us( $theme_to_install );
286
- if ( $validate_check ) {
287
- //Belongs to us
288
- if ( !(empty($theme_to_install)) ) {
289
- $api_boolean = true;
290
- }
291
- }
292
- }
293
-
294
- return $api_boolean;
295
- }
296
-
297
- /** Override WordPress Themes API response with our own themes API*/
298
- public function installer_theme_api_override_response( $res, $action, $args ) {
299
-
300
- if ( true === $res ) {
301
- if ( isset($args->browse) ) {
302
- $browse = $args->browse;
303
- if ( in_array( $browse, $this->theme_repo ) ) {
304
- //Uniquely validated for our themes
305
- if ( 'query_themes' == $action ) {
306
- //Client querying OTGS themes
307
- //Check for registration status
308
- if ( isset($this->theme_user_registration[$browse]) ) {
309
- //Set
310
- if ( !($this->theme_user_registration[$browse]) ) {
311
- //Not registered yet
312
- $res = new stdClass();
313
- $res->info = array();
314
- $res->themes = array();
315
- return $res;
316
- } else {
317
- //Registered
318
- $themes = $this->installer_theme_get_themes( '', $browse );
319
- $res = $this->installer_theme_format_response( $themes, $action );
320
- }
321
- }
322
- }
323
- }
324
- } elseif ( isset($args->slug) ) {
325
- //We are installing theme
326
- //Lets uniquely validate if this belongs to our theme
327
- $theme_to_install = $args->slug;
328
-
329
- //Lets uniquely validate if this belongs to us
330
- //Check if this is OTGS theme
331
- $validate_check = $this->installer_themes_belong_to_us( $theme_to_install );
332
- if ( $validate_check ) {
333
- //Belongs to us
334
- if ( ($res) && ('theme_information' == $action) ) {
335
- $themes = $this->installer_theme_get_themes( '', $this->installer_theme_active_tab );
336
- $res = $this->installer_theme_format_response( $themes, $action, $args->slug );
337
- }
338
- }
339
- }
340
- return $res;
341
- } else {
342
- //Default WP Themes here
343
- $client_side_active_tab = get_option( 'wp_installer_clientside_active_tab' );
344
- if ( $client_side_active_tab ) {
345
- if ( !(in_array( $client_side_active_tab, $this->theme_repo )) ) {
346
- //Not OTGS tab
347
- return $res;
348
- }
349
- }
350
-
351
- }
352
- }
353
-
354
- /** Get Themes */
355
- private function installer_theme_get_themes( $product_url = '', $repo_source = '' ) {
356
-
357
- //Query API
358
- if ( empty($product_url) ) {
359
- //Not set
360
- if ( isset($this->repository_theme_products[$this->installer_theme_active_tab]) ) {
361
- $query_remote_url = $this->repository_theme_products[$this->installer_theme_active_tab];
362
- }
363
-
364
- } else {
365
- $query_remote_url = $product_url;
366
- }
367
-
368
- //Let's retrieved current installer settings so we won't be querying all the time
369
- $current_installer_settings = WP_Installer()->get_settings();
370
-
371
- //Set $themes to FALSE by default
372
- $themes = false;
373
-
374
- if ( (is_array( $current_installer_settings )) && (!(empty($current_installer_settings))) ) {
375
-
376
- //Set and already defined, retrieved $products
377
- if ( isset($current_installer_settings['repositories'][$repo_source]['data']) ) {
378
- $products = $current_installer_settings['repositories'][$repo_source]['data'];
379
- if ( isset($products['downloads']['themes']) ) {
380
- $themes = $products['downloads']['themes'];
381
- }
382
- }
383
-
384
- } else {
385
-
386
- //Call API
387
- $response = wp_remote_get( $query_remote_url );
388
-
389
- if ( is_wp_error( $response ) ) {
390
- //Error detected: http fallback
391
- $query_remote_url = preg_replace( "@^https://@", 'http://', $query_remote_url );
392
- $response = wp_remote_get( $query_remote_url );
393
- }
394
-
395
- if ( !(is_wp_error( $response )) ) {
396
- //Not WP error
397
- //Evaluate response
398
- if ( $response && isset($response['response']['code']) && $response['response']['code'] == 200 ) {
399
- //In this case, response is set and defined, proceed...
400
- $body = wp_remote_retrieve_body( $response );
401
- if ( $body ) {
402
- $products = json_decode( $body, true );
403
- if ( isset($products['downloads']['themes']) ) {
404
- $themes = $products['downloads']['themes'];
405
- }
406
- }
407
-
408
- }
409
- }
410
- }
411
-
412
- //Return themes, can be filtered by user subscription type
413
- return apply_filters( 'installer_theme_get_themes', $themes, $this->installer_theme_active_tab );
414
- }
415
-
416
- /** Format response in compatibility with WordPress Theme API response */
417
- private function installer_theme_format_response( $themes, $action, $slug = '' ) {
418
-
419
- //Let's append download link only when retrieving theme information for installation
420
- if ( ('theme_information' == $action) && (!(empty($slug))) ) {
421
-
422
- //Only return one result -> the theme to be installed
423
- foreach ( $themes as $k => $theme ) {
424
- if ( $slug == $theme['basename'] ) {
425
- $theme['download_link'] = WP_Installer()->append_site_key_to_download_url( $theme['url'], $this->installer_site_key[$this->installer_theme_active_tab], $this->installer_theme_active_tab );
426
- $theme = json_decode( json_encode( $theme ), FALSE );
427
- return $theme;
428
- }
429
- }
430
-
431
- } else {
432
-
433
- $res = new stdClass();
434
- $res->info = array();
435
- $res->themes = array();
436
-
437
- //Define info
438
- $res->info['page'] = 1;
439
- $res->info['pages'] = 10;
440
-
441
- //Let's count available themes ;
442
- $res->info['results'] = count( $themes );
443
-
444
- //Let's saved themes for easy access later on
445
- $this->installer_theme_savethemes_by_slug( $themes );
446
-
447
- //Let's defined available themes
448
- if ( isset($this->installer_theme_subscription_type) ) {
449
- //Has subscription type defined, let's saved what is associated with this subscription
450
- $this->installer_theme_available( $this->installer_theme_active_tab, $this->installer_theme_subscription_type );
451
- } else {
452
- $this->installer_theme_available( $this->installer_theme_active_tab );
453
- }
454
-
455
- //Let's add themes to the overriden WordPress API Theme response
456
- /** Installer 1.7.6: Update to compatible data format response from WP Theme API */
457
- $theme_compatible_array=array();
458
- if ((is_array($themes))) {
459
- foreach ($themes as $k=>$v) {
460
- $theme_compatible_array[]=(object)($v);
461
- }
462
- }
463
- $res->themes = $theme_compatible_array;
464
- $res->themes = apply_filters( 'installer_theme_hook_response_theme', $res->themes );
465
- return $res;
466
- }
467
- }
468
-
469
- /** Let's save all available themes by its slug after any latest API query */
470
- private function installer_theme_savethemes_by_slug( $themes, $doing_query = false ) {
471
-
472
- if ( !($doing_query) ) {
473
- $this->installer_themes[$this->installer_theme_active_tab] = array();
474
- }
475
-
476
- if ( !(empty($themes)) ) {
477
- $themes_for_saving = array();
478
- foreach ( $themes as $k => $theme ) {
479
- if ( !($doing_query) ) {
480
- if ( isset($theme['slug']) ) {
481
- $theme_slug = $theme['slug'];
482
- if ( !(empty($theme_slug)) ) {
483
- $themes_for_saving[] = $theme_slug;
484
- }
485
- }
486
- } else {
487
-
488
- if ( ((isset($theme['slug'])) && (isset($theme['version'])) &&
489
- (isset($theme['theme_page_url']))) && (isset($theme['url']))
490
- ) {
491
- $theme_slug = $theme['slug'];
492
- $theme_version = $theme['version'];
493
- $theme_page_url = $theme['theme_page_url'];
494
- $theme_url = $theme['url'];
495
- if ( (!(empty($theme_slug))) && (!(empty($theme_version))) &&
496
- (!(empty($theme_page_url))) && (!(empty($theme_url)))
497
- ) {
498
- //$theme_slug is unique for every theme
499
- $themes_for_saving[$theme_slug] = array(
500
- 'version' => $theme_version,
501
- 'theme_page_url' => $theme_page_url,
502
- 'url' => $theme_url
503
- );
504
-
505
- }
506
- }
507
- }
508
-
509
- }
510
-
511
- if ( !(empty($themes_for_saving)) ) {
512
- //Has themes for saving
513
- if ( !($doing_query) ) {
514
- //Not doing query
515
- $existing_themes = get_option( $this->installer_themes_option[$this->installer_theme_active_tab] );
516
- if ( !($existing_themes) ) {
517
- //Does not yet exists
518
- delete_option( $this->installer_themes_option[$this->installer_theme_active_tab] );
519
- update_option( $this->installer_themes_option[$this->installer_theme_active_tab], $themes_for_saving );
520
- } else {
521
- //exists, check if we need to update
522
- if ( $existing_themes == $themes_for_saving ) {
523
- //Equal, no need to update here
524
- } else {
525
- //Update
526
- delete_option( $this->installer_themes_option[$this->installer_theme_active_tab] );
527
- update_option( $this->installer_themes_option[$this->installer_theme_active_tab], $themes_for_saving );
528
- }
529
- }
530
- } else {
531
- //Used for query purposes only, don't save anything
532
- return $themes_for_saving;
533
- }
534
- }
535
- }
536
- }
537
-
538
- /** Available themes */
539
- private function installer_theme_available( $repo, $subscription_type = '' ) {
540
-
541
- $subscription_type = intval( $subscription_type );
542
- if ( $subscription_type > 0 ) {
543
-
544
- //Here we have a case of validated subscription
545
- //We need to set themes that is available to this subscription
546
- $themes_associated_with_subscription = $this->installer_themes[$repo] = $this->installer_theme_get_themes_by_subscription( $subscription_type, $repo );
547
- if ( !(empty($themes_associated_with_subscription)) ) {
548
- //Has themes
549
- $this->installer_themes[$repo] = $themes_associated_with_subscription;
550
- }
551
- } else {
552
-
553
- //Get themes
554
- $this->installer_themes[$repo] = get_option( $this->installer_themes_option[$repo] );
555
- }
556
- }
557
-
558
- /** Theme upgrade check */
559
- public function installer_theme_upgrade_check( $the_value ) {
560
-
561
- //Step1: Let's looped through repos with themes and check if we have updates available for them.
562
- if ( (is_array( $this->installer_repo_with_themes )) && (!(empty($this->installer_repo_with_themes))) ) {
563
- foreach ( $this->installer_repo_with_themes as $k => $repo_slug ) {
564
- //Step2: Let's checked if we have update for this theme
565
- $update_available = get_option( $this->installer_themes_available_updates[$repo_slug] );
566
- if ( $update_available ) {
567
- if ( (is_array( $update_available )) && (!(empty($update_available))) ) {
568
- //Has updates available coming from this specific theme repo
569
- //Let's loop through the themes that needs update
570
- foreach ( $update_available as $theme_slug => $v ) {
571
- //Add to response API
572
- $the_value->response [$theme_slug] = array(
573
- 'theme' => $theme_slug,
574
- 'new_version' => $v['new_version'],
575
- 'url' => $v['url'],
576
- 'package' => $v['package']
577
- );
578
- }
579
- }
580
- }
581
- }
582
- }
583
- //Return
584
- return $the_value;
585
- }
586
-
587
- /** Return repositories that has themes */
588
- private function installer_theme_reposities_that_has_themes( $repositories, $ret_value = true, $doing_api_query = false ) {
589
-
590
- $repositories_with_themes = array();
591
-
592
- if ( (is_array( $repositories )) && (!(empty($repositories))) ) {
593
-
594
- //Let's checked if we have something before
595
- $themes = get_option( 'installer_repositories_with_theme' );
596
-
597
- if ( (!($themes)) || ($doing_api_query) ) {
598
- //Not yet defined
599
- //Loop through each repositories and check whether they have themes
600
- foreach ( $repositories as $k => $v ) {
601
- if ( isset($v['products']) ) {
602
- $products_url = $v['products'];
603
- $themes = $this->installer_theme_get_themes( $products_url, $k );
604
- if ( (is_array( $themes )) && (!(empty($themes))) ) {
605
- //Repo has themes
606
- $repositories_with_themes[] = $k;
607
- }
608
- }
609
- }
610
- } else {
611
- //Already set
612
- $repositories_with_themes = $themes;
613
- }
614
-
615
- if ( (((is_array( $repositories_with_themes )) && (!(empty($repositories_with_themes)))) && (!($themes))) || ($doing_api_query) ) {
616
- //Save to db
617
- update_option( 'installer_repositories_with_theme', $repositories_with_themes );
618
- }
619
- }
620
-
621
- if ( $ret_value ) {
622
- return $repositories_with_themes;
623
- }
624
-
625
- }
626
-
627
- /** When WordPress queries its own Themes API, we sync with our own */
628
- public function installer_theme_sync_native_wp_api( $response, $responsetext, $class, $args, $url ) {
629
-
630
- $api_native_string = 'api.wordpress.org/themes/';
631
- if ( (strpos( $url, $api_native_string ) !== false) ) {
632
- //WordPress is querying its own themes API
633
- $installer_repositories = WP_Installer()->get_repositories();
634
-
635
- //Query our own API and update repository values too
636
- $this->installer_theme_reposities_that_has_themes( $installer_repositories, false, true );
637
- }
638
- }
639
-
640
- /** Returns product name by theme repo slug */
641
- private function installer_theme_get_repo_product_name( $theme_repo ) {
642
-
643
- $theme_repo_name = false;
644
-
645
- if ( isset(WP_Installer()->settings['repositories'][$theme_repo]['data']['product-name']) ) {
646
- //Set
647
- $prod_name = WP_Installer()->settings['repositories'][$theme_repo]['data']['product-name'];
648
- if ( !(empty($prod_name)) ) {
649
- $theme_repo_name = $prod_name;
650
- }
651
- } else {
652
- //Not yet
653
- if ( $theme_repo == $this->theme_repo ) {
654
- $result = $this->installer_theme_general_api_query();
655
- if ( isset($result['product-name']) ) {
656
- $product_name = $result['product-name'];
657
- if ( !(empty($product_name)) ) {
658
- $theme_repo_name = $product_name;
659
- }
660
- }
661
- }
662
- }
663
-
664
- return $theme_repo_name;
665
- }
666
-
667
- /** General query API method, returns $products */
668
- private function installer_theme_general_api_query() {
669
- $products = false;
670
- $response = wp_remote_get( $this->repository_theme_products );
671
- if ( !(is_wp_error( $response )) ) {
672
- //Not WP error
673
- //Evaluate response
674
- if ( $response && isset($response['response']['code']) && $response['response']['code'] == 200 ) {
675
- //In this case, response is set and defined, proceed...
676
- $body = wp_remote_retrieve_body( $response );
677
- if ( $body ) {
678
- $result = json_decode( $body, true );
679
- if ( (is_array( $result )) && (!(empty($result))) ) {
680
- $products = $result;
681
- }
682
- }
683
-
684
- }
685
- }
686
-
687
- return $products;
688
- }
689
-
690
- /** General method to check if themes are OTGS themes based on its slug*/
691
- private function installer_themes_belong_to_us( $theme_slug ) {
692
-
693
- $found = false;
694
- $theme_slug = trim( $theme_slug );
695
-
696
- foreach ( $this->installer_themes as $repo_with_theme => $themes ) {
697
- foreach ( $themes as $k => $otgs_theme_slug ) {
698
- if ( $theme_slug == $otgs_theme_slug ) {
699
- //match found! Theme belongs to otgs
700
- return true;
701
- }
702
- }
703
- }
704
- return $found;
705
-
706
- }
707
-
708
- /** Sets active tab on init */
709
- public function installer_theme_sets_active_tab_on_init() {
710
-
711
- if ( isset ($_SERVER ['REQUEST_URI']) ) {
712
- $request_uri = $_SERVER ['REQUEST_URI'];
713
- if ( isset ($_GET ['browse']) ) {
714
- $active_tab = sanitize_text_field( $_GET['browse'] );
715
- $this->installer_theme_active_tab = $active_tab;
716
- } elseif ( isset ($_POST ['request'] ['browse']) ) {
717
- $active_tab = sanitize_text_field ( $_POST['request']['browse'] );
718
- $this->installer_theme_active_tab = $active_tab;
719
- } elseif ( (isset ($_GET ['theme_repo'])) && (isset ($_GET ['action'])) ) {
720
- $theme_repo = sanitize_text_field( $_GET['theme_repo'] );
721
- $the_action = sanitize_text_field( $_GET['action'] );
722
- if ( ('install-theme' == $the_action) && (!(empty($theme_repo))) ) {
723
- $this->installer_theme_active_tab = $theme_repo;
724
- }
725
- } elseif ( wp_get_referer() ) {
726
- $referer = wp_get_referer();
727
- $parts = parse_url( $referer );
728
- if ( isset($parts['query']) ) {
729
- parse_str( $parts['query'], $query );
730
- if ( isset($query['browse']) ) {
731
- $this->installer_theme_active_tab = $query['browse'];
732
- }
733
- }
734
- }
735
- }
736
- }
737
-
738
- /** WP Theme API compatibility- added num ratings */
739
- /** Installer 1.7.6+ Added updated 'rating' field */
740
- public function installer_theme_add_num_ratings( $themes ) {
741
-
742
- if ( (is_array( $themes )) && (!(empty($themes))) ) {
743
- foreach ( $themes as $k => $v ) {
744
- if ( !(isset($v->num_ratings)) ) {
745
- $themes[$k]->num_ratings = 100;
746
- }
747
- if ( !(isset($v->rating)) ) {
748
- $themes[$k]->rating = 100;
749
- }
750
- }
751
- }
752
-
753
- return $themes;
754
- }
755
-
756
- /** When WordPress.org makes a call to its repository, let's run our own upgrade checks too */
757
- public function installer_theme_sync_call_wp_theme_api( $locales ) {
758
-
759
- $this->installer_theme_upgrade_theme_check();
760
-
761
- return $locales;
762
- }
763
-
764
- /** Upgrade theme check */
765
- private function installer_theme_upgrade_theme_check() {
766
-
767
- // Step1-> we get all installed themes in clients local themes directory
768
- $installed_themes = wp_get_themes();
769
-
770
- // Step2: We need to loop through each repository with themes
771
- foreach ( $this->installer_repo_with_themes as $k => $repo_slug ) {
772
-
773
- // We then need to retrieved the products URL for each of this repo
774
- $products_url = $this->repository_theme_products [$repo_slug];
775
-
776
- // Step3-> we get all available themes in our repository via API based on this URL
777
- $available_themes = $this->installer_theme_get_themes( $products_url, $repo_slug );
778
-
779
- if ( !($available_themes) ) {
780
-
781
- // API is not available as of the moment, return..
782
- return;
783
- } else {
784
-
785
- // We have available themes here...
786
- // Step4->let's simplify available themes data by slugs
787
- $simplified_available_themes = $this->installer_theme_savethemes_by_slug( $available_themes, true );
788
-
789
- // Step5->Let's loop through installed themes
790
- if ( (is_array( $installed_themes )) && (!(empty ($installed_themes))) ) {
791
- $otgs_theme_updates_available = array();
792
- foreach ( $installed_themes as $theme_slug => $theme_object ) {
793
- if ( array_key_exists( $theme_slug, $simplified_available_themes ) ) {
794
-
795
- // This is our theme
796
- // Step6->Let's get version of the local theme installed
797
- $local_version = $theme_object->get( 'Version' );
798
-
799
- // Step7->Let's get the latest version of this theme, page URL and download URL from our repository
800
- $repository_version = $simplified_available_themes [$theme_slug] ['version'];
801
- $theme_page_url = $simplified_available_themes [$theme_slug] ['theme_page_url'];
802
- $theme_download_url = $simplified_available_themes [$theme_slug] ['url'];
803
-
804
- // Step8->Let's compare the version
805
- if ( version_compare( $repository_version, $local_version, '>' ) ) {
806
-
807
- // Update available for this theme
808
- // Step9-> Define download URL with site key
809
- $package_url = WP_Installer()->append_site_key_to_download_url( $theme_download_url, $this->installer_site_key [$repo_slug], $repo_slug );
810
-
811
- //Step10-> Assign to updates array for later accessing.
812
- $otgs_theme_updates_available[$theme_slug] = array(
813
- 'theme' => $theme_slug,
814
- 'new_version' => $repository_version,
815
- 'url' => $theme_page_url,
816
- 'package' => $package_url
817
- );
818
- }
819
- }
820
- }
821
- //Exited the upgrade loop for this specific theme repository
822
- if ( !(empty($otgs_theme_updates_available)) ) {
823
- //Has updates
824
- update_option( $this->installer_themes_available_updates[$repo_slug], $otgs_theme_updates_available );
825
- } else {
826
- //No updates
827
- delete_option( $this->installer_themes_available_updates[$repo_slug] );
828
- }
829
-
830
- }
831
- }
832
- }
833
- }
834
-
835
- /** When the user is on Themes install page OTG themes repository, let's the currently selected tab */
836
- public function installer_theme_add_query_arg_tab( $url, $path, $blog_id = null ) {
837
-
838
- $wp_install_string = 'update.php?action=install-theme';
839
- if ( $path == $wp_install_string ) {
840
- if ( isset($this->installer_theme_active_tab) ) {
841
- if ( !(empty($this->installer_theme_active_tab)) ) {
842
- $url = add_query_arg( array(
843
- 'theme_repo' => $this->installer_theme_active_tab
844
- ), $url );
845
- }
846
- }
847
- }
848
- return $url;
849
- }
850
-
851
- /** Save frontend theme tab selected */
852
- public function installer_theme_frontend_selected_tab() {
853
- if ( isset($_POST["frontend_tab_selected"]) ) {
854
- check_ajax_referer( 'installer_theme_frontend_selected_tab', 'installer_theme_frontend_selected_tab_nonce' );
855
-
856
- //Client_side_active_tab
857
- $frontend_tab_selected = sanitize_text_field( $_POST['frontend_tab_selected'] );
858
- if ( !(empty($frontend_tab_selected)) ) {
859
- //Front end tab selected
860
- update_option( 'wp_installer_clientside_active_tab', $frontend_tab_selected, false );
861
-
862
- //Check for registration status
863
- if ( isset($this->theme_user_registration[$frontend_tab_selected]) ) {
864
- //Set
865
- if ( !($this->theme_user_registration[$frontend_tab_selected]) ) {
866
- //Not registered yet
867
-
868
- if ( is_multisite() ) {
869
- $admin_url_passed = network_admin_url();
870
- } else {
871
- $admin_url_passed = admin_url();
872
- }
873
-
874
- $registration_url = $admin_url_passed . 'plugin-install.php?tab=commercial#installer_repo_' . $frontend_tab_selected;
875
-
876
- //Message and link
877
- $theme_repo_name = $this->installer_theme_get_repo_product_name( $frontend_tab_selected );;
878
- $response['unregistered_messages'] = sprintf( __( 'To install and update %s, please %sregister%s %s for this site.', 'installer' ),
879
- $theme_repo_name, '<a href="' . $registration_url . '">', '</a>', $theme_repo_name );
880
-
881
- }
882
- }
883
-
884
- $response['output'] = $frontend_tab_selected;
885
- echo json_encode( $response );
886
- }
887
- die();
888
- }
889
- die();
890
- }
891
-
892
- /** Installer loaded aux hooks */
893
- public function installer_theme_loaded_hooks() {
894
-
895
- if ( isset($this->installer_theme_subscription_type) ) {
896
- $subscription_type = intval( $this->installer_theme_subscription_type );
897
- if ( $subscription_type > 0 ) {
898
- //Client is subscribed
899
- add_filter( 'installer_theme_get_themes', array($this, 'installer_theme_filter_themes_by_subscription'), 10, 2 );
900
- }
901
- }
902
-
903
- }
904
-
905
- /** Get themes by subscription type */
906
- protected function installer_theme_get_themes_by_subscription( $subscription_type, $repo ) {
907
-
908
- $themes_associated_with_subscription = array();
909
- if ( isset(WP_Installer()->settings['repositories'][$repo]['data']['packages']) ) {
910
- //Set
911
- $packages = WP_Installer()->settings['repositories'][$repo]['data']['packages'];
912
- $available_themes_subscription = array();
913
- foreach ( $packages as $package_id => $package_details ) {
914
- if ( isset($package_details['products']) ) {
915
- $the_products = $package_details['products'];
916
- foreach ( $the_products as $product_slug => $product_details ) {
917
- if ( isset($product_details['subscription_type']) ) {
918
- $subscription_type_from_settings = intval( $product_details['subscription_type'] );
919
- if ( $subscription_type_from_settings == $subscription_type ) {
920
- //We found the subscription
921
- if ( isset($product_details['themes']) ) {
922
- $themes_associated_with_subscription = $product_details['themes'];
923
- return $themes_associated_with_subscription;
924
- }
925
- }
926
- }
927
-
928
- }
929
- }
930
- }
931
- }
932
- return $themes_associated_with_subscription;
933
- }
934
-
935
- /** Filter API theme response according to user subscription */
936
- public function installer_theme_filter_themes_by_subscription( $themes, $active_tab ) {
937
-
938
- //Step1, we only filter OTGS themes
939
- $orig = count( $themes );
940
- if ( in_array( $active_tab, $this->theme_repo ) ) {
941
- //OTGS Theme
942
- //Step2, we retrieved the available themes based on client subscription
943
- if ( isset($this->installer_themes[$active_tab]) ) {
944
- $available_themes = $this->installer_themes[$active_tab];
945
- //Step3, we filter $themes based on this info
946
- if ( (is_array( $themes )) && (!(empty($themes))) ) {
947
- foreach ( $themes as $k => $theme ) {
948
- //Step4, get theme slug
949
- if ( isset($theme['slug']) ) {
950
- $theme_slug = $theme['slug'];
951
- if ( !(empty($theme_slug)) ) {
952
- if ( !(in_array( $theme_slug, $available_themes )) ) {
953
- //This theme is not in available themes
954
- unset($themes[$k]);
955
- }
956
- }
957
- }
958
- }
959
- }
960
- }
961
- }
962
- $new = count( $themes );
963
- if ( $orig != $new ) {
964
- //It is filtered
965
- $themes = array_values( $themes );
966
- }
967
-
968
- return $themes;
969
- }
970
-
971
- /** Hook to wp_loaded, fires when all Installer theme class is ready */
972
- public function installer_themes_support_set_up_func() {
973
- do_action( 'installer_themes_support_set_up' );
974
- }
975
-
976
- }
977
-
978
- /** Instantiate Installer Theme Class */
979
  new Installer_Theme_Class;
1
+ <?php
2
+ /**
3
+ * Installer Class for Theme Support
4
+ *
5
+ * Supports automatic updates and installation of Toolset/WPML Themes
6
+ *
7
+ * @class Installer_Theme_Class
8
+ * @version 1.6
9
+ * @category Class
10
+ * @author OnTheGoSystems
11
+ */
12
+
13
+ if ( !defined( 'ABSPATH' ) ) {
14
+ exit;
15
+ }
16
+
17
+ /**
18
+ * Installer_Theme_Class
19
+ */
20
+ class Installer_Theme_Class {
21
+
22
+ /** Theme Repository */
23
+ private $theme_repo;
24
+
25
+ /** Repository API */
26
+ private $repository_api;
27
+
28
+ /** Repository Theme Products */
29
+ private $repository_theme_products;
30
+
31
+ /** Site URL */
32
+ private $installer_site_url;
33
+
34
+ /** Site Key */
35
+ private $installer_site_key;
36
+
37
+ /** The Themes Option */
38
+ protected $installer_themes_option;
39
+
40
+ /** Update settings */
41
+ protected $installer_themes_available_updates;
42
+
43
+ /** The Themes */
44
+ protected $installer_themes = array();
45
+
46
+ /** Repository with themes */
47
+ protected $installer_repo_with_themes;
48
+
49
+ /** Active tab */
50
+ protected $installer_theme_active_tab;
51
+
52
+ /** Theme user registration */
53
+ protected $theme_user_registration;
54
+
55
+ /** Client active subscription */
56
+ protected $installer_theme_subscription_type;
57
+
58
+ public function __construct() {
59
+
60
+ /** Properties */
61
+
62
+ //Get installer repositories
63
+ $installer_repositories = WP_Installer()->get_repositories();
64
+
65
+ //Get repos with themes
66
+ $repos_with_themes = $this->installer_theme_reposities_that_has_themes( $installer_repositories );
67
+
68
+ if ( is_array( $repos_with_themes ) ) {
69
+ //Assign to property
70
+ $this->installer_repo_with_themes = $repos_with_themes;
71
+
72
+ //Let's looped through repos with themes
73
+ foreach ( $repos_with_themes as $k => $repo ) {
74
+
75
+ //$repo could be 'toolset' or 'wpml'
76
+ //Assign each repo with theme to property
77
+ $this->theme_repo[] = $repo;
78
+
79
+ if ( (isset($installer_repositories[$repo]['api-url'])) && (isset($installer_repositories[$repo]['products'])) ) {
80
+
81
+ //Define the rest of the properties based on the given repo
82
+ $this->repository_api[$repo] = $installer_repositories[$repo]['api-url'];
83
+ $this->repository_theme_products[$repo] = $installer_repositories[$repo]['products'];
84
+ $this->installer_site_url[$repo] = WP_Installer()->get_installer_site_url( $repo );
85
+ $this->installer_site_key[$repo] = WP_Installer()->get_site_key( $repo );
86
+ $this->theme_user_registration[$repo] = false;
87
+
88
+ if ( WP_Installer()->repository_has_valid_subscription( $repo ) ) {
89
+
90
+ $this->installer_theme_subscription_type = WP_Installer()->get_subscription_type_for_repository( $repo );
91
+ $this->installer_themes_option[$repo] = 'wp_installer_' . $repo . '_themes';
92
+ $this->installer_themes_available_updates[$repo] = 'wp_installer_' . $repo . '_updated_themes';
93
+ $this->installer_theme_active_tab = '';
94
+
95
+ //We only set themes available to this validated subscription
96
+ $this->installer_theme_available( $repo, $this->installer_theme_subscription_type );
97
+
98
+ add_action( 'installer_themes_support_set_up', array($this, 'installer_theme_sets_active_tab_on_init'), 10 );
99
+ $this->theme_user_registration[$repo] = true;
100
+ }
101
+
102
+ /** We are ready.. let's initialize .... */
103
+ $this->init();
104
+ }
105
+ }
106
+ add_action( 'installer_themes_support_set_up', array($this, 'installer_theme_loaded_hooks') );
107
+ }
108
+ }
109
+
110
+ /** Init */
111
+ public function init() {
112
+ add_action( 'admin_enqueue_scripts', array($this, 'installer_theme_enqueue_scripts') );
113
+ add_filter( 'themes_api', array($this, 'installer_theme_api_override'), 10, 3 );
114
+ add_filter( 'themes_api_result', array($this, 'installer_theme_api_override_response'), 10, 3 );
115
+ add_filter( 'site_transient_update_themes', array($this, 'installer_theme_upgrade_check'), 10, 1 );
116
+ add_action( 'http_api_debug', array($this, 'installer_theme_sync_native_wp_api'), 10, 5 );
117
+ add_filter( 'installer_theme_hook_response_theme', array($this, 'installer_theme_add_num_ratings'), 10, 1 );
118
+ add_filter( 'themes_update_check_locales', array($this, 'installer_theme_sync_call_wp_theme_api'), 10, 1 );
119
+ add_filter( 'admin_url', array($this, 'installer_theme_add_query_arg_tab'), 10, 3 );
120
+ add_filter( 'network_admin_url', array($this, 'installer_theme_add_query_arg_tab'), 10, 2 );
121
+ add_action( 'wp_ajax_installer_theme_frontend_selected_tab', array($this, 'installer_theme_frontend_selected_tab'), 0 );
122
+ add_action( 'wp_loaded', array($this, 'installer_themes_support_set_up_func') );
123
+ }
124
+
125
+ /** Enqueue scripts */
126
+ public function installer_theme_enqueue_scripts() {
127
+ $current_screen = $this->installer_theme_current_screen();
128
+ $commercial_plugin_screen = $this->installer_theme_is_commercial_plugin_screen( $current_screen );
129
+ if ( ('theme-install' == $current_screen) || ($commercial_plugin_screen) || ('theme-install-network' == $current_screen) ) {
130
+ $repo_with_themes = $this->installer_repo_with_themes;
131
+ $js_array = array();
132
+ if ( is_array( $repo_with_themes ) ) {
133
+ foreach ( $repo_with_themes as $k => $v ) {
134
+
135
+ //Hyperlink text
136
+ $theme_repo_name = $this->installer_theme_get_repo_product_name( $v );
137
+ $the_hyperlink_text = esc_js( $theme_repo_name );
138
+
139
+ if ( is_multisite() ) {
140
+ $admin_url_passed = network_admin_url();
141
+ } else {
142
+ $admin_url_passed = admin_url();
143
+ }
144
+
145
+ //Define
146
+ $js_array[$v] = array(
147
+ 'the_hyperlink_text' => $the_hyperlink_text,
148
+ 'registration_status' => $this->theme_user_registration[$v],
149
+ 'is_commercial_plugin_tab' => $commercial_plugin_screen,
150
+ 'registration_url' => $admin_url_passed . 'plugin-install.php?tab=commercial#installer_repo_' . $v
151
+ );
152
+
153
+ }
154
+ }
155
+
156
+ if ( !(empty($js_array)) ) {
157
+ wp_enqueue_script( 'installer-theme-install', WP_Installer()->res_url() . '/res/js/installer_theme_install.js', array('jquery', 'installer-admin'), WP_Installer()->version() );
158
+ $installer_ajax_url = admin_url( 'admin-ajax.php' );
159
+
160
+ if ( is_ssl() ) {
161
+ $installer_ajax_url = str_replace( 'http://', 'https://', $installer_ajax_url );
162
+ } else {
163
+ $installer_ajax_url = str_replace( 'https://', 'http://', $installer_ajax_url );
164
+ }
165
+
166
+ //Case where user is subscribed to a subscription that does not have themes
167
+ $subscription_js_check = $this->installer_theme_subscription_does_not_have_theme( $js_array );
168
+
169
+ wp_localize_script( 'installer-theme-install', 'installer_theme_install_localize',
170
+ array(
171
+ 'js_array_installer' => $js_array,
172
+ 'ajaxurl' => $installer_ajax_url,
173
+ 'no_associated_themes' => $subscription_js_check,
174
+ 'installer_theme_frontend_selected_tab_nonce' => wp_create_nonce( 'installer_theme_frontend_selected_tab' )
175
+ )
176
+ );
177
+ }
178
+ }
179
+ }
180
+
181
+ /** Case where user is subscribed to a subscription that does not have themes */
182
+ protected function installer_theme_subscription_does_not_have_theme( $js_array ) {
183
+
184
+ $any_subscription_has_theme = array();
185
+ $number_of_registrations = array();
186
+
187
+ //Step1, we looped through JS array
188
+ foreach ( $js_array as $repo_slug => $js_details ) {
189
+
190
+ //Step2, checked if user is registered
191
+ if ( isset($this->theme_user_registration[$repo_slug]) ) {
192
+ $registration_status = $this->theme_user_registration[$repo_slug];
193
+ if ( $registration_status ) {
194
+
195
+ //Registered
196
+ $number_of_registrations[] = $repo_slug;
197
+
198
+ //Step3, we checked if the $repo_slug has available theme
199
+ $themes_available = false;
200
+ if ( isset($this->installer_themes[$repo_slug]) ) {
201
+ $themes_available = $this->installer_themes[$repo_slug];
202
+ if ( !(empty($themes_available)) ) {
203
+ //This subscription has theme
204
+ $themes_available = true;
205
+ }
206
+ }
207
+
208
+ if ( $themes_available ) {
209
+ $any_subscription_has_theme[] = $repo_slug;
210
+ }
211
+ }
212
+ }
213
+
214
+ }
215
+
216
+ //Step4, we are done looping, check if there are any repos that have themes
217
+ if ( empty($registration_status) ) {
218
+
219
+ //No registration on any repos
220
+ return FALSE;
221
+
222
+ } elseif ( !(empty($registration_status)) ) {
223
+
224
+ //Has some registration on some repos
225
+ //We then checked if this user has any active subscriptions
226
+ if ( empty($any_subscription_has_theme) ) {
227
+ //No subscription
228
+ return TRUE;
229
+ } else {
230
+ //Has subscription found
231
+ return FALSE;
232
+ }
233
+ }
234
+ }
235
+
236
+ /** Check if its the commercial plugin screen */
237
+ private function installer_theme_is_commercial_plugin_screen( $current_screen ) {
238
+ $commercial = false;
239
+ if ( ('plugin-install' == $current_screen) || ('plugin-install-network' == $current_screen) ) {
240
+ if ( isset($_GET['tab']) ) {
241
+ $tab = sanitize_text_field( $_GET['tab'] );
242
+ if ( 'commercial' == $tab ) {
243
+ $commercial = true;
244
+ }
245
+ }
246
+ }
247
+ return $commercial;
248
+ }
249
+
250
+ /** Current screen */
251
+ private function installer_theme_current_screen() {
252
+
253
+ $current_screen_loaded = false;
254
+
255
+ if ( function_exists( 'get_current_screen' ) ) {
256
+
257
+ $screen_output = get_current_screen();
258
+ $current_screen_loaded = $screen_output->id;
259
+
260
+ }
261
+
262
+ return $current_screen_loaded;
263
+
264
+ }
265
+
266
+ /** Override WordPress Themes API */
267
+ public function installer_theme_api_override( $api_boolean, $action, $args ) {
268
+
269
+ //Let's checked if user is browsing our themes
270
+ if ( isset($args->browse) ) {
271
+ $browse = $args->browse;
272
+ if ( in_array( $browse, $this->theme_repo ) ) {
273
+ //Uniquely validated for our Themes
274
+ if ( 'query_themes' == $action ) {
275
+ //User is querying or asking information about our themes, let's override
276
+ $api_boolean = true;
277
+ }
278
+ }
279
+ } elseif ( isset($args->slug) ) {
280
+ //We are installing our themes
281
+ $theme_to_install = $args->slug;
282
+
283
+ //Lets uniquely validate if this belongs to us
284
+ //Check if this is OTGS theme
285
+ $validate_check = $this->installer_themes_belong_to_us( $theme_to_install );
286
+ if ( $validate_check ) {
287
+ //Belongs to us
288
+ if ( !(empty($theme_to_install)) ) {
289
+ $api_boolean = true;
290
+ }
291
+ }
292
+ }
293
+
294
+ return $api_boolean;
295
+ }
296
+
297
+ /** Override WordPress Themes API response with our own themes API*/
298
+ public function installer_theme_api_override_response( $res, $action, $args ) {
299
+
300
+ if ( true === $res ) {
301
+ if ( isset($args->browse) ) {
302
+ $browse = $args->browse;
303
+ if ( in_array( $browse, $this->theme_repo ) ) {
304
+ //Uniquely validated for our themes
305
+ if ( 'query_themes' == $action ) {
306
+ //Client querying OTGS themes
307
+ //Check for registration status
308
+ if ( isset($this->theme_user_registration[$browse]) ) {
309
+ //Set
310
+ if ( !($this->theme_user_registration[$browse]) ) {
311
+ //Not registered yet
312
+ $res = new stdClass();
313
+ $res->info = array();
314
+ $res->themes = array();
315
+ return $res;
316
+ } else {
317
+ //Registered
318
+ $themes = $this->installer_theme_get_themes( '', $browse );
319
+ $res = $this->installer_theme_format_response( $themes, $action );
320
+ }
321
+ }
322
+ }
323
+ }
324
+ } elseif ( isset($args->slug) ) {
325
+ //We are installing theme
326
+ //Lets uniquely validate if this belongs to our theme
327
+ $theme_to_install = $args->slug;
328
+
329
+ //Lets uniquely validate if this belongs to us
330
+ //Check if this is OTGS theme
331
+ $validate_check = $this->installer_themes_belong_to_us( $theme_to_install );
332
+ if ( $validate_check ) {
333
+ //Belongs to us
334
+ if ( ($res) && ('theme_information' == $action) ) {
335
+ $themes = $this->installer_theme_get_themes( '', $this->installer_theme_active_tab );
336
+ $res = $this->installer_theme_format_response( $themes, $action, $args->slug );
337
+ }
338
+ }
339
+ }
340
+ return $res;
341
+ } else {
342
+ //Default WP Themes here
343
+ $client_side_active_tab = get_option( 'wp_installer_clientside_active_tab' );
344
+ if ( $client_side_active_tab ) {
345
+ if ( !(in_array( $client_side_active_tab, $this->theme_repo )) ) {
346
+ //Not OTGS tab
347
+ return $res;
348
+ }
349
+ }
350
+
351
+ }
352
+ }
353
+
354
+ /** Get Themes */
355
+ private function installer_theme_get_themes( $product_url = '', $repo_source = '' ) {
356
+
357
+ //Query API
358
+ if ( empty($product_url) ) {
359
+ //Not set
360
+ if ( isset($this->repository_theme_products[$this->installer_theme_active_tab]) ) {
361
+ $query_remote_url = $this->repository_theme_products[$this->installer_theme_active_tab];
362
+ }
363
+
364
+ } else {
365
+ $query_remote_url = $product_url;
366
+ }
367
+
368
+ //Let's retrieved current installer settings so we won't be querying all the time
369
+ $current_installer_settings = WP_Installer()->get_settings();
370
+
371
+ //Set $themes to FALSE by default
372
+ $themes = false;
373
+
374
+ if ( (is_array( $current_installer_settings )) && (!(empty($current_installer_settings))) ) {
375
+
376
+ //Set and already defined, retrieved $products
377
+ if ( isset($current_installer_settings['repositories'][$repo_source]['data']) ) {
378
+ $products = $current_installer_settings['repositories'][$repo_source]['data'];
379
+ if ( isset($products['downloads']['themes']) ) {
380
+ $themes = $products['downloads']['themes'];
381
+ }
382
+ }
383
+
384
+ } else {
385
+
386
+ //Call API
387
+ $response = wp_remote_get( $query_remote_url );
388
+
389
+ if ( is_wp_error( $response ) ) {
390
+ //Error detected: http fallback
391
+ $query_remote_url = preg_replace( "@^https://@", 'http://', $query_remote_url );
392
+ $response = wp_remote_get( $query_remote_url );
393
+ }
394
+
395
+ if ( !(is_wp_error( $response )) ) {
396
+ //Not WP error
397
+ //Evaluate response
398
+ if ( $response && isset($response['response']['code']) && $response['response']['code'] == 200 ) {
399
+ //In this case, response is set and defined, proceed...
400
+ $body = wp_remote_retrieve_body( $response );
401
+ if ( $body ) {
402
+ $products = json_decode( $body, true );
403
+ if ( isset($products['downloads']['themes']) ) {
404
+ $themes = $products['downloads']['themes'];
405
+ }
406
+ }
407
+
408
+ }
409
+ }
410
+ }
411
+
412
+ //Return themes, can be filtered by user subscription type
413
+ return apply_filters( 'installer_theme_get_themes', $themes, $this->installer_theme_active_tab );
414
+ }
415
+
416
+ /** Format response in compatibility with WordPress Theme API response */
417
+ private function installer_theme_format_response( $themes, $action, $slug = '' ) {
418
+
419
+ //Let's append download link only when retrieving theme information for installation
420
+ if ( ('theme_information' == $action) && (!(empty($slug))) ) {
421
+
422
+ //Only return one result -> the theme to be installed
423
+ foreach ( $themes as $k => $theme ) {
424
+ if ( $slug == $theme['basename'] ) {
425
+ $theme['download_link'] = WP_Installer()->append_site_key_to_download_url( $theme['url'], $this->installer_site_key[$this->installer_theme_active_tab], $this->installer_theme_active_tab );
426
+ $theme = json_decode( json_encode( $theme ), FALSE );
427
+ return $theme;
428
+ }
429
+ }
430
+
431
+ } else {
432
+
433
+ $res = new stdClass();
434
+ $res->info = array();
435
+ $res->themes = array();
436
+
437
+ //Define info
438
+ $res->info['page'] = 1;
439
+ $res->info['pages'] = 10;
440
+
441
+ //Let's count available themes ;
442
+ $res->info['results'] = count( $themes );
443
+
444
+ //Let's saved themes for easy access later on
445
+ $this->installer_theme_savethemes_by_slug( $themes );
446
+
447
+ //Let's defined available themes
448
+ if ( isset($this->installer_theme_subscription_type) ) {
449
+ //Has subscription type defined, let's saved what is associated with this subscription
450
+ $this->installer_theme_available( $this->installer_theme_active_tab, $this->installer_theme_subscription_type );
451
+ } else {
452
+ $this->installer_theme_available( $this->installer_theme_active_tab );
453
+ }
454
+
455
+ //Let's add themes to the overriden WordPress API Theme response
456
+ /** Installer 1.7.6: Update to compatible data format response from WP Theme API */
457
+ $theme_compatible_array=array();
458
+ if ((is_array($themes))) {
459
+ foreach ($themes as $k=>$v) {
460
+ $theme_compatible_array[]=(object)($v);
461
+ }
462
+ }
463
+ $res->themes = $theme_compatible_array;
464
+ $res->themes = apply_filters( 'installer_theme_hook_response_theme', $res->themes );
465
+ return $res;
466
+ }
467
+ }
468
+
469
+ /** Let's save all available themes by its slug after any latest API query */
470
+ private function installer_theme_savethemes_by_slug( $themes, $doing_query = false ) {
471
+
472
+ if ( !($doing_query) ) {
473
+ $this->installer_themes[$this->installer_theme_active_tab] = array();
474
+ }
475
+
476
+ if ( !(empty($themes)) ) {
477
+ $themes_for_saving = array();
478
+ foreach ( $themes as $k => $theme ) {
479
+ if ( !($doing_query) ) {
480
+ if ( isset($theme['slug']) ) {
481
+ $theme_slug = $theme['slug'];
482
+ if ( !(empty($theme_slug)) ) {
483
+ $themes_for_saving[] = $theme_slug;
484
+ }
485
+ }
486
+ } else {
487
+
488
+ if ( ((isset($theme['slug'])) && (isset($theme['version'])) &&
489
+ (isset($theme['theme_page_url']))) && (isset($theme['url']))
490
+ ) {
491
+ $theme_slug = $theme['slug'];
492
+ $theme_version = $theme['version'];
493
+ $theme_page_url = $theme['theme_page_url'];
494
+ $theme_url = $theme['url'];
495
+ if ( (!(empty($theme_slug))) && (!(empty($theme_version))) &&
496
+ (!(empty($theme_page_url))) && (!(empty($theme_url)))
497
+ ) {
498
+ //$theme_slug is unique for every theme
499
+ $themes_for_saving[$theme_slug] = array(
500
+ 'version' => $theme_version,
501
+ 'theme_page_url' => $theme_page_url,
502
+ 'url' => $theme_url
503
+ );
504
+
505
+ }
506
+ }
507
+ }
508
+
509
+ }
510
+
511
+ if ( !(empty($themes_for_saving)) ) {
512
+ //Has themes for saving
513
+ if ( !($doing_query) ) {
514
+ //Not doing query
515
+ $existing_themes = get_option( $this->installer_themes_option[$this->installer_theme_active_tab] );
516
+ if ( !($existing_themes) ) {
517
+ //Does not yet exists
518
+ delete_option( $this->installer_themes_option[$this->installer_theme_active_tab] );
519
+ update_option( $this->installer_themes_option[$this->installer_theme_active_tab], $themes_for_saving );
520
+ } else {
521
+ //exists, check if we need to update
522
+ if ( $existing_themes == $themes_for_saving ) {
523
+ //Equal, no need to update here
524
+ } else {
525
+ //Update
526
+ delete_option( $this->installer_themes_option[$this->installer_theme_active_tab] );
527
+ update_option( $this->installer_themes_option[$this->installer_theme_active_tab], $themes_for_saving );
528
+ }
529
+ }
530
+ } else {
531
+ //Used for query purposes only, don't save anything
532
+ return $themes_for_saving;
533
+ }
534
+ }
535
+ }
536
+ }
537
+
538
+ /** Available themes */
539
+ private function installer_theme_available( $repo, $subscription_type = '' ) {
540
+
541
+ $subscription_type = intval( $subscription_type );
542
+ if ( $subscription_type > 0 ) {
543
+
544
+ //Here we have a case of validated subscription
545
+ //We need to set themes that is available to this subscription
546
+ $themes_associated_with_subscription = $this->installer_themes[$repo] = $this->installer_theme_get_themes_by_subscription( $subscription_type, $repo );
547
+ if ( !(empty($themes_associated_with_subscription)) ) {
548
+ //Has themes
549
+ $this->installer_themes[$repo] = $themes_associated_with_subscription;
550
+ }
551
+ } else {
552
+
553
+ //Get themes
554
+ $this->installer_themes[$repo] = get_option( $this->installer_themes_option[$repo] );
555
+ }
556
+ }
557
+
558
+ /** Theme upgrade check */
559
+ public function installer_theme_upgrade_check( $the_value ) {
560
+
561
+ //Step1: Let's looped through repos with themes and check if we have updates available for them.
562
+ if ( (is_array( $this->installer_repo_with_themes )) && (!(empty($this->installer_repo_with_themes))) ) {
563
+ foreach ( $this->installer_repo_with_themes as $k => $repo_slug ) {
564
+ //Step2: Let's checked if we have update for this theme
565
+ $update_available = get_option( $this->installer_themes_available_updates[$repo_slug] );
566
+ if ( $update_available ) {
567
+ if ( (is_array( $update_available )) && (!(empty($update_available))) ) {
568
+ //Has updates available coming from this specific theme repo
569
+ //Let's loop through the themes that needs update
570
+ foreach ( $update_available as $theme_slug => $v ) {
571
+ //Add to response API
572
+ $the_value->response [$theme_slug] = array(
573
+ 'theme' => $theme_slug,
574
+ 'new_version' => $v['new_version'],
575
+ 'url' => $v['url'],
576
+ 'package' => $v['package']
577
+ );
578
+ }
579
+ }
580
+ }
581
+ }
582
+ }
583
+ //Return
584
+ return $the_value;
585
+ }
586
+
587
+ /** Return repositories that has themes */
588
+ private function installer_theme_reposities_that_has_themes( $repositories, $ret_value = true, $doing_api_query = false ) {
589
+
590
+ $repositories_with_themes = array();
591
+
592
+ if ( (is_array( $repositories )) && (!(empty($repositories))) ) {
593
+
594
+ //Let's checked if we have something before
595
+ $themes = get_option( 'installer_repositories_with_theme' );
596
+
597
+ if ( (!($themes)) || ($doing_api_query) ) {
598
+ //Not yet defined
599
+ //Loop through each repositories and check whether they have themes
600
+ foreach ( $repositories as $k => $v ) {
601
+ if ( isset($v['products']) ) {
602
+ $products_url = $v['products'];
603
+ $themes = $this->installer_theme_get_themes( $products_url, $k );
604
+ if ( (is_array( $themes )) && (!(empty($themes))) ) {
605
+ //Repo has themes
606
+ $repositories_with_themes[] = $k;
607
+ }
608
+ }
609
+ }
610
+ } else {
611
+ //Already set
612
+ $repositories_with_themes = $themes;
613
+ }
614
+
615
+ if ( (((is_array( $repositories_with_themes )) && (!(empty($repositories_with_themes)))) && (!($themes))) || ($doing_api_query) ) {
616
+ //Save to db
617
+ update_option( 'installer_repositories_with_theme', $repositories_with_themes );
618
+ }
619
+ }
620
+
621
+ if ( $ret_value ) {
622
+ return $repositories_with_themes;
623
+ }
624
+
625
+ }
626
+
627
+ /** When WordPress queries its own Themes API, we sync with our own */
628
+ public function installer_theme_sync_native_wp_api( $response, $responsetext, $class, $args, $url ) {
629
+
630
+ $api_native_string = 'api.wordpress.org/themes/';
631
+ if ( (strpos( $url, $api_native_string ) !== false) ) {
632
+ //WordPress is querying its own themes API
633
+ $installer_repositories = WP_Installer()->get_repositories();
634
+
635
+ //Query our own API and update repository values too
636
+ $this->installer_theme_reposities_that_has_themes( $installer_repositories, false, true );
637
+ }
638
+ }
639
+
640
+ /** Returns product name by theme repo slug */
641
+ private function installer_theme_get_repo_product_name( $theme_repo ) {
642
+
643
+ $theme_repo_name = false;
644
+
645
+ if ( isset(WP_Installer()->settings['repositories'][$theme_repo]['data']['product-name']) ) {
646
+ //Set
647
+ $prod_name = WP_Installer()->settings['repositories'][$theme_repo]['data']['product-name'];
648
+ if ( !(empty($prod_name)) ) {
649
+ $theme_repo_name = $prod_name;
650
+ }
651
+ } else {
652
+ //Not yet
653
+ if ( $theme_repo == $this->theme_repo ) {
654
+ $result = $this->installer_theme_general_api_query();
655
+ if ( isset($result['product-name']) ) {
656
+ $product_name = $result['product-name'];
657
+ if ( !(empty($product_name)) ) {
658
+ $theme_repo_name = $product_name;
659
+ }
660
+ }
661
+ }
662
+ }
663
+
664
+ return $theme_repo_name;
665
+ }
666
+
667
+ /** General query API method, returns $products */
668
+ private function installer_theme_general_api_query() {
669
+ $products = false;
670
+ $response = wp_remote_get( $this->repository_theme_products );
671
+ if ( !(is_wp_error( $response )) ) {
672
+ //Not WP error
673
+ //Evaluate response
674
+ if ( $response && isset($response['response']['code']) && $response['response']['code'] == 200 ) {
675
+ //In this case, response is set and defined, proceed...
676
+ $body = wp_remote_retrieve_body( $response );
677
+ if ( $body ) {
678
+ $result = json_decode( $body, true );
679
+ if ( (is_array( $result )) && (!(empty($result))) ) {
680
+ $products = $result;
681
+ }
682
+ }
683
+
684
+ }
685
+ }
686
+
687
+ return $products;
688
+ }
689
+
690
+ /** General method to check if themes are OTGS themes based on its slug*/
691
+ private function installer_themes_belong_to_us( $theme_slug ) {
692
+
693
+ $found = false;
694
+ $theme_slug = trim( $theme_slug );
695
+
696
+ foreach ( $this->installer_themes as $repo_with_theme => $themes ) {
697
+ foreach ( $themes as $k => $otgs_theme_slug ) {
698
+ if ( $theme_slug == $otgs_theme_slug ) {
699
+ //match found! Theme belongs to otgs
700
+ return true;
701
+ }
702
+ }
703
+ }
704
+ return $found;
705
+
706
+ }
707
+
708
+ /** Sets active tab on init */
709
+ public function installer_theme_sets_active_tab_on_init() {
710
+
711
+ if ( isset ($_SERVER ['REQUEST_URI']) ) {
712
+ $request_uri = $_SERVER ['REQUEST_URI'];
713
+ if ( isset ($_GET ['browse']) ) {
714
+ $active_tab = sanitize_text_field( $_GET['browse'] );
715
+ $this->installer_theme_active_tab = $active_tab;
716
+ } elseif ( isset ($_POST ['request'] ['browse']) ) {
717
+ $active_tab = sanitize_text_field ( $_POST['request']['browse'] );
718
+ $this->installer_theme_active_tab = $active_tab;
719
+ } elseif ( (isset ($_GET ['theme_repo'])) && (isset ($_GET ['action'])) ) {
720
+ $theme_repo = sanitize_text_field( $_GET['theme_repo'] );
721
+ $the_action = sanitize_text_field( $_GET['action'] );
722
+ if ( ('install-theme' == $the_action) && (!(empty($theme_repo))) ) {
723
+ $this->installer_theme_active_tab = $theme_repo;
724
+ }
725
+ } elseif ( wp_get_referer() ) {
726
+ $referer = wp_get_referer();
727
+ $parts = parse_url( $referer );
728
+ if ( isset($parts['query']) ) {
729
+ parse_str( $parts['query'], $query );
730
+ if ( isset($query['browse']) ) {
731
+ $this->installer_theme_active_tab = $query['browse'];
732
+ }
733
+ }
734
+ }
735
+ }
736
+ }
737
+
738
+ /** WP Theme API compatibility- added num ratings */
739
+ /** Installer 1.7.6+ Added updated 'rating' field */
740
+ public function installer_theme_add_num_ratings( $themes ) {
741
+
742
+ if ( (is_array( $themes )) && (!(empty($themes))) ) {
743
+ foreach ( $themes as $k => $v ) {
744
+ if ( !(isset($v->num_ratings)) ) {
745
+ $themes[$k]->num_ratings = 100;
746
+ }
747
+ if ( !(isset($v->rating)) ) {
748
+ $themes[$k]->rating = 100;
749
+ }
750
+ }
751
+ }
752
+
753
+ return $themes;
754
+ }
755
+
756
+ /** When WordPress.org makes a call to its repository, let's run our own upgrade checks too */
757
+ public function installer_theme_sync_call_wp_theme_api( $locales ) {
758
+
759
+ $this->installer_theme_upgrade_theme_check();
760
+
761
+ return $locales;
762
+ }
763
+
764
+ /** Upgrade theme check */
765
+ private function installer_theme_upgrade_theme_check() {
766
+
767
+ // Step1-> we get all installed themes in clients local themes directory
768
+ $installed_themes = wp_get_themes();
769
+
770
+ // Step2: We need to loop through each repository with themes
771
+ foreach ( $this->installer_repo_with_themes as $k => $repo_slug ) {
772
+
773
+ // We then need to retrieved the products URL for each of this repo
774
+ $products_url = $this->repository_theme_products [$repo_slug];
775
+
776
+ // Step3-> we get all available themes in our repository via API based on this URL
777
+ $available_themes = $this->installer_theme_get_themes( $products_url, $repo_slug );
778
+
779
+ if ( !($available_themes) ) {
780
+
781
+ // API is not available as of the moment, return..
782
+ return;
783
+ } else {
784
+
785
+ // We have available themes here...
786
+ // Step4->let's simplify available themes data by slugs
787
+ $simplified_available_themes = $this->installer_theme_savethemes_by_slug( $available_themes, true );
788
+
789
+ // Step5->Let's loop through installed themes
790
+ if ( (is_array( $installed_themes )) && (!(empty ($installed_themes))) ) {
791
+ $otgs_theme_updates_available = array();
792
+ foreach ( $installed_themes as $theme_slug => $theme_object ) {
793
+ if ( array_key_exists( $theme_slug, $simplified_available_themes ) ) {
794
+
795
+ // This is our theme
796
+ // Step6->Let's get version of the local theme installed
797
+ $local_version = $theme_object->get( 'Version' );
798
+
799
+ // Step7->Let's get the latest version of this theme, page URL and download URL from our repository
800
+ $repository_version = $simplified_available_themes [$theme_slug] ['version'];
801
+ $theme_page_url = $simplified_available_themes [$theme_slug] ['theme_page_url'];
802
+ $theme_download_url = $simplified_available_themes [$theme_slug] ['url'];
803
+
804
+ // Step8->Let's compare the version
805
+ if ( version_compare( $repository_version, $local_version, '>' ) ) {
806
+
807
+ // Update available for this theme
808
+ // Step9-> Define download URL with site key
809
+ $package_url = WP_Installer()->append_site_key_to_download_url( $theme_download_url, $this->installer_site_key [$repo_slug], $repo_slug );
810
+
811
+ //Step10-> Assign to updates array for later accessing.
812
+ $otgs_theme_updates_available[$theme_slug] = array(
813
+ 'theme' => $theme_slug,
814
+ 'new_version' => $repository_version,
815
+ 'url' => $theme_page_url,
816
+ 'package' => $package_url
817
+ );
818
+ }
819
+ }
820
+ }
821
+ //Exited the upgrade loop for this specific theme repository
822
+ if ( !(empty($otgs_theme_updates_available)) ) {
823
+ //Has updates
824
+ update_option( $this->installer_themes_available_updates[$repo_slug], $otgs_theme_updates_available );
825
+ } else {
826
+ //No updates
827
+ delete_option( $this->installer_themes_available_updates[$repo_slug] );
828
+ }
829
+
830
+ }
831
+ }
832
+ }
833
+ }
834
+
835
+ /** When the user is on Themes install page OTG themes repository, let's the currently selected tab */
836
+ public function installer_theme_add_query_arg_tab( $url, $path, $blog_id = null ) {
837
+
838
+ $wp_install_string = 'update.php?action=install-theme';
839
+ if ( $path == $wp_install_string ) {
840
+ if ( isset($this->installer_theme_active_tab) ) {
841
+ if ( !(empty($this->installer_theme_active_tab)) ) {
842
+ $url = add_query_arg( array(
843
+ 'theme_repo' => $this->installer_theme_active_tab
844
+ ), $url );
845
+ }
846
+ }
847
+ }
848
+ return $url;
849
+ }
850
+
851
+ /** Save frontend theme tab selected */
852
+ public function installer_theme_frontend_selected_tab() {
853
+ if ( isset($_POST["frontend_tab_selected"]) ) {
854
+ check_ajax_referer( 'installer_theme_frontend_selected_tab', 'installer_theme_frontend_selected_tab_nonce' );
855
+
856
+ //Client_side_active_tab
857
+ $frontend_tab_selected = sanitize_text_field( $_POST['frontend_tab_selected'] );
858
+ if ( !(empty($frontend_tab_selected)) ) {
859
+ //Front end tab selected
860
+ update_option( 'wp_installer_clientside_active_tab', $frontend_tab_selected, false );
861
+
862
+ //Check for registration status
863
+ if ( isset($this->theme_user_registration[$frontend_tab_selected]) ) {
864
+ //Set
865
+ if ( !($this->theme_user_registration[$frontend_tab_selected]) ) {
866
+ //Not registered yet
867
+
868
+ if ( is_multisite() ) {
869
+ $admin_url_passed = network_admin_url();
870
+ } else {
871
+ $admin_url_passed = admin_url();
872
+ }
873
+
874
+ $registration_url = $admin_url_passed . 'plugin-install.php?tab=commercial#installer_repo_' . $frontend_tab_selected;
875
+
876
+ //Message and link
877
+ $theme_repo_name = $this->installer_theme_get_repo_product_name( $frontend_tab_selected );;
878
+ $response['unregistered_messages'] = sprintf( __( 'To install and update %s, please %sregister%s %s for this site.', 'installer' ),
879
+ $theme_repo_name, '<a href="' . $registration_url . '">', '</a>', $theme_repo_name );
880
+
881
+ }
882
+ }
883
+
884
+ $response['output'] = $frontend_tab_selected;
885
+ echo json_encode( $response );
886
+ }
887
+ die();
888
+ }
889
+ die();
890
+ }
891
+
892
+ /** Installer loaded aux hooks */
893
+ public function installer_theme_loaded_hooks() {
894
+
895
+ if ( isset($this->installer_theme_subscription_type) ) {
896
+ $subscription_type = intval( $this->installer_theme_subscription_type );
897
+ if ( $subscription_type > 0 ) {
898
+ //Client is subscribed
899
+ add_filter( 'installer_theme_get_themes', array($this, 'installer_theme_filter_themes_by_subscription'), 10, 2 );
900
+ }
901
+ }
902
+
903
+ }
904
+
905
+ /** Get themes by subscription type */
906
+ protected function installer_theme_get_themes_by_subscription( $subscription_type, $repo ) {
907
+
908
+ $themes_associated_with_subscription = array();
909
+ if ( isset(WP_Installer()->settings['repositories'][$repo]['data']['packages']) ) {
910
+ //Set
911
+ $packages = WP_Installer()->settings['repositories'][$repo]['data']['packages'];
912
+ $available_themes_subscription = array();
913
+ foreach ( $packages as $package_id => $package_details ) {
914
+ if ( isset($package_details['products']) ) {
915
+ $the_products = $package_details['products'];
916
+ foreach ( $the_products as $product_slug => $product_details ) {
917
+ if ( isset($product_details['subscription_type']) ) {
918
+ $subscription_type_from_settings = intval( $product_details['subscription_type'] );
919
+ if ( $subscription_type_from_settings == $subscription_type ) {
920
+ //We found the subscription
921
+ if ( isset($product_details['themes']) ) {
922
+ $themes_associated_with_subscription = $product_details['themes'];
923
+ return $themes_associated_with_subscription;
924
+ }
925
+ }
926
+ }
927
+
928
+ }
929
+ }
930
+ }
931
+ }
932
+ return $themes_associated_with_subscription;
933
+ }
934
+
935
+ /** Filter API theme response according to user subscription */
936
+ public function installer_theme_filter_themes_by_subscription( $themes, $active_tab ) {
937
+
938
+ //Step1, we only filter OTGS themes
939
+ $orig = count( $themes );
940
+ if ( in_array( $active_tab, $this->theme_repo ) ) {
941
+ //OTGS Theme
942
+ //Step2, we retrieved the available themes based on client subscription
943
+ if ( isset($this->installer_themes[$active_tab]) ) {
944
+ $available_themes = $this->installer_themes[$active_tab];
945
+ //Step3, we filter $themes based on this info
946
+ if ( (is_array( $themes )) && (!(empty($themes))) ) {
947
+ foreach ( $themes as $k => $theme ) {
948
+ //Step4, get theme slug
949
+ if ( isset($theme['slug']) ) {
950
+ $theme_slug = $theme['slug'];
951
+ if ( !(empty($theme_slug)) ) {
952
+ if ( !(in_array( $theme_slug, $available_themes )) ) {
953
+ //This theme is not in available themes
954
+ unset($themes[$k]);
955
+ }
956
+ }
957
+ }
958
+ }
959
+ }
960
+ }
961
+ }
962
+ $new = count( $themes );
963
+ if ( $orig != $new ) {
964
+ //It is filtered
965
+ $themes = array_values( $themes );
966
+ }
967
+
968
+ return $themes;
969
+ }
970
+
971
+ /** Hook to wp_loaded, fires when all Installer theme class is ready */
972
+ public function installer_themes_support_set_up_func() {
973
+ do_action( 'installer_themes_support_set_up' );
974
+ }
975
+
976
+ }
977
+
978
+ /** Instantiate Installer Theme Class */
979
  new Installer_Theme_Class;
vendor/otgs/installer/includes/installer-api.php CHANGED
@@ -1,116 +1,116 @@
1
- <?php
2
-
3
- class WP_Installer_API{
4
-
5
- public static function get_product_installer_link($repository_id, $package_id = false){
6
-
7
- $menu_url = WP_Installer()->menu_url();
8
-
9
- $url = $menu_url . '#' . $repository_id;
10
- if($package_id){
11
- $url .= '/' . $package_id;
12
- }
13
-
14
- return $url;
15
-
16
- }
17
-
18
- public static function get_product_price($repository_id, $package_id, $product_id, $incl_discount = false){
19
-
20
- $price = WP_Installer()->get_product_price($repository_id, $package_id, $product_id, $incl_discount);
21
-
22
- return $price;
23
- }
24
-
25
- /**
26
- * Retrieve the preferred translation service.
27
- *
28
- * @since 1.6.5
29
- *
30
- * @param string The repository id (e.g. wpml)
31
- * @return string The translation service id
32
- */
33
- public static function get_preferred_ts($repository_id = 'wpml'){
34
-
35
- if(isset(WP_Installer()->settings['repositories'][$repository_id]['ts_info']['preferred'])){
36
- return WP_Installer()->settings['repositories'][$repository_id]['ts_info']['preferred'];
37
- }
38
-
39
- return false;
40
-
41
- }
42
-
43
- /**
44
- * Set the preferred translation service.
45
- *
46
- * @since 1.6.5
47
- *
48
- * @param string The translation service id
49
- * @param string The repository id (e.g. wpml)
50
- */
51
- public static function set_preferred_ts( $value, $repository_id = 'wpml' ){
52
-
53
- if( isset( WP_Installer()->settings['repositories'][$repository_id]['ts_info']['preferred'] ) ){
54
-
55
- WP_Installer()->settings['repositories'][$repository_id]['ts_info']['preferred'] = $value;
56
-
57
- WP_Installer()->save_settings();
58
-
59
- }
60
-
61
- }
62
-
63
- /**
64
- * Retrieve the referring translation service (if any)
65
- *
66
- * @since 1.6.5
67
- *
68
- * @param string The repository id (e.g. wpml)
69
- * @return string The translation service id or false
70
- */
71
- public static function get_ts_referal($repository_id = 'wpml'){
72
-
73
- if(isset(WP_Installer()->settings['repositories'][$repository_id]['ts_info']['referal'])){
74
- return WP_Installer()->settings['repositories'][$repository_id]['ts_info']['referal'];
75
- }
76
-
77
- return false;
78
-
79
- }
80
-
81
- /**
82
- * Retrieve the translation services client id for a specific repository (if any)
83
- *
84
- * @since 1.7.9
85
- *
86
- * @param string The repository id (e.g. wpml)
87
- * @return string The client id or false
88
- */
89
- public static function get_ts_client_id( $repository_id = 'wpml' ){
90
-
91
- if(isset(WP_Installer()->settings['repositories'][$repository_id]['ts_info']['client_id'])){
92
- return WP_Installer()->settings['repositories'][$repository_id]['ts_info']['client_id'];
93
- }
94
-
95
- return false;
96
-
97
- }
98
-
99
- /**
100
- * Retrieve the site key corresponding to a repository.
101
- * This is a wrapper of WP_Installer::get_site_key()
102
- * @see WP_Installer::get_site_key()
103
- *
104
- * @since 1.7.9
105
- *
106
- * @param string The repository id (e.g. wpml)
107
- * @return string The site key (or false)
108
- */
109
- public static function get_site_key( $repository_id = 'wpml' ){
110
-
111
- return WP_Installer()->get_site_key( $repository_id );
112
-
113
- }
114
-
115
-
116
  }
1
+ <?php
2
+
3
+ class WP_Installer_API{
4
+
5
+ public static function get_product_installer_link($repository_id, $package_id = false){
6
+
7
+ $menu_url = WP_Installer()->menu_url();
8
+
9
+ $url = $menu_url . '#' . $repository_id;
10
+ if($package_id){
11
+ $url .= '/' . $package_id;
12
+ }
13
+
14
+ return $url;
15
+
16
+ }
17
+
18
+ public static function get_product_price($repository_id, $package_id, $product_id, $incl_discount = false){
19
+
20
+ $price = WP_Installer()->get_product_price($repository_id, $package_id, $product_id, $incl_discount);
21
+
22
+ return $price;
23
+ }
24
+
25
+ /**
26
+ * Retrieve the preferred translation service.
27
+ *
28
+ * @since 1.6.5
29
+ *
30
+ * @param string The repository id (e.g. wpml)
31
+ * @return string The translation service id
32
+ */
33
+ public static function get_preferred_ts($repository_id = 'wpml'){
34
+
35
+ if(isset(WP_Installer()->settings['repositories'][$repository_id]['ts_info']['preferred'])){
36
+ return WP_Installer()->settings['repositories'][$repository_id]['ts_info']['preferred'];
37
+ }
38
+
39
+ return false;
40
+
41
+ }
42
+
43
+ /**
44
+ * Set the preferred translation service.
45
+ *
46
+ * @since 1.6.5
47
+ *
48
+ * @param string The translation service id
49
+ * @param string The repository id (e.g. wpml)
50
+ */
51
+ public static function set_preferred_ts( $value, $repository_id = 'wpml' ){
52
+
53
+ if( isset( WP_Installer()->settings['repositories'][$repository_id]['ts_info']['preferred'] ) ){
54
+
55
+ WP_Installer()->settings['repositories'][$repository_id]['ts_info']['preferred'] = $value;
56
+
57
+ WP_Installer()->save_settings();
58
+
59
+ }
60
+
61
+ }
62
+
63
+ /**
64
+ * Retrieve the referring translation service (if any)
65
+ *
66
+ * @since 1.6.5
67
+ *
68
+ * @param string The repository id (e.g. wpml)
69
+ * @return string The translation service id or false
70
+ */
71
+ public static function get_ts_referal($repository_id = 'wpml'){
72
+
73
+ if(isset(WP_Installer()->settings['repositories'][$repository_id]['ts_info']['referal'])){
74
+ return WP_Installer()->settings['repositories'][$repository_id]['ts_info']['referal'];
75
+ }
76
+
77
+ return false;
78
+
79
+ }
80
+
81
+ /**
82
+ * Retrieve the translation services client id for a specific repository (if any)
83
+ *
84
+ * @since 1.7.9
85
+ *
86
+ * @param string The repository id (e.g. wpml)
87
+ * @return string The client id or false
88
+ */
89
+ public static function get_ts_client_id( $repository_id = 'wpml' ){
90
+
91
+ if(isset(WP_Installer()->settings['repositories'][$repository_id]['ts_info']['client_id'])){
92
+ return WP_Installer()->settings['repositories'][$repository_id]['ts_info']['client_id'];
93
+ }
94
+
95
+ return false;
96
+
97
+ }
98
+
99
+ /**
100
+ * Retrieve the site key corresponding to a repository.
101
+ * This is a wrapper of WP_Installer::get_site_key()
102
+ * @see WP_Installer::get_site_key()
103
+ *
104
+ * @since 1.7.9
105
+ *
106
+ * @param string The repository id (e.g. wpml)
107
+ * @return string The site key (or false)
108
+ */
109
+ public static function get_site_key( $repository_id = 'wpml' ){
110
+
111
+ return WP_Installer()->get_site_key( $repository_id );
112
+
113
+ }
114
+
115
+
116
  }
vendor/otgs/installer/includes/installer-upgrader-skins.php CHANGED
@@ -1,37 +1,37 @@
1
- <?php
2
- class Installer_Upgrader_Skins extends WP_Upgrader_Skin{
3
-
4
- function __construct($args = array()){
5
- $defaults = array( 'url' => '', 'nonce' => '', 'title' => '', 'context' => false );
6
- $this->options = wp_parse_args($args, $defaults);
7
- }
8
-
9
- function header(){
10
-
11
- }
12
-
13
- function footer(){
14
-
15
- }
16
-
17
- function error($error){
18
- $this->installer_error = $error;
19
- }
20
-
21
- function add_strings(){
22
-
23
- }
24
-
25
- function feedback($string){
26
-
27
- }
28
-
29
- function before(){
30
-
31
- }
32
-
33
- function after(){
34
-
35
- }
36
-
37
  }
1
+ <?php
2
+ class Installer_Upgrader_Skins extends WP_Upgrader_Skin{
3
+
4
+ function __construct($args = array()){
5
+ $defaults = array( 'url' => '', 'nonce' => '', 'title' => '', 'context' => false );
6
+ $this->options = wp_parse_args($args, $defaults);
7
+ }
8
+
9
+ function header(){
10
+
11
+ }
12
+
13
+ function footer(){
14
+
15
+ }
16
+
17
+ function error($error){
18
+ $this->installer_error = $error;
19
+ }
20
+
21
+ function add_strings(){
22
+
23
+ }
24
+
25
+ function feedback($string){
26
+
27
+ }
28
+
29
+ function before(){
30
+
31
+ }
32
+
33
+ function after(){
34
+
35
+ }
36
+
37
  }
vendor/otgs/installer/includes/installer.class.php CHANGED
@@ -1,2680 +1,2680 @@
1
- <?php
2
-
3
- final class WP_Installer{
4
- protected static $_instance = null;
5
-
6
- public $settings = array();
7
-
8
- private $repositories = array();
9
-
10
- protected $api_debug = '';
11
-
12
- private $config = array();
13
-
14
- protected $_plugins_renew_warnings = array();
15
-
16
- protected $_gz_on = false;
17
-
18
- private $admin_messages = array();
19
-
20
- private $_using_icl = false;
21
- private $_wpml_version = false;
22
-
23
- private $package_source = array();
24
-
25
- const SITE_KEY_VALIDATION_SOURCE_OTHER = 0;
26
- const SITE_KEY_VALIDATION_SOURCE_DOWNLOAD_SPECIFIC = 1;
27
- const SITE_KEY_VALIDATION_SOURCE_DOWNLOAD_REPORT = 2;
28
- const SITE_KEY_VALIDATION_SOURCE_REGISTRATION = 3;
29
- const SITE_KEY_VALIDATION_SOURCE_REVALIDATION = 4;
30
- const SITE_KEY_VALIDATION_SOURCE_UPDATES_CHECK = 5;
31
-
32
- public $dependencies;
33
-
34
- public static function instance() {
35
-
36
- if ( is_null( self::$_instance ) ) {
37
- self::$_instance = new self();
38
- }
39
-
40
- return self::$_instance;
41
- }
42
-
43
- public function __construct(){
44
-
45
- if(!is_admin() || !is_user_logged_in()) return; //Only for admin
46
-
47
- $this->_gz_on = function_exists('gzuncompress') && function_exists('gzcompress');
48
- $this->settings = $this->get_settings();
49
-
50
- add_action('admin_notices', array($this, 'show_site_key_nags'));
51
-
52
- add_action('admin_notices', array($this, 'show_admin_messages'));
53
-
54
- add_action('admin_init', array($this, 'load_embedded_plugins'), 0);
55
-
56
- add_action('admin_menu', array($this, 'menu_setup'));
57
- add_action('network_admin_menu', array($this, 'menu_setup'));
58
-
59
- if(defined('DOING_AJAX') && isset($_POST['action']) && $_POST['action'] == 'installer_download_plugin'){
60
- add_filter( 'site_transient_update_plugins', array( $this, 'plugins_upgrade_check') );
61
- }
62
- add_filter('plugins_api', array( $this, 'custom_plugins_api_call'), 10, 3);
63
- add_filter('pre_set_site_transient_update_plugins', array( $this, 'plugins_upgrade_check'));
64
-
65
- // register repositories
66
- $this->load_repositories_list();
67
-
68
- if( empty($this->settings['last_repositories_update']) || time() - $this->settings['last_repositories_update'] > 86400
69
- || ( isset($_GET['force-check']) && $_GET['force-check'] == 1 ) ){
70
- $this->refresh_repositories_data();
71
- }
72
-
73
- // default config
74
- $this->config['plugins_install_tab'] = false;
75
-
76
- add_action('init', array($this, 'init'));
77
-
78
- //add_filter('wp_installer_buy_url', array($this, 'append_parameters_to_buy_url'));
79
-
80
- add_action('init', array($this,'load_locale'));
81
-
82
- }
83
-
84
- public function get_repositories() {
85
-
86
- return $this->repositories;
87
-
88
- }
89
-
90
- public function set_config($key, $value){
91
-
92
- $this->config[$key] = $value;
93
-
94
- }
95
-
96
- public function init(){
97
- global $pagenow;
98
-
99
- $this->dependencies = new Installer_Dependencies;
100
-
101
- if(empty($this->settings['_pre_1_0_clean_up'])) {
102
- $this->_pre_1_0_clean_up();
103
- }
104
-
105
- $this->settings = $this->_old_products_format_backwards_compatibility($this->settings);
106
-
107
- if ( !function_exists( 'get_plugins' ) ) {
108
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
109
- }
110
-
111
- $this->_using_icl = function_exists('wpml_site_uses_icl') && wpml_site_uses_icl();
112
- $this->_wpml_version = defined('ICL_SITEPRESS_VERSION') ? ICL_SITEPRESS_VERSION : '';
113
-
114
- wp_enqueue_script('installer-admin', $this->res_url() . '/res/js/admin.js', array('jquery'), $this->version());
115
- wp_enqueue_style('installer-admin', $this->res_url() . '/res/css/admin.css', array(), $this->version());
116
-
117
- $translation_array = array(
118
- 'installing' => __( 'Installing %s', 'installer' ),
119
- 'updating' => __( 'Updating %s', 'installer' ),
120
- 'activating' => __( 'Activating %s', 'installer' )
121
- );
122
-
123
- wp_localize_script( 'installer-admin', 'installer_strings', $translation_array );
124
-
125
- if($pagenow == 'plugins.php'){
126
- add_action('admin_notices', array($this, 'setup_plugins_page_notices'));
127
- add_action('admin_notices', array($this, 'setup_plugins_renew_warnings'), 10);
128
- add_action('admin_notices', array($this, 'queue_plugins_renew_warnings'), 20);
129
-
130
- add_action('admin_init', array($this, 'setup_plugins_action_links'));
131
-
132
- }
133
-
134
- if($this->is_repositories_page()){
135
- add_action('admin_init', array($this, 'validate_repository_subscription'));
136
- }
137
-
138
- if(defined('DOING_AJAX')){
139
- add_action('wp_ajax_save_site_key', array($this, 'save_site_key'));
140
- add_action('wp_ajax_remove_site_key', array($this, 'remove_site_key_ajax'));
141
- add_action('wp_ajax_update_site_key', array($this, 'update_site_key'));
142
-
143
- add_action('wp_ajax_installer_download_plugin', array($this, 'download_plugin_ajax_handler'));
144
- add_action('wp_ajax_installer_activate_plugin', array($this, 'activate_plugin'));
145
-
146
- add_action('wp_ajax_installer_dismiss_nag', array($this, 'dismiss_nag'));
147
- }
148
-
149
- if($pagenow == 'update.php'){
150
- if(isset($_GET['action']) && $_GET['action'] == 'update-selected'){
151
- add_action('admin_head', array($this, 'plugin_upgrade_custom_errors')); //iframe/bulk
152
- }else{
153
- add_action('all_admin_notices', array($this, 'plugin_upgrade_custom_errors')); //regular/singular
154
- }
155
- }
156
-
157
- // WP 4.2
158
- if(defined('DOING_AJAX')){
159
- add_action('wp_ajax_update-plugin', array($this, 'plugin_upgrade_custom_errors'), 0); // high priority, before WP
160
- }
161
-
162
- //Include theme support
163
- include_once $this->plugin_path() . '/includes/class-installer-theme.php';
164
-
165
- // Extra information about the source of Installer
166
- $package_source_file = $this->plugin_path() . '/installer-source.json';
167
- if( file_exists( $package_source_file ) ){
168
- WP_Filesystem();
169
- global $wp_filesystem;
170
- $this->package_source = json_decode( $wp_filesystem->get_contents( $package_source_file ) );
171
- }
172
- }
173
-
174
- protected function log($message){
175
- require_once ABSPATH . 'wp-admin/includes/file.php';
176
- WP_Filesystem();
177
- global $wp_filesystem;
178
- if( defined('WPML_INSTALLER_LOGGING') && WPML_INSTALLER_LOGGING ){
179
- $wp_filesystem->put_contents( $this->plugin_path() . '/installer.log', current_time( 'mysql' ) . "\t" . $message . "\n" );
180
- }
181
- }
182
-
183
- public function register_admin_message($text, $type = 'updated'){
184
- $this->admin_messages[] = array('text' => $text, 'type' => $type);
185
- }
186
-
187
- public function show_admin_messages(){
188
- if(!empty($this->admin_messages)){
189
- $types = array( 'error', 'updated', 'notice' );
190
- foreach($this->admin_messages as $message){
191
- $class = in_array( $message['type'], $types ) ? $message['type'] : 'updated';
192
- ?>
193
- <div class="<?php echo $class ?>">
194
- <p>
195
- <?php echo $message['text'] ?>
196
- </p>
197
- </div>
198
- <?php
199
- }
200
- }
201
- }
202
-
203
- public function load_locale(){
204
- $locale = get_locale();
205
- $locale = apply_filters( 'plugin_locale', $locale, 'installer' );
206
- $mo_file = $this->plugin_path() . '/locale/installer-' . $locale . '.mo';
207
- if(file_exists($mo_file)){
208
- load_textdomain( 'installer', $mo_file );
209
- }
210
- }
211
-
212
- public function load_embedded_plugins(){
213
- if(file_exists($this->plugin_path() . '/embedded-plugins' )) {
214
- include_once $this->plugin_path() . '/embedded-plugins/embedded-plugins.class.php';
215
- $this->installer_embedded_plugins = new Installer_Embedded_Plugins();
216
- }
217
- }
218
-
219
- public function menu_setup(){
220
- global $pagenow;
221
-
222
- if(is_multisite() && !is_network_admin()){
223
- $this->menu_multisite_redirect();
224
- add_options_page(__('Installer', 'installer'), __('Installer', 'installer'), 'manage_options', 'installer', array($this, 'show_products')) ;
225
- }else{
226
- if($this->config['plugins_install_tab'] && is_admin() && $pagenow == 'plugin-install.php'){
227
- // Default GUI, under Plugins -> Install
228
- add_filter('install_plugins_tabs', array($this, 'add_install_plugins_tab'));
229
- add_action('install_plugins_commercial', array($this, 'show_products'));
230
- }
231
- }
232
-
233
- }
234
-
235
- public function menu_url(){
236
- if(is_multisite()){
237
- if(is_network_admin()){
238
- $url = network_admin_url('plugin-install.php?tab=commercial');
239
- }else{
240
- $url = admin_url('options-general.php?page=installer');
241
- }
242
- }else{
243
- $url = admin_url('plugin-install.php?tab=commercial');
244
- }
245
- return $url;
246
- }
247
-
248
- private function menu_multisite_redirect(){
249
- global $pagenow;
250
-
251
- if($pagenow == 'plugin-install.php' && isset($_GET['tab']) && $_GET['tab'] == 'commercial'){
252
- wp_redirect($this->menu_url());
253
- exit;
254
- }
255
-
256
- }
257
-
258
- private function _pre_1_0_clean_up(){
259
- global $wpdb;
260
-
261
- if(!defined('WPRC_VERSION')){
262
- $old_tables = array(
263
- $wpdb->prefix . 'wprc_cached_requests',
264
- $wpdb->prefix . 'wprc_extension_types',
265
- $wpdb->prefix . 'wprc_extensions',
266
- $wpdb->prefix . 'wprc_repositories',
267
- $wpdb->prefix . 'wprc_repositories_relationships',
268
- );
269
-
270
- foreach($old_tables as $table){
271
- $wpdb->query(sprintf("DROP TABLE IF EXISTS %s", $table));
272
- }
273
-
274
- }
275
-
276
- $this->settings['_pre_1_0_clean_up'] = true;
277
- $this->save_settings();
278
- }
279
-
280
- public function setup_plugins_action_links(){
281
-
282
- $plugins = get_plugins();
283
-
284
- $repositories_plugins = array();
285
-
286
- if( !empty($this->settings['repositories']) ) {
287
-
288
- foreach ( $this->settings['repositories'] as $repository_id => $repository ) {
289
-
290
- foreach ( $repository['data']['packages'] as $package ) {
291
-
292
- foreach ( $package['products'] as $product ) {
293
-
294
- foreach ( $product['plugins'] as $plugin_slug ) {
295
-
296
- $download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
297
-
298
- if ( !isset($repositories_plugins[$repository_id][$download['slug']]) ) {
299
- $repositories_plugins[$repository_id][$download['slug']] = array(
300
- 'name' => $download['name'],
301
- 'registered' => $this->plugin_is_registered( $repository_id, $download['slug'] ) ? 1 : 0
302
- );
303
- }
304
-
305
- }
306
-
307
- }
308
-
309
- }
310
-
311
- foreach ( $plugins as $plugin_id => $plugin ) {
312
-
313
- $wp_plugin_slug = dirname( $plugin_id );
314
- if ( empty($wp_plugin_slug) ) {
315
- $wp_plugin_slug = basename( $plugin_id, '.php' );
316
- }
317
-
318
- foreach ( $repositories_plugins as $repository_id => $r_plugins ) {
319
-
320
- foreach ( $r_plugins as $slug => $r_plugin ) {
321
-
322
- if ( $wp_plugin_slug == $slug || $r_plugin['name'] == $plugin['Name'] || $r_plugin['name'] == $plugin['Title'] ) { //match order: slug, name, title
323
-
324
- if ( $r_plugin['registered'] ) {
325
- add_filter( 'plugin_action_links_' . $plugin_id, array($this, 'plugins_action_links_registered') );
326
- } else {
327
- add_filter( 'plugin_action_links_' . $plugin_id, array($this, 'plugins_action_links_not_registered') );
328
- }
329
-
330
- }
331
-
332
- }
333
-
334
- }
335
-
336
-
337
- }
338
-
339
- }
340
- }
341
-
342
- }
343
-
344
- public function plugins_action_links_registered($links){
345
- $links[] = '<a href="' . $this->menu_url() . '">' . __('Registered', 'installer') . '</a>';
346
- return $links;
347
- }
348
-
349
- public function plugins_action_links_not_registered($links){
350
- $links[] = '<a href="' . $this->menu_url() . '">' . __('Register', 'installer') . '</a>';
351
- return $links;
352
- }
353
-
354
- public function plugin_is_registered($repository_id, $slug){
355
-
356
- $registered = false;
357
-
358
- if( $this->repository_has_valid_subscription($repository_id) ){
359
-
360
- $subscription_type = $this->get_subscription_type_for_repository($repository_id);
361
- $r_plugins = array();
362
-
363
- foreach($this->settings['repositories'][$repository_id]['data']['packages'] as $package){
364
-
365
- foreach($package['products'] as $product){
366
-
367
- if( $product['subscription_type'] == $subscription_type || $this->have_superior_subscription($subscription_type, $product) ) {
368
-
369
- foreach ($product['plugins'] as $plugin_slug) {
370
-
371
- $download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
372
-
373
- if (!isset($rep_plugins[$download['slug']])) {
374
- $r_plugins[$download['slug']] = $download['slug'];
375
- }
376
-
377
- }
378
-
379
- }
380
-
381
- }
382
-
383
- }
384
-
385
- $registered = isset($r_plugins[$slug]);
386
-
387
- }
388
-
389
-
390
- return $registered;
391
-
392
- }
393
-
394
- public function version(){
395
- return WP_INSTALLER_VERSION;
396
- }
397
-
398
- public function plugin_path() {
399
- return untrailingslashit( plugin_dir_path( dirname(__FILE__) ) );
400
- }
401
-
402
- public function plugin_url() {
403
- if(isset($this->config['in_theme_folder']) && !empty($this->config['in_theme_folder'])){
404
- $url = untrailingslashit(get_template_directory_uri() . '/' . $this->config['in_theme_folder']);
405
- }else{
406
- $url = untrailingslashit( plugins_url( '/', dirname(__FILE__) ) );
407
- }
408
-
409
- return $url;
410
- }
411
-
412
- public function is_repositories_page(){
413
- global $pagenow;
414
-
415
- return $pagenow == 'plugin-install.php' && isset($_GET['tab']) && $_GET['tab'] == 'commercial';
416
- }
417
-
418
- public function res_url(){
419
- if(isset($this->config['in_theme_folder']) && !empty($this->config['in_theme_folder'])){
420
- $url = untrailingslashit(get_template_directory_uri() . '/' . $this->config['in_theme_folder']);
421
- }else{
422
- $url = $this->plugin_url();
423
- }
424
- return $url;
425
- }
426
-
427
- public function save_settings(){
428
-
429
- $_settings = serialize($this->settings);
430
- if($this->_gz_on){
431
- $_settings = gzcompress($_settings);
432
- }
433
- $_settings = base64_encode($_settings);
434
-
435
- update_option( 'wp_installer_settings', $_settings );
436
-
437
- if( is_multisite() && is_main_site() && isset($this->settings['repositories']) ){
438
- $network_settings = array();
439
-
440
- foreach( $this->settings['repositories'] as $rep_id => $repository ){
441
- if( isset($repository['subscription']) )
442
- $network_settings[$rep_id] = $repository['subscription'];
443
- }
444
-
445
- update_site_option( 'wp_installer_network', $network_settings );
446
-
447
-
448
- }
449
-
450
- }
451
-
452
- public function get_settings($refresh = false){
453
-
454
- if($refresh || empty($this->settings)){
455
-
456
- $_settings = get_option('wp_installer_settings');
457
-
458
-
459
- if (is_array($_settings) || empty($_settings)) { //backward compatibility 1.1
460
- $this->settings = $_settings;
461
-
462
- } else {
463
- $_settings = base64_decode($_settings);
464
- if ($this->_gz_on) {
465
- $_settings = gzuncompress($_settings);
466
- }
467
- $this->settings = unserialize($_settings);
468
- }
469
-
470
- if (is_multisite() && isset($this->settings['repositories'])) {
471
- $network_settings = maybe_unserialize(get_site_option('wp_installer_network'));
472
- if ($network_settings) {
473
- foreach ($this->settings['repositories'] as $rep_id => $repository) {
474
- if (isset($network_settings[$rep_id])) {
475
- $this->settings['repositories'][$rep_id]['subscription'] = $network_settings[$rep_id];
476
- }
477
- }
478
- }
479
- }
480
-
481
- $this->load_hardcoded_site_keys();
482
-
483
- $this->settings = $this->_pre_1_6_backwards_compatibility($this->settings);
484
-
485
- $this->settings = $this->_old_products_format_backwards_compatibility($this->settings);
486
-
487
- }
488
-
489
- return $this->settings;
490
- }
491
-
492
- private function load_hardcoded_site_keys(){
493
-
494
- if( !empty( $this->settings['repositories'] ) ) {
495
- foreach ( $this->settings['repositories'] as $repository_id => $repository ) {
496
-
497
- if ( $site_key = self::get_repository_hardcoded_site_key( $repository_id ) ) {
498
-
499
- $site_key_missing = empty($this->settings['repositories'][$repository_id]['subscription']['data']);
500
- $site_key_changed = !$site_key_missing &&
501
- $this->settings['repositories'][$repository_id]['subscription']['key'] != $site_key;
502
-
503
- if ( $site_key_missing || $site_key_changed ) {
504
-
505
- if ( !function_exists( 'get_plugins' ) ) {
506
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
507
- }
508
- $this->load_repositories_list();
509
- $response = $this->save_site_key(
510
- array(
511
- 'repository_id' => $repository_id,
512
- 'site_key' => $site_key,
513
- 'return' => true,
514
- 'nonce' => wp_create_nonce( 'save_site_key_' . $repository_id )
515
- )
516
- );
517
-
518
- if ( !empty($response['error']) ) {
519
- $this->remove_site_key( $repository_id );
520
-
521
- $this->admin_messages[] = array(
522
- 'type' => 'error',
523
- 'text' => sprintf( __( 'You are using an invalid site key defined as the constant %s (most likely in wp-config.php).
524
- Please remove it or use the correct value in order to be able to register correctly.', 'installer' ), 'OTGS_INSTALLER_SITE_KEY_' . strtoupper( $repository_id ) )
525
- );
526
-
527
- }
528
-
529
- }
530
-
531
- }
532
-
533
- }
534
- }
535
-
536
- }
537
-
538
- public static function get_repository_hardcoded_site_key( $repository_id ){
539
-
540
- $site_key = false;
541
-
542
- $site_key_constant = 'OTGS_INSTALLER_SITE_KEY_' . strtoupper( $repository_id );
543
- if( defined( $site_key_constant ) ){
544
- $site_key = constant( $site_key_constant );
545
- }
546
-
547
- return $site_key;
548
- }
549
-
550
- //backward compatibility, will remove 'basename' in version 1.8
551
- private function _pre_1_6_backwards_compatibility($settings){
552
-
553
- if( version_compare($this->version(), '1.8', '<') && !empty($settings['repositories']) ){
554
-
555
- foreach ($settings['repositories'] as $repository_id => $repository) {
556
-
557
- foreach ($repository['data']['downloads']['plugins'] as $slug => $download) {
558
-
559
- $settings['repositories'][$repository_id]['data']['downloads']['plugins'][$slug]['slug'] = $download['basename'];
560
-
561
- }
562
- }
563
-
564
- }
565
-
566
- return $settings;
567
-
568
- }
569
-
570
- //backward compatibility - support old products list format (downloads under products instead of global downloads list)
571
- private function _old_products_format_backwards_compatibility($settings){
572
-
573
- if( version_compare($this->version(), '1.8', '<') && !empty($settings['repositories']) && empty($this->_old_products_format_backwards_compatibility) ) {
574
-
575
- foreach ($settings['repositories'] as $repository_id => $repository) {
576
-
577
- $populate_downloads = false;
578
-
579
- foreach ($repository['data']['packages'] as $package_id => $package) {
580
-
581
- foreach ($package['products'] as $product_id => $product) {
582
-
583
- if (!isset($product['plugins'])) {
584
-
585
- $populate_downloads = true;
586
-
587
- foreach ($product['downloads'] as $download_id => $download) {
588
-
589
- $settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['plugins'][] = $download['slug'];
590
-
591
- }
592
-
593
- }
594
-
595
- }
596
-
597
- }
598
-
599
- if ($populate_downloads) {
600
-
601
- // Add downloads branch
602
- foreach ($repository['data']['packages'] as $package_id => $package) {
603
-
604
- foreach ($package['products'] as $product_id => $product) {
605
-
606
- foreach ($product['downloads'] as $download_id => $download) {
607
-
608
- if (!isset($settings['repositories'][$repository_id]['data']['downloads']['plugins'][$download['slug']])) {
609
- $settings['repositories'][$repository_id]['data']['downloads']['plugins'][$download['slug']] = $download;
610
- }
611
-
612
- $settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['plugins'][] = $download['slug'];
613
- }
614
-
615
- unset($settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['downloads']);
616
-
617
- }
618
-
619
- }
620
-
621
- }
622
-
623
- }
624
-
625
- $this->_old_products_format_backwards_compatibility = true;
626
-
627
- }
628
-
629
- return $settings;
630
-
631
- }
632
-
633
- public function get_installer_site_url( $repository_id = false ){
634
- global $current_site;
635
-
636
- $site_url = get_site_url();
637
-
638
- if( $repository_id && is_multisite() && isset( $this->settings['repositories'] ) ){
639
- $network_settings = maybe_unserialize( get_site_option('wp_installer_network') );
640
-
641
- if ( isset( $network_settings[$repository_id] ) ) {
642
- $site_url = get_site_url( $current_site->blog_id );
643
- }
644
-
645
- }
646
-
647
- return $site_url;
648
- }
649
-
650
- public function show_site_key_nags(){
651
- $screen = get_current_screen();
652
-
653
- if($screen->base == 'settings_page_installer' || ($screen->base == 'plugin-install' && isset($_GET['tab']) && $_GET['tab'] == 'commercial')){
654
- return;
655
- }
656
-
657
- if(!empty($this->config['site_key_nags'])){
658
-
659
- foreach($this->config['site_key_nags'] as $nag){
660
-
661
- if(!$this->repository_has_subscription($nag['repository_id'] )){
662
- $show = true;
663
- if(!empty($nag['condition_cb'])){
664
- $show = call_user_func($nag['condition_cb']);
665
- }
666
-
667
- if(empty($this->settings['dismissed_nags'][$nag['repository_id']]) && $show){
668
- echo '<div class="updated error otgs-is-dismissible"><p>';
669
- printf(__("To get automatic updates, you need to register %s for this site. %sRegister %s%s", 'sitepress'),
670
- $nag['product_name'], '<a class="button-primary" href="' . $this->menu_url() . '">', $nag['product_name'], '</a>');
671
-
672
- echo '</p>';
673
- echo '<span class="installer-dismiss-nag notice-dismiss" data-repository="' . $nag['repository_id'] . '"><span class="screen-reader-text">' . __('Dismiss', 'sitepress') . '</span></span>';
674
- echo '</div>';
675
- }
676
- }
677
-
678
- }
679
-
680
- }
681
-
682
- }
683
-
684
- public function dismiss_nag(){
685
- $this->settings['dismissed_nags'][$_POST['repository']] = 1;
686
-
687
- $this->save_settings();
688
-
689
- echo json_encode(array());
690
- exit;
691
- }
692
-
693
- public function add_install_plugins_tab($tabs){
694
-
695
- $tabs['commercial'] = __('Commercial', 'installer');
696
-
697
- return $tabs;
698
- }
699
-
700
- public function load_repositories_list(){
701
- global $wp_installer_instances;
702
-
703
- foreach ($wp_installer_instances as $instance) {
704
-
705
- if (file_exists(dirname($instance['bootfile']) . '/repositories.xml')) {
706
- $config_file = dirname($instance['bootfile']) . '/repositories.xml';
707
-
708
- if (file_exists(dirname($instance['bootfile']) . '/repositories.sandbox.xml')) {
709
- $config_file = dirname($instance['bootfile']) . '/repositories.sandbox.xml';
710
- add_filter('https_ssl_verify', '__return_false');
711
- }
712
-
713
- $repos = simplexml_load_file($config_file);
714
-
715
- if($repos) {
716
- foreach ($repos as $repo) {
717
- $id = strval($repo->id);
718
-
719
- $data['api-url'] = strval($repo->apiurl);
720
- $data['products'] = strval($repo->products);
721
-
722
- // excludes rule;
723
- if (isset($this->config['repositories_exclude']) && in_array($id, $this->config['repositories_exclude'])) {
724
- continue;
725
- }
726
-
727
- // includes rule;
728
- if (isset($this->config['repositories_include']) && !in_array($id, $this->config['repositories_include'])) {
729
- continue;
730
- }
731
-
732
- $this->repositories[$id] = $data;
733
-
734
- }
735
- }
736
-
737
- }
738
- }
739
-
740
- }
741
-
742
- public function filter_repositories_list(){
743
-
744
- if(!empty($this->settings['repositories'])) {
745
- foreach ($this->settings['repositories'] as $id => $repo_data) {
746
-
747
- // excludes rule;
748
- if (isset($this->config['repositories_exclude']) && in_array($id, $this->config['repositories_exclude'])) {
749
- unset($this->settings['repositories'][$id]);
750
- }
751
-
752
- // includes rule;
753
- if (isset($this->config['repositories_include']) && !in_array($id, $this->config['repositories_include'])) {
754
- unset($this->settings['repositories'][$id]);
755
- }
756
-
757
-
758
- }
759
- }
760
-
761
-
762
- }
763
-
764
- public function refresh_repositories_data(){
765
- static $checked = false;
766
-
767
- if( defined('OTGS_DISABLE_AUTO_UPDATES') && OTGS_DISABLE_AUTO_UPDATES && empty($_GET['force-check']) || $checked ){
768
-
769
- if(empty($this->settings['repositories']) && $this->is_repositories_page()){
770
-
771
- foreach($this->repositories as $id => $data) {
772
- $repository_names[] = $id;
773
-
774
- }
775
-
776
- $error = sprintf(__("Installer cannot display the products information because the automatic updating for %s was explicitly disabled with the configuration below (usually in wp-config.php):", 'installer'), strtoupper( join(', ', $repository_names) ));
777
- $error .= '<br /><br /><code>define("OTGS_DISABLE_AUTO_UPDATES", true);</code><br /><br />';
778
- $error .= sprintf(__("In order to see the products information, please run the %smanual updates check%s to initialize the products list or (temporarily) remove the above code.", 'installer'), '<a href="' . admin_url('update-core.php') . '">', '</a>');
779
-
780
- $this->register_admin_message($error, 'error');
781
-
782
-
783
- }
784
-
785
- return;
786
- }
787
-
788
- $checked = true;
789
-
790
- foreach($this->repositories as $id => $data){
791
-
792
- $response = wp_remote_get($data['products']);
793
-
794
- if(is_wp_error($response)){
795
- // http fallback
796
- $data['products'] = preg_replace("@^https://@", 'http://', $data['products']);
797
- $response = wp_remote_get($data['products']);
798
- }
799
-
800
- if(is_wp_error($response)){
801
-
802
- $error = sprintf(__("Installer cannot contact our updates server to get information about the available products and check for new versions. If you are seeing this message for the first time, you can ignore it, as it may be a temporary communication problem. If the problem persists and your WordPress admin is slowing down, you can disable automated version checks. Add the following line to your wp-config.php file:", 'installer'), strtoupper($id));
803
- $error .= '<br /><br /><code>define("OTGS_DISABLE_AUTO_UPDATES", true);</code>';
804
-
805
- $this->register_admin_message($error, 'error');
806
-
807
- continue;
808
- }
809
-
810
- if($response && isset($response['response']['code']) && $response['response']['code'] == 200){
811
- $body = wp_remote_retrieve_body($response);
812
- if($body){
813
- $products = json_decode($body, true);
814
-
815
- if(is_array($products)){
816
- $this->settings['repositories'][$id]['data'] = $products;
817
- $this->settings = $this->_pre_1_6_backwards_compatibility($this->settings);
818
- }
819
- }
820
-
821
- }
822
-
823
- $this->log( sprintf("Checked for %s updates: %s", $id, $data['products']) );
824
-
825
-
826
- }
827
-
828
- // cleanup
829
- if(empty($this->settings['repositories'])){
830
- $this->settings['repositories'] = array();
831
- }
832
- foreach($this->settings['repositories'] as $id => $data){
833
- if(!in_array($id, array_keys($this->repositories))){
834
- unset($this->settings['repositories'][$id]);
835
- }
836
- }
837
-
838
- $this->settings['last_repositories_update']= time();
839
-
840
- $this->save_settings();
841
-
842
- }
843
-
844
- public function show_products($args = array()){
845
-
846
- $screen = get_current_screen();
847
-
848
- if($screen->base == 'settings_page_installer'){ // settings page
849
- echo '<div class="wrap">';
850
- echo '<h2>' . __('Installer', 'installer') . '</h2>';
851
- echo '<br />';
852
- }
853
-
854
- if(!is_array($args)) $args = array();
855
- if(empty($args['template'])) $args['template'] = 'default';
856
-
857
- $this->filter_repositories_list();
858
-
859
- if(!empty($this->settings['repositories'])){
860
-
861
- $this->localize_strings();
862
- $this->set_filtered_prices($args);
863
- $this->set_hierarchy_and_order();
864
-
865
- foreach($this->settings['repositories'] as $repository_id => $repository){
866
-
867
- if($args['template'] == 'compact'){
868
-
869
- if(isset($args['repository']) && $args['repository'] == $repository_id){
870
- include $this->plugin_path() . '/templates/products-compact.php';
871
- }
872
-
873
- }else{
874
-
875
- include $this->plugin_path() . '/templates/repository-listing.php';
876
-
877
- }
878
-
879
- unset($site_key, $subscription_type, $expired, $upgrade_options, $products_avaliable);
880
-
881
- }
882
-
883
- }else{
884
-
885
- echo '<center>' . __('No repositories defined.', 'installer') . '</center>';
886
-
887
- }
888
-
889
- if($screen->base == 'settings_page_installer'){ // settings page
890
- echo '</div>';
891
- }
892
-
893
-
894
- }
895
-
896
- public function get_product_price($repository_id, $package_id, $product_id, $incl_discount = false){
897
-
898
- $price = false;
899
-
900
- foreach($this->settings['repositories'][$repository_id]['data']['packages'] as $package ){
901
-
902
- if($package['id'] == $package_id){
903
- if(isset($package['products'][$product_id])){
904
- if($incl_discount && isset($package['products'][$product_id]['price_disc'])){
905
- $price = $package['products'][$product_id]['price_disc'];
906
- }elseif(isset($package['products'][$product_id]['price'])){
907
- $price = $package['products'][$product_id]['price'];
908
- }
909
- }
910
- break;
911
- }
912
- }
913
-
914
- return $price;
915
- }
916
-
917
- private function _render_product_packages($packages, $subscription_type, $expired, $upgrade_options, $repository_id){
918
-
919
- $data = array();
920
-
921
- foreach($packages as $package_id => $package){
922
-
923
- $row = array('products' => array(), 'downloads' => array());
924
- foreach($package['products'] as $product){
925
-
926
- // filter out free subscriptions from being displayed as buying options
927
- if( empty($product['price']) && (empty($subscription_type) || $expired) ){
928
- continue;
929
- }
930
-
931
- //consider equivalent subscriptions
932
- if( empty($product['subscription_type_equivalent'])){
933
- $product['subscription_type_equivalent'] = '';
934
- }
935
-
936
- // buy base
937
- if(empty($subscription_type) || $expired) {
938
-
939
- $p['url'] = $this->append_parameters_to_buy_url($product['url'], $repository_id);
940
- if (!empty($product['price_disc'])) {
941
- $p['label'] = $product['call2action'] . ' - ' . sprintf('$%s %s$%d%s (USD)', $product['price_disc'], '&nbsp;&nbsp;<del>', $product['price'], '</del>');
942
- } else {
943
- $p['label'] = $product['call2action'] . ' - ' . sprintf('$%d (USD)', $product['price']);
944
- }
945
- $row['products'][] = $p;
946
-
947
- // renew
948
- } elseif(isset($subscription_type) && ($product['subscription_type'] == $subscription_type || $product['subscription_type_equivalent'] == $subscription_type)){
949
-
950
- if($product['renewals']) {
951
- foreach ($product['renewals'] as $renewal) {
952
- $p['url'] = $this->append_parameters_to_buy_url($renewal['url'], $repository_id);
953
- $p['label'] = $renewal['call2action'] . ' - ' . sprintf('$%d (USD)', $renewal['price']);
954
- }
955
-
956
- $row['products'][] = $p;
957
- }
958
-
959
- }
960
-
961
- // upgrades
962
- if(!empty($upgrade_options[$product['subscription_type']])){
963
-
964
- foreach($upgrade_options[$product['subscription_type']] as $stype => $upgrade){
965
- if($stype != $subscription_type) continue;
966
-
967
- $p['url'] = $this->append_parameters_to_buy_url($upgrade['url'], $repository_id);
968
- if (!empty($upgrade['price_disc'])) {
969
- $p['label'] = $upgrade['call2action'] . ' - ' . sprintf('$%s %s$%d%s (USD)', $upgrade['price_disc'], '&nbsp;&nbsp;<del>', $upgrade['price'], '</del>');
970
- } else {
971
- $p['label'] = $upgrade['call2action'] . ' - ' . sprintf('$%d (USD)', $upgrade['price']);
972
- }
973
- $row['products'][] = $p;
974
-
975
- }
976
-
977
- }
978
-
979
- // downloads
980
- if(isset($subscription_type) && !$expired && ($product['subscription_type'] == $subscription_type || $product['subscription_type_equivalent'] == $subscription_type)){
981
- foreach($product['plugins'] as $plugin_slug){
982
-
983
- $row['downloads'][] = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
984
-
985
- }
986
-
987
- }
988
-
989
- //subpackages
990
- if(!empty($package['sub-packages'])){
991
- $row['sub-packages'] = $package['sub-packages'];
992
- }
993
-
994
- }
995
-
996
- $row['id'] = $package['id'];
997
- $row['image_url'] = $package['image_url'];
998
- $row['name'] = $package['name'];
999
- $row['description'] = $package['description'];
1000
-
1001
- if(!empty($row['products']) || !empty($row['downloads']) || !empty($row['sub-packages'])){
1002
- $data[] = $row;
1003
- }
1004
-
1005
-
1006
- }
1007
-
1008
- return $data;
1009
-
1010
- }
1011
-
1012
- public function get_extra_url_parameters(){
1013
-
1014
- $parameters = array();
1015
-
1016
- if(!empty($this->package_source)){
1017
- foreach($this->package_source as $key => $val){
1018
- $parameters[$key] = $val;
1019
- }
1020
- }
1021
-
1022
- $parameters['installer_version'] = WP_INSTALLER_VERSION;
1023
- $parameters['theme'] = wp_get_theme()->get( 'Name' );
1024
- $parameters['site_name'] = get_bloginfo( 'name' );
1025
-
1026
- return $parameters;
1027
- }
1028
-
1029
- public function append_parameters_to_buy_url($url, $repository_id, $args = array()){
1030
-
1031
- $url = add_query_arg( array('icl_site_url' => $this->get_installer_site_url( $repository_id ) ), $url );
1032
-
1033
- $affiliate_id = false;
1034
- $affiliate_key = false;
1035
-
1036
- // Add extra parameters for custom Installer packages
1037
- if( !empty($this->package_source) ){
1038
- $extra = $this->get_extra_url_parameters();
1039
-
1040
- if( !empty($extra['repository']) && $extra['repository'] == $repository_id ) {
1041
-
1042
- if( !empty($extra['affiliate_key']) && !empty($extra['user_id']) ){
1043
- $this->config['affiliate_id:' . $repository_id] = $extra['user_id'];
1044
- $this->config['affiliate_key:' . $repository_id] = $extra['affiliate_key'];
1045
- unset($extra['affiliate_key'], $extra['user_id'], $extra['repository']); // no need to include these ones
1046
- }
1047
-
1048
- $url = add_query_arg($extra, $url);
1049
- }
1050
-
1051
- }
1052
-
1053
- if(isset($this->config['affiliate_id:' . $repository_id]) && isset($this->config['affiliate_key:' . $repository_id])){
1054
-
1055
- $affiliate_id = $this->config['affiliate_id:' . $repository_id];
1056
- $affiliate_key = $this->config['affiliate_key:' . $repository_id];
1057
-
1058
- }elseif(isset($args['affiliate_id:' . $repository_id]) && isset($args['affiliate_key:' . $repository_id])){
1059
-
1060
- $affiliate_id = $args['affiliate_id:' . $repository_id];
1061
- $affiliate_key = $args['affiliate_key:' . $repository_id];
1062
-
1063
- }elseif(defined('ICL_AFFILIATE_ID') && defined('ICL_AFFILIATE_KEY')){ //support for 1 repo
1064
-
1065
- $affiliate_id = ICL_AFFILIATE_ID;
1066
- $affiliate_key = ICL_AFFILIATE_KEY;
1067
-
1068
- }elseif(isset($this->config['affiliate_id']) && isset($this->config['affiliate_key'])) {
1069
- // BACKWARDS COMPATIBILITY
1070
- $affiliate_id = $this->config['affiliate_id'];
1071
- $affiliate_key = $this->config['affiliate_key'];
1072
- }
1073
-
1074
- if($affiliate_id && $affiliate_key){
1075
- $url = add_query_arg(array('aid' => $affiliate_id, 'affiliate_key' => $affiliate_key), $url);
1076
- }
1077
-
1078
- if($repository_id == 'wpml'){
1079
- $url = add_query_arg(array('using_icl' => $this->_using_icl, 'wpml_version' => $this->_wpml_version), $url);
1080
- }
1081
-
1082
- $url = apply_filters('wp_installer_buy_url', $url);
1083
-
1084
- $url = esc_url($url);
1085
-
1086
- return $url;
1087
-
1088
- }
1089
-
1090
- public function save_site_key($args = array()){
1091
-
1092
- $error = '';
1093
-
1094
- if( isset( $args['repository_id'] ) ){
1095
- $repository_id = $args['repository_id'];
1096
- }elseif( isset( $_POST['repository_id'] ) ){
1097
- $repository_id = sanitize_text_field( $_POST['repository_id'] );
1098
- }else{
1099
- $repository_id = false;
1100
- }
1101
-
1102
- if( isset( $args['nonce'] ) ){
1103
- $nonce = $args['nonce'];
1104
- }elseif( isset($_POST['nonce'] ) ){
1105
- $nonce = sanitize_text_field( $_POST['nonce'] );
1106
- }else{
1107
- $nonce = '';
1108
- }
1109
-
1110
- if( isset( $args['site_key'] ) ){
1111
- $site_key = $args['site_key'];
1112
- } else {
1113
- $site_key = sanitize_text_field( $_POST[ 'site_key_' . $repository_id] );
1114
- }
1115
- $site_key = preg_replace("/[^A-Za-z0-9]/", '', $site_key);
1116
-
1117
- if($repository_id && $nonce && wp_create_nonce('save_site_key_' . $repository_id) == $nonce){
1118
-
1119
- try {
1120
- $subscription_data = $this->fetch_subscription_data( $repository_id, $site_key, self::SITE_KEY_VALIDATION_SOURCE_REGISTRATION );
1121
-
1122
- if ( $subscription_data ) {
1123
- $this->settings['repositories'][$repository_id]['subscription'] = array('key' => $site_key, 'data' => $subscription_data);
1124
- $this->save_settings();
1125
- } else {
1126
- $error = __( 'Invalid site key for the current site.', 'installer' )
1127
- . '<br /><div class="installer-footnote">' . __('Please note that the site key is case sensitive.', 'installer') . '</div>';
1128
- }
1129
-
1130
- } catch (Exception $e ){
1131
- $error = $e->getMessage();
1132
- if( preg_match('#Could not resolve host: (.*)#', $error, $matches) || preg_match('#Couldn\'t resolve host \'(.*)\'#', $error, $matches) ){
1133
- $error = sprintf(__("%s cannot access %s to register. Try again to see if it's a temporary problem. If the problem continues, make sure that this site has access to the Internet. You can still use the plugin without registration, but you will not receive automated updates.", 'installer'),
1134
- '<strong><i>' . $this->get_generic_product_name($repository_id) . '</i></strong>',
1135
- '<strong><i>' . $matches[1]. '</i></strong>'
1136
- ) ;
1137
- }
1138
- }
1139
-
1140
- }
1141
-
1142
- $return = array('error' => $error);
1143
-
1144
- if($this->api_debug){
1145
- $return['debug'] = $this->api_debug;
1146
- }
1147
-
1148
- if(!empty($args['return'])){
1149
- return $return;
1150
- }else{
1151
- echo json_encode($return);
1152
- exit;
1153
- }
1154
-
1155
- }
1156
-
1157
- /**
1158
- * Alias for WP_Installer::get_repository_site_key
1159
- * @see WP_Installer::get_repository_site_key()
1160
- *
1161
- * @param string $repository_id
1162
- * @return string (site key) or bool
1163
- */
1164
- public function get_site_key($repository_id){
1165
- return WP_Installer::get_repository_site_key( $repository_id );
1166
- }
1167
-
1168
- public function remove_site_key( $repository_id ){
1169
- if( isset( $this->settings['repositories'][$repository_id] ) ){
1170
- unset($this->settings['repositories'][$repository_id]['subscription']);
1171
- $this->save_settings();
1172
- $this->refresh_repositories_data();
1173
- }
1174
- }
1175
-
1176
- public function remove_site_key_ajax(){
1177
- if($_POST['nonce'] == wp_create_nonce('remove_site_key_' . $_POST['repository_id'])){
1178
- $this->remove_site_key( $_POST['repository_id'] );
1179
- }
1180
- exit;
1181
- }
1182
-
1183
- public function validate_repository_subscription(){
1184
- $repository_id = isset($_GET['validate_repository']) ? sanitize_text_field( $_GET['validate_repository'] ) : false;
1185
- if($repository_id){
1186
-
1187
- $site_key = $this->get_site_key($repository_id);
1188
- if($site_key) {
1189
- $subscription_data = $this->fetch_subscription_data( $repository_id, $site_key, self::SITE_KEY_VALIDATION_SOURCE_REVALIDATION);
1190
- if(empty($subscription_data)){
1191
- unset($this->settings['repositories'][$repository_id]['subscription']);
1192
- delete_site_transient('update_plugins');
1193
- $this->save_settings();
1194
- }
1195
- }
1196
-
1197
- wp_redirect($this->menu_url() . '#repository-' . $repository_id);
1198
- exit;
1199
-
1200
- }
1201
-
1202
- }
1203
-
1204
- public function update_site_key(){
1205
-
1206
- $error = '';
1207
-
1208
- $repository_id = sanitize_text_field ( $_POST['repository_id'] );
1209
- if($_POST['nonce'] == wp_create_nonce('update_site_key_' . $repository_id )){
1210
-
1211
- $site_key = $this->get_site_key($_POST['repository_id']);
1212
-
1213
- if($site_key){
1214
- try {
1215
- $subscription_data = $this->fetch_subscription_data( $repository_id, $site_key, self::SITE_KEY_VALIDATION_SOURCE_UPDATES_CHECK );
1216
-
1217
- if ( $subscription_data ) {
1218
- $this->settings['repositories'][$repository_id]['subscription'] = array('key' => $site_key, 'data' => $subscription_data);
1219
-
1220
- //also refresh products information
1221
- $this->refresh_repositories_data();
1222
-
1223
- $this->save_settings();
1224
-
1225
- } else {
1226
- unset($this->settings['repositories'][$repository_id]['subscription']);
1227
- $error = __( 'Invalid site key for the current site. If the error persists, try to unregister first and then register again with the same site key.', 'installer' );
1228
- }
1229
-
1230
-
1231
- } catch (Exception $e ){
1232
- $error = $e->getMessage();
1233
- if( preg_match('#Could not resolve host: (.*)#', $error, $matches) || preg_match('#Couldn\'t resolve host \'(.*)\'#', $error, $matches) ){
1234
- $error = sprintf(__("%s cannot access %s to register. Try again to see if it's a temporary problem. If the problem continues, make sure that this site has access to the Internet. You can still use the plugin without registration, but you will not receive automated updates.", 'installer'),
1235
- '<strong><i>' . $this->get_generic_product_name($repository_id) . '</i></strong>',
1236
- '<strong><i>' . $matches[1]. '</i></strong>'
1237
- ) ;
1238
- }
1239
- }
1240
-
1241
- }
1242
-
1243
- }
1244
-
1245
- echo json_encode(array('error' => $error));
1246
-
1247
- exit;
1248
- }
1249
-
1250
- public function api_debug_log($text){
1251
-
1252
- if(defined('WPML_DEBUG_INSTALLER') && WPML_DEBUG_INSTALLER){
1253
-
1254
- if(!is_scalar($text)){
1255
- $text = print_r($text, 1);
1256
- }
1257
-
1258
- $this->api_debug .= $text . "\n";
1259
-
1260
- }
1261
-
1262
- }
1263
-
1264
- public function fetch_subscription_data( $repository_id, $site_key, $source = self::SITE_KEY_VALIDATION_SOURCE_OTHER ){
1265
-
1266
- $subscription_data = false;
1267
-
1268
- $args['body'] = array(
1269
- 'action' => 'site_key_validation',
1270
- 'site_key' => $site_key,
1271
- 'site_url' => $this->get_installer_site_url( $repository_id ),
1272
- 'source' => $source
1273
- );
1274
-
1275
- if($repository_id == 'wpml'){
1276
- $args['body']['using_icl'] = $this->_using_icl;
1277
- $args['body']['wpml_version'] = $this->_wpml_version;
1278
- }
1279
-
1280
- $args['body']['installer_version'] = WP_INSTALLER_VERSION;
1281
- $args['body']['theme'] = wp_get_theme()->get( 'Name' );
1282
- $args['body']['site_name'] = get_bloginfo( 'name' );
1283
-
1284
- $args['body']['versions'] = $this->get_local_product_versions( $repository_id );
1285
-
1286
- $args['timeout'] = 45;
1287
-
1288
- // Add extra parameters for custom Installer packages
1289
- if( !empty($this->package_source) ){
1290
- $extra = $this->get_extra_url_parameters();
1291
- if( !empty($extra['repository']) && $extra['repository'] == $repository_id ) {
1292
- unset($extra['repository']);
1293
- foreach($extra as $key => $val){
1294
- $args['body'][$key] = $val;
1295
- }
1296
- }
1297
- }
1298
-
1299
- $response = wp_remote_post($this->repositories[$repository_id]['api-url'], $args);
1300
-
1301
- $this->api_debug_log("POST {$this->repositories[$repository_id]['api-url']}");
1302
- $this->api_debug_log($args);
1303
-
1304
- $this->log("POST {$this->repositories[$repository_id]['api-url']} - fetch subscription data");
1305
-
1306
- if( !is_wp_error($response) ){
1307
- $datas = wp_remote_retrieve_body($response);
1308
-
1309
- if(is_serialized($datas)){
1310
- $data = unserialize($datas);
1311
- $this->api_debug_log($data);
1312
-
1313
- if( !empty( $data->subscription_data ) ){
1314
- $subscription_data = $data->subscription_data;
1315
- }
1316
-
1317
- do_action( 'installer_fetched_subscription_data', $data, $repository_id);
1318
-
1319
- }else{
1320
- $this->api_debug_log($datas);
1321
- }
1322
-
1323
- }else{
1324
-
1325
- $this->api_debug_log($response);
1326
- throw new Exception( $response->get_error_message() );
1327
- }
1328
-
1329
- return $subscription_data;
1330
-
1331
- }
1332
-
1333
- function get_local_product_versions( $repository_id ){
1334
-
1335
- $versions = array();
1336
-
1337
- foreach( $this->settings['repositories'][$repository_id]['data']['packages'] as $package_id => $package ){
1338
-
1339
- foreach( $package['products'] as $product_id => $product ){
1340
-
1341
- foreach( $product['plugins'] as $plugin_slug ){
1342
-
1343
- $download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
1344
-
1345
- if( empty( $versions[$download['slug']] ) ) {
1346
- $v = $this->get_plugin_installed_version($download['name'], $download['slug']);
1347
- if($v){
1348
- $versions[$download['slug']] = $v;
1349
- }
1350
- }
1351
-
1352
- }
1353
-
1354
- }
1355
-
1356
- }
1357
-
1358
- return $versions;
1359
- }
1360
-
1361
- public function get_repository_site_key($repository_id){
1362
- $site_key = false;
1363
-
1364
- if(!empty($this->settings['repositories'][$repository_id]['subscription']['key'])){
1365
- $site_key = $this->settings['repositories'][$repository_id]['subscription']['key'];
1366
- }
1367
-
1368
- return $site_key;
1369
- }
1370
-
1371
- public function repository_has_valid_subscription($repository_id){
1372
-
1373
- $valid = false;
1374
-
1375
- if(!empty($this->settings['repositories'][$repository_id]['subscription'])){
1376
-
1377
- $subscription = $this->settings['repositories'][$repository_id]['subscription']['data'];
1378
- $valid = ( $subscription->status == 1 && (strtotime($subscription->expires) > time() || empty($subscription->expires)) ) || $subscription->status == 4;
1379
-
1380
- }
1381
- return $valid;
1382
-
1383
- }
1384
-
1385
- public function repository_has_subscription($repository_id){
1386
- $key = false;
1387
- if(!empty($this->settings['repositories'][$repository_id]['subscription']['key'])){
1388
- $key = $this->settings['repositories'][$repository_id]['subscription']['key'];
1389
- }
1390
-
1391
- return $key;
1392
-
1393
- }
1394
-
1395
- public function repository_has_expired_subscription($repository_id){
1396
-
1397
- return $this->repository_has_subscription($repository_id) && !$this->repository_has_valid_subscription($repository_id);
1398
-
1399
- }
1400
-
1401
- public function get_generic_product_name($repository_id){
1402
-
1403
- return $this->settings['repositories'][$repository_id]['data']['product-name'];
1404
-
1405
- }
1406
-
1407
- public function show_subscription_renew_warning($repository_id, $subscription_id){
1408
-
1409
- $show = false;
1410
-
1411
- $data = $this->settings['repositories'][$repository_id]['data'];
1412
- if(!empty($data['subscriptions_meta'])){
1413
- if(isset($data['subscriptions_meta']['expiration'])){
1414
-
1415
- if(!empty($data['subscriptions_meta']['expiration'][$subscription_id])){
1416
-
1417
- $days = $data['subscriptions_meta']['expiration'][$subscription_id]['days_warning'];
1418
- $message = $data['subscriptions_meta']['expiration'][$subscription_id]['warning_message'];
1419
-
1420
- }else{
1421
-
1422
- //defaults
1423
- $days = 30;
1424
- $message = __('You will have to renew your subscription in order to continue getting the updates and support.', 'installer');
1425
-
1426
- }
1427
-
1428
- if(!empty($this->settings['repositories'][$repository_id]['subscription'])){
1429
- $subscription = $this->settings['repositories'][$repository_id]['subscription'];
1430
-
1431
- if($subscription['data']->subscription_type == $subscription_id && !empty($subscription['data']->expires)){
1432
-
1433
- if(strtotime($subscription['data']->expires) < strtotime(sprintf("+%d day", $days))){
1434
-
1435
- $days_to_expiration = ceil((strtotime($subscription['data']->expires) - time()) / 86400);
1436
-
1437
- echo '<div><p class="installer-warn-box">' .
1438
- sprintf(_n('Your subscription expires in %d day.', 'Your subscription expires in %d days.', $days_to_expiration, 'installer'), $days_to_expiration) .
1439
- '<br />' . $message .
1440
- '</p></div>';
1441
-
1442
- $show = true;
1443
-
1444
- }
1445
-
1446
- }
1447
-
1448
- }
1449
-
1450
-
1451
- }
1452
- }
1453
-
1454
-
1455
- return $show;
1456
-
1457
- }
1458
-
1459
- public function setup_plugins_renew_warnings(){
1460
-
1461
- $plugins = get_plugins();
1462
-
1463
- $subscriptions_with_warnings = array();
1464
- foreach($this->settings['repositories'] as $repository_id => $repository){
1465
-
1466
- if($this->repository_has_valid_subscription($repository_id)){
1467
- $subscription_type = $this->settings['repositories'][$repository_id]['subscription']['data']->subscription_type;
1468
- $expires = $this->settings['repositories'][$repository_id]['subscription']['data']->expires;
1469
-
1470
- $never_expires = isset($this->settings['repositories'][$repository_id]['subscription'])
1471
- && empty($this->settings['repositories'][$repository_id]['subscription']['data']->expires)
1472
- && (
1473
- $this->settings['repositories'][$repository_id]['subscription']['data']->status == 4 ||
1474
- $this->settings['repositories'][$repository_id]['subscription']['data']->status == 1
1475
- );
1476
-
1477
- if(!$never_expires){
1478
- if(isset($this->settings['repositories'][$repository_id]['data']['subscriptions_meta']['expiration'][$subscription_type])){
1479
-
1480
- $days_warning = $this->settings['repositories'][$repository_id]['data']['subscriptions_meta']['expiration'][$subscription_type]['days_warning'];
1481
- $custom_message = $this->settings['repositories'][$repository_id]['data']['subscriptions_meta']['expiration'][$subscription_type]['warning_message'];
1482
-
1483
- }else{
1484
- //defaults
1485
- $days_warning = 30;
1486
- $custom_message = __('You will have to renew your subscription in order to continue getting the updates and support.', 'installer');
1487
- }
1488
-
1489
- if(strtotime($expires) < strtotime(sprintf('+%d day', $days_warning)) ){
1490
-
1491
- $days_to_expiration = ceil((strtotime($expires) - time()) / 86400);
1492
-
1493
- $message = sprintf(_n('Your subscription expires in %d day.', 'Your subscription expires in %d days.', $days_to_expiration, 'installer'), $days_to_expiration);
1494
- $subscriptions_with_warnings[$subscription_type] = $message . ' ' . $custom_message;
1495
-
1496
- }
1497
- }
1498
-
1499
- }
1500
-
1501
- }
1502
-
1503
-
1504
-
1505
- foreach($plugins as $plugin_id => $plugin){
1506
-
1507
- $slug = dirname($plugin_id);
1508
- if(empty($slug)) continue;
1509
-
1510
- foreach($this->settings['repositories'] as $repository_id => $repository){
1511
-
1512
- if($this->repository_has_valid_subscription($repository_id)){
1513
-
1514
- foreach($repository['data']['packages'] as $package){
1515
-
1516
- foreach($package['products'] as $product){
1517
-
1518
- foreach($product['plugins'] as $plugin_slug){
1519
-
1520
- $download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
1521
-
1522
- if($download['slug'] == $slug || $download['name'] == $plugin['Name'] || $download['name'] == $plugin['Title']){ //match order: slug, name, title
1523
-
1524
- if(isset($subscriptions_with_warnings[$product['subscription_type']])){
1525
-
1526
- $this->_plugins_renew_warnings[$plugin_id] = $subscriptions_with_warnings[$product['subscription_type']];
1527
-
1528
- }
1529
-
1530
- }
1531
-
1532
- }
1533
-
1534
- }
1535
-
1536
- }
1537
-
1538
- }
1539
-
1540
- }
1541
-
1542
- }
1543
-
1544
- }
1545
-
1546
- public function queue_plugins_renew_warnings() {
1547
-
1548
- if(!empty($this->_plugins_renew_warnings)){
1549
-
1550
- foreach($this->_plugins_renew_warnings as $plugin_id => $message){
1551
-
1552
- add_action( "after_plugin_row_" . $plugin_id, array($this, 'plugins_renew_warning'), 10, 3 );
1553
- }
1554
-
1555
- }
1556
-
1557
- }
1558
-
1559
- public function plugins_renew_warning($plugin_file, $plugin_data, $status){
1560
-
1561
- if(empty($this->_plugins_renew_warnings[$plugin_file])) return;
1562
-
1563
- $wp_list_table = _get_list_table('WP_Plugins_List_Table');
1564
- ?>
1565
-
1566
- <tr class="plugin-update-tr"><td colspan="<?php echo $wp_list_table->get_column_count(); ?>" class="plugin-update colspanchange">
1567
- <div class="update-message">
1568
- <?php
1569
- echo $this->_plugins_renew_warnings[$plugin_file]. ' ';
1570
- printf(__('%sRenew here%s.', 'installer'),
1571
- '<a href="' . $this->menu_url() . '">', '</a>');
1572
- ?>
1573
- </div>
1574
- </tr>
1575
-
1576
- <?php
1577
-
1578
- }
1579
-
1580
- public function get_subscription_type_for_repository($repository_id){
1581
-
1582
- $subscription_type = false;
1583
-
1584
- if(!empty($this->settings['repositories'][$repository_id]['subscription'])){
1585
- $subscription_type = $this->settings['repositories'][$repository_id]['subscription']['data']->subscription_type;
1586
- }
1587
-
1588
- return $subscription_type;
1589
-
1590
- }
1591
-
1592
- public function have_superior_subscription($subscription_type, $product){
1593
-
1594
- $have = false;
1595
-
1596
- if(is_array($product['upgrades'])){
1597
- foreach($product['upgrades'] as $u){
1598
- if($u['subscription_type'] == $subscription_type){
1599
- $have = true;
1600
- break;
1601
- }
1602
- }
1603
- }
1604
-
1605
- return $have;
1606
- }
1607
-
1608
- public function is_product_available_for_download($product_name, $repository_id){
1609
-
1610
- $available = false;
1611
-
1612
- $subscription_type = $this->get_subscription_type_for_repository($repository_id);
1613
- $expired = $this->repository_has_expired_subscription($repository_id);
1614
-
1615
- if($this->repository_has_subscription($repository_id) && !$expired){
1616
-
1617
- $this->set_hierarchy_and_order();
1618
-
1619
- foreach($this->settings['repositories'][$repository_id]['data']['packages'] as $package_id => $package){
1620
-
1621
- $has_top_package = false;
1622
-
1623
- foreach($package['products'] as $product){
1624
-
1625
- if($subscription_type == $product['subscription_type']){
1626
- $has_top_package = true;
1627
- if($product['name'] == $product_name){
1628
- return $available = true;
1629
- }
1630
- }
1631
-
1632
- }
1633
-
1634
- if(!empty($package['sub-packages'])){
1635
- foreach($package['sub-packages'] as $sub_package){
1636
- foreach($sub_package['products'] as $product){
1637
- if($product['name'] == $product_name && ($subscription_type == $product['subscription_type'] || $has_top_package)){
1638
- return $available = true;
1639
- }
1640
- }
1641
- }
1642
- }
1643
-
1644
- }
1645
- }
1646
-
1647
- return $available;
1648
-
1649
- }
1650
-
1651
- public function get_upgrade_options($repository_id){
1652
- $all_upgrades = array();
1653
-
1654
-
1655
- //get all products: packages and subpackages
1656
- $all_products = array();
1657
- foreach($this->settings['repositories'][$repository_id]['data']['packages'] as $package){
1658
- foreach($package['products'] as $product) {
1659
- $all_products[] = $product;
1660
- }
1661
- if(!empty($package['sub-packages'])){
1662
- foreach($package['sub-packages'] as $subpackage){
1663
- foreach($subpackage['products'] as $product) {
1664
- $all_products[] = $product;
1665
- }
1666
-
1667
- }
1668
-
1669
- }
1670
-
1671
- }
1672
-
1673
- foreach( $all_products as $product ) {
1674
- if ($product['upgrades']) {
1675
- foreach ($product['upgrades'] as $upgrade) {
1676
- if ($this->repository_has_valid_subscription($repository_id) || ($this->repository_has_subscription($repository_id) && $upgrade['including_expired'])) {
1677
- $all_upgrades[$upgrade['subscription_type']][$product['subscription_type']] = $upgrade;
1678
- }
1679
- }
1680
- }
1681
- }
1682
-
1683
- return $all_upgrades;
1684
-
1685
- }
1686
-
1687
- public function append_site_key_to_download_url($url, $key, $repository_id){
1688
-
1689
- $url_params['site_key'] = $key;
1690
- $url_params['site_url'] = $this->get_installer_site_url( $repository_id );
1691
-
1692
-
1693
- // Add extra parameters for custom Installer packages
1694
- if( !empty($this->package_source) ){
1695
- $extra = $this->get_extra_url_parameters();
1696
- if( !empty($extra['repository']) && $extra['repository'] == $repository_id ) {
1697
- unset($extra['repository']);
1698
- foreach($extra as $key => $val){
1699
- $url_params[$key] = $val;
1700
- }
1701
- }
1702
- }
1703
-
1704
- $url = add_query_arg($url_params, $url);
1705
-
1706
- if($repository_id == 'wpml'){
1707
- $url = add_query_arg(array('using_icl' => $this->_using_icl, 'wpml_version' => $this->_wpml_version), $url);
1708
- }
1709
-
1710
- return $url;
1711
-
1712
- }
1713
-
1714
- public function plugin_is_installed($name, $slug, $version = null){
1715
-
1716
- $is = false;
1717
-
1718
- $plugins = get_plugins();
1719
-
1720
- foreach($plugins as $plugin_id => $plugin){
1721
-
1722
- $wp_plugin_slug = dirname($plugin_id);
1723
-
1724
- // Exception: embedded plugins
1725
- if( $wp_plugin_slug == $slug || $plugin['Name'] == $name || $plugin['Title'] == $name || ( $wp_plugin_slug == $slug . '-embedded' || $plugin['Name'] == $name . ' Embedded' ) ){
1726
- if($version){
1727
- if(version_compare($plugin['Version'], $version, '>=')){
1728
- $is = $plugin['Version'];
1729
- }
1730
- }else{
1731
- $is = $plugin['Version'];
1732
- }
1733
-
1734
- break;
1735
- }
1736
-
1737
- }
1738
-
1739
- //exception: Types name difference
1740
- if(!$is && $name == 'Types'){
1741
- return $this->plugin_is_installed('Types - Complete Solution for Custom Fields and Types', $slug, $version);
1742
- }
1743
-
1744
- return $is;
1745
- }
1746
-
1747
- public function plugin_is_embedded_version($name, $slug){
1748
- $is = false;
1749
-
1750
- $plugins = get_plugins();
1751
-
1752
- //false if teh full version is also installed
1753
- $is_full_installed = false;
1754
- foreach($plugins as $plugin_id => $plugin){
1755
-
1756
- if(($plugin['Name'] == $name && !preg_match("#-embedded$#", $slug)) ){
1757
- $is_full_installed = true;
1758
- break;
1759
- }
1760
-
1761
- }
1762
-
1763
- if($is_full_installed){
1764
- return false;
1765
- }
1766
-
1767
- foreach($plugins as $plugin_id => $plugin){
1768
-
1769
- // TBD
1770
- $wp_plugin_slug = dirname($plugin_id);
1771
- if( $wp_plugin_slug == $slug . '-embedded' && $plugin['Name'] == $name . ' Embedded'){
1772
- $is = true;
1773
- break;
1774
- }
1775
-
1776
- }
1777
-
1778
- return $is;
1779
-
1780
- }
1781
-
1782
- //Alias for plugin_is_installed
1783
- public function get_plugin_installed_version($name, $slug){
1784
-
1785
- return $this->plugin_is_installed($name, $slug);
1786
-
1787
- }
1788
-
1789
- public function get_plugin_repository_version($repository_id, $slug){
1790
- $version = false;
1791
-
1792
- if(!empty($this->settings['repositories'][$repository_id]['data']['packages'])){
1793
- foreach($this->settings['repositories'][$repository_id]['data']['packages'] as $package){
1794
- foreach($package['products'] as $product) {
1795
-
1796
- foreach($product['plugins'] as $plugin_slug){
1797
-
1798
- $download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
1799
-
1800
- if($download['slug'] == $slug){
1801
- $version = $download['version'];
1802
- break (3);
1803
- }
1804
-
1805
- }
1806
-
1807
- }
1808
- }
1809
- }
1810
-
1811
- return $version;
1812
- }
1813
-
1814
- public function is_uploading_allowed(){
1815
-
1816
- //_deprecated_function ( __FUNCTION__, '1.7.3', 'Installer_Dependencies::' . __FUNCTION__ );
1817
- return $this->dependencies->is_uploading_allowed();
1818
-
1819
- }
1820
-
1821
- public function download_plugin_ajax_handler(){
1822
-
1823
- require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
1824
- require_once $this->plugin_path() . '/includes/installer-upgrader-skins.php';
1825
-
1826
- $data = json_decode( base64_decode( sanitize_text_field ( $_POST['data'] ) ), true );
1827
-
1828
- $ret = false;
1829
- $plugin_id = false;
1830
- $message = '';
1831
-
1832
- //validate subscription
1833
- $site_key = $this->get_repository_site_key($data['repository_id']);
1834
- $subscription_data = $this->fetch_subscription_data( $data['repository_id'], $site_key , self::SITE_KEY_VALIDATION_SOURCE_DOWNLOAD_REPORT);
1835
-
1836
- if($subscription_data && !is_wp_error($subscription_data) && $this->repository_has_valid_subscription($data['repository_id'])){
1837
-
1838
- if($data['nonce'] == wp_create_nonce('install_plugin_' . $data['url'])){
1839
-
1840
- $upgrader_skins = new Installer_Upgrader_Skins(); //use our custom (mute) Skin
1841
- $upgrader = new Plugin_Upgrader($upgrader_skins);
1842
-
1843
- remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
1844
-
1845
- $plugins = get_plugins();
1846
-
1847
- //upgrade or install?
1848
- foreach($plugins as $id => $plugin){
1849
- $wp_plugin_slug = dirname($id);
1850
- $is_embedded = $this->plugin_is_embedded_version(preg_replace('/ Embedded$/', '', $plugin['Name']), preg_replace('/-embedded$/', '', $wp_plugin_slug));
1851
-
1852
- if($wp_plugin_slug == $data['slug'] || $is_embedded && preg_replace('/-embedded$/', '', $wp_plugin_slug) == $data['slug']){
1853
- $plugin_id = $id;
1854
- break;
1855
- }
1856
- }
1857
-
1858
- if($plugin_id && empty($is_embedded)){ //upgrade
1859
- $response['upgrade'] = 1;
1860
-
1861
- $plugin_is_active = is_plugin_active($plugin_id);
1862
-
1863
- $ret = $upgrader->upgrade($plugin_id);
1864
-
1865
- if(!$ret && !empty($upgrader->skin->installer_error)){
1866
- if(is_wp_error($upgrader->skin->installer_error)){
1867
- $message = $upgrader->skin->installer_error->get_error_message() .
1868
- ' (' . $upgrader->skin->installer_error->get_error_data() . ')';
1869
- }
1870
- }
1871
-
1872
- if($plugin_is_active){
1873
- //prevent redirects
1874
- add_filter('wp_redirect', '__return_false');
1875
- activate_plugin($plugin_id);
1876
- }
1877
-
1878
- }else{ //install
1879
-
1880
- if($is_embedded){
1881
- delete_plugins(array($plugin_id));
1882
- }
1883
-
1884
- $response['install'] = 1;
1885
- $ret = $upgrader->install($data['url']);
1886
- if(!$ret && !empty($upgrader->skin->installer_error)){
1887
- if(is_wp_error($upgrader->skin->installer_error)){
1888
- $message = $upgrader->skin->installer_error->get_error_message() .
1889
- ' (' . $upgrader->skin->installer_error->get_error_data() . ')';
1890
- }
1891
- }
1892
- }
1893
-
1894
- $plugins = get_plugins(); //read again
1895
-
1896
- if($ret && !empty($_POST['activate'])){
1897
- foreach($plugins as $id => $plugin){
1898
- $wp_plugin_slug = dirname($id);
1899
- if($wp_plugin_slug == $data['slug']){
1900
- $plugin_version = $plugin['Version'];
1901
- $plugin_id = $id;
1902
- break;
1903
- }
1904
- }
1905
-
1906
- }
1907
-
1908
- }
1909
-
1910
- } else { //subscription not valid
1911
-
1912
- $ret = false;
1913
- $message = __('Your subscription appears to no longer be valid. Please try to register again using a valid site key.', 'installer');
1914
- }
1915
-
1916
- $response['version'] = isset($plugin_version) ? $plugin_version : 0;
1917
- $response['plugin_id'] = $plugin_id;
1918
- $response['nonce'] = wp_create_nonce('activate_' . $plugin_id);
1919
- $response['success'] = $ret;
1920
- $response['message'] = $message;
1921
-
1922
- echo json_encode( $response );
1923
- exit;
1924
-
1925
- }
1926
-
1927
- public function download_plugin($slug, $url){
1928
-
1929
- require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
1930
- require_once $this->plugin_path() . '/includes/installer-upgrader-skins.php';
1931
-
1932
- $upgrader_skins = new Installer_Upgrader_Skins(); //use our custom (mute) Skin
1933
- $upgrader = new Plugin_Upgrader($upgrader_skins);
1934
-
1935
- remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
1936
-
1937
- $plugins = get_plugins();
1938
-
1939
- $plugin_id = false;
1940
-
1941
- //upgrade or install?
1942
- foreach($plugins as $id => $plugin){
1943
- $wp_plugin_slug = dirname($id);
1944
- if($wp_plugin_slug == $slug){
1945
- $plugin_id = $id;
1946
- break;
1947
- }
1948
- }
1949
-
1950
- if($plugin_id){ //upgrade
1951
-
1952
- $plugin_is_active = is_plugin_active($plugin_id);
1953
-
1954
- $ret = $upgrader->upgrade($plugin_id);
1955
-
1956
- if($plugin_is_active){
1957
- activate_plugin($plugin_id);
1958
- }
1959
-
1960
- }else{ //install
1961
- $ret = $upgrader->install($url);
1962
- }
1963
-
1964
- return $ret;
1965
-
1966
- }
1967
-
1968
- public function activate_plugin(){
1969
-
1970
- $error = '';
1971
-
1972
- $plugin_id = sanitize_text_field ( $_POST['plugin_id'] );
1973
- if(isset($_POST['nonce']) && $plugin_id && $_POST['nonce'] == wp_create_nonce('activate_' . $plugin_id )){
1974
-
1975
- // Deactivate any embedded version
1976
- $plugin_slug = dirname($plugin_id);
1977
- $active_plugins = get_option('active_plugins');
1978
- foreach($active_plugins as $plugin){
1979
- $wp_plugin_slug = dirname($plugin);
1980
- if($wp_plugin_slug == $plugin_slug . '-embedded'){
1981
- deactivate_plugins(array($plugin));
1982
- break;
1983
- }
1984
- }
1985
-
1986
- //prevent redirects
1987
- add_filter('wp_redirect', '__return_false', 10000);
1988
-
1989
- $return = activate_plugin($plugin_id);
1990
-
1991
- if(is_wp_error($return)){
1992
- $error = $return->get_error_message();
1993
- }
1994
-
1995
- }else{
1996
- $error = 'error';
1997
- }
1998
-
1999
- $ret = array('error' => $error);
2000
-
2001
- echo json_encode($ret);
2002
- exit;
2003
-
2004
- }
2005
-
2006
- public function custom_plugins_api_call($false, $action, $args){
2007
-
2008
- if($action == 'plugin_information'){
2009
-
2010
- $plugins = get_plugins();
2011
- $plugin_names = array();
2012
- foreach( $plugins as $plugin_id => $plugin ) {
2013
- // plugins by WP slug which (plugin folder) which can be different
2014
- // will use this to compare by title
2015
- $plugin_names[ dirname( $plugin_id ) ] = array(
2016
- 'name' => $plugin['Name'],
2017
- 'title' => $plugin['Title'],
2018
- );
2019
- }
2020
-
2021
- $slug = $args->slug;
2022
-
2023
- foreach($this->settings['repositories'] as $repository_id => $repository){
2024
-
2025
- if(!$this->repository_has_valid_subscription($repository_id)){
2026
- $site_key = false;
2027
- }else{
2028
- $site_key = $repository['subscription']['key'];
2029
- }
2030
-
2031
- foreach($repository['data']['packages'] as $package){
2032
-
2033
- foreach($package['products'] as $product){
2034
-
2035
- foreach($product['plugins'] as $plugin_slug){
2036
-
2037
- $download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
2038
-
2039
- if( $download['slug'] == $slug ||
2040
- isset( $plugin_names[$slug] ) && (
2041
- $plugin_names[$slug]['name'] == $download['name'] ||
2042
- $plugin_names[$slug]['title'] == $download['name']
2043
- )
2044
- ){
2045
-
2046
- if( !empty( $download['free-on-wporg'] ) ){
2047
- return false; // use data from wordpress.org
2048
- }
2049
-
2050
- $res = new stdClass();
2051
- $res->external = true;
2052
-
2053
- $res->name = $download['name'];
2054
- $res->slug = $slug;
2055
- $res->version = $download['version'];
2056
- $res->author = '';
2057
- $res->author_profile = '';
2058
- $res->last_updated = $download['date'];
2059
-
2060
- if($site_key){
2061
- $res->download_link = $this->append_site_key_to_download_url($download['url'], $site_key, $repository_id);
2062
- }
2063
-
2064
- $res->homepage = $repository['data']['url'];
2065
- $res->sections = array('Description' => $download['description'], 'Changelog' => $download['changelog']);
2066
-
2067
- return $res;
2068
-
2069
- }
2070
-
2071
- }
2072
-
2073
- }
2074
-
2075
- }
2076
-
2077
- }
2078
-
2079
- }
2080
-
2081
- return $false;
2082
-
2083
- }
2084
-
2085
- public function plugins_upgrade_check($update_plugins){
2086
-
2087
- if(!empty($this->settings['repositories'])){
2088
-
2089
- $plugins = get_plugins();
2090
-
2091
- foreach($plugins as $plugin_id => $plugin){
2092
-
2093
- $slug = dirname($plugin_id);
2094
- if(empty($slug)) continue;
2095
-
2096
- $version = $plugin['Version'];
2097
- $name = $plugin['Name'];
2098
-
2099
- foreach($this->settings['repositories'] as $repository_id => $repository){
2100
-
2101
-
2102
- if(!$this->repository_has_valid_subscription($repository_id)){
2103
- $site_key = false;
2104
- }else{
2105
- $site_key = $repository['subscription']['key'];
2106
- //$subscription_type = $this->get_subscription_type_for_repository($repository_id);
2107
- }
2108
-
2109
- foreach($repository['data']['packages'] as $package){
2110
-
2111
- foreach($package['products'] as $product){
2112
-
2113
- foreach($product['plugins'] as $plugin_slug){
2114
-
2115
- $download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
2116
-
2117
- if(!empty($download['free-on-wporg'])) {
2118
- continue;
2119
- }
2120
-
2121
- if(empty($update_plugins->response[$plugin_id]) && ($download['slug'] == $slug || $download['name'] == $name ) && version_compare($download['version'], $version, '>')){
2122
-
2123
- $response = new stdClass();
2124
- $response->id = 0;
2125
- $response->slug = $slug;
2126
- $response->plugin = $plugin_id;
2127
- $response->new_version = $download['version'];
2128
- $response->upgrade_notice = '';
2129
- $response->url = $download['url'];
2130
- if($site_key){
2131
- $response->package = $this->append_site_key_to_download_url($download['url'], $site_key, $repository_id);
2132
- }
2133
- $update_plugins->checked[$plugin_id] = $version;
2134
- $update_plugins->response[$plugin_id] = $response;
2135
-
2136
- }
2137
-
2138
- }
2139
-
2140
- }
2141
-
2142
- }
2143
-
2144
- }
2145
-
2146
- }
2147
-
2148
- }
2149
-
2150
- return $update_plugins;
2151
-
2152
- }
2153
-
2154
- public function setup_plugins_page_notices(){
2155
-
2156
- $plugins = get_plugins();
2157
-
2158
- foreach($plugins as $plugin_id => $plugin){
2159
-
2160
- $slug = dirname($plugin_id);
2161
- if(empty($slug)) continue;
2162
-
2163
- $name = $plugin['Name'];
2164
-
2165
- foreach($this->settings['repositories'] as $repository_id => $repository){
2166
-
2167
- if(!$this->repository_has_valid_subscription($repository_id)){
2168
- $site_key = false;
2169
- }else{
2170
- $site_key = $repository['subscription']['key'];
2171
- }
2172
-
2173
- foreach($repository['data']['packages'] as $package){
2174
-
2175
- foreach($package['products'] as $product){
2176
-
2177
- foreach($product['plugins'] as $plugin_slug){
2178
-
2179
- $download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
2180
-
2181
- if(!empty($download['free-on-wporg'])) {
2182
- continue;
2183
- }
2184
-
2185
- if( $download['slug'] == $slug || $download['name'] == $name ){
2186
-
2187
- if( !$site_key || !$this->plugin_is_registered($repository_id, $download['slug']) ){
2188
- add_action( "after_plugin_row_" . $plugin_id, array($this, 'show_purchase_notice_under_plugin'), 10, 3 );
2189
- }
2190
-
2191
- }
2192
-
2193
- }
2194
-
2195
- }
2196
-
2197
- }
2198
-
2199
- }
2200
-
2201
- }
2202
-
2203
- }
2204
-
2205
- public function show_purchase_notice_under_plugin($plugin_file, $plugin_data, $status){
2206
-
2207
- $wp_list_table = _get_list_table('WP_Plugins_List_Table');
2208
- $wp_version = preg_replace( '/-(.+)$/', '', $GLOBALS['wp_version'] );
2209
-
2210
- if( version_compare( $wp_version, '4.6', '>=' ) ){
2211
-
2212
- ?>
2213
- <tr class="plugin-update-tr installer-plugin-update-tr">
2214
- <td colspan="<?php echo $wp_list_table->get_column_count(); ?>" class="plugin-update colspanchange">
2215
- <div class="notice inline notice-warning notice-alt">
2216
- <p class="installer-q-icon">
2217
- <?php printf( __('You must have a valid subscription in order to get upgrades or support for this plugin. %sPurchase a subscription or enter an existing site key%s.', 'installer'),
2218
- '<a href="' . $this->menu_url() . '">', '</a>'); ?>
2219
- </p>
2220
- </div>
2221
- </td>
2222
- </tr>
2223
- <?php
2224
-
2225
- } else {
2226
-
2227
- ?>
2228
- <tr class="plugin-update-tr">
2229
- <td colspan="<?php echo $wp_list_table->get_column_count(); ?>" class="plugin-update colspanchange">
2230
- <div class="update-message installer-q-icon">
2231
- <?php printf( __('You must have a valid subscription in order to get upgrades or support for this plugin. %sPurchase a subscription or enter an existing site key%s.', 'installer'),
2232
- '<a href="' . $this->menu_url() . '">', '</a>'); ?>
2233
- </div>
2234
- </td>
2235
- </tr>
2236
- <?php
2237
-
2238
- }
2239
-
2240
- }
2241
-
2242
- public function localize_strings(){
2243
-
2244
- if(!empty($this->settings['repositories'])){
2245
- foreach($this->settings['repositories'] as $repository_id => $repository){
2246
- //set name as call2action when don't have any
2247
- //products
2248
- foreach($repository['data']['packages'] as $package_id => $package){
2249
- foreach($package['products'] as $product_id => $product){
2250
- if(empty($product['call2action'])){
2251
- $this->settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['call2action'] = $product['name'];
2252
- }
2253
-
2254
- foreach($product['upgrades'] as $idx => $upg){
2255
- if(empty($upg['call2action'])){
2256
- $this->settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['upgrades'][$idx]['call2action'] = $upg['name'];
2257
- }
2258
- }
2259
-
2260
- foreach($product['renewals'] as $idx => $rnw){
2261
- if(empty($rnw['call2action'])){
2262
- $this->settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['renewals'][$idx]['call2action'] = $rnw['name'];
2263
- }
2264
-
2265
- }
2266
-
2267
- }
2268
- }
2269
- }
2270
- }
2271
-
2272
- global $sitepress;
2273
- if(is_null($sitepress)){
2274
- return;
2275
- }
2276
-
2277
- // default strings are always in English
2278
- $user_admin_language = $sitepress->get_admin_language();
2279
-
2280
- if($user_admin_language != 'en'){
2281
- foreach($this->settings['repositories'] as $repository_id => $repository){
2282
-
2283
- $localization = $repository['data']['localization'];
2284
-
2285
- //packages
2286
- foreach($repository['data']['packages'] as $package_id => $package){
2287
-
2288
- if( isset($localization['packages'][$package_id]['name'][$user_admin_language]) ){
2289
- $this->settings['repositories'][$repository_id]['data']['packages'][$package_id]['name'] = $localization['packages'][$package_id]['name'][$user_admin_language];
2290
- }
2291
- if( isset($localization['packages'][$package_id]['description'][$user_admin_language]) ){
2292
- $this->settings['repositories'][$repository_id]['data']['packages'][$package_id]['description'] = $localization['packages'][$package_id]['description'][$user_admin_language];
2293
- }
2294
-
2295
- }
2296
-
2297
- //products
2298
- foreach($repository['data']['packages'] as $package_id => $package){
2299
- foreach($package['products'] as $product_id => $product){
2300
-
2301
- if( isset($localization['products'][$product_id]['name'][$user_admin_language]) ){
2302
- $this->settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['name']
2303
- = $localization['products'][$product_id]['name'][$user_admin_language];
2304
- }
2305
- if( isset($localization['products'][$product_id]['description'][$user_admin_language]) ){
2306
- $this->settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['description']
2307
- = $localization['products'][$product_id]['description'][$user_admin_language];
2308
- }
2309
- if( isset($localization['products'][$product_id]['call2action'][$user_admin_language]) ){
2310
- $this->settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['name']
2311
- = $localization['products'][$product_id]['call2action'][$user_admin_language];
2312
- }
2313
-
2314
-
2315
- }
2316
- }
2317
-
2318
- //subscription info
2319
- if(isset($repository['data']['subscriptions_meta']['expiration'])){
2320
- foreach($repository['data']['subscriptions_meta']['expiration'] as $subscription_id => $note){
2321
- if(isset($localization['subscriptions-notes'][$subscription_id]['expiration-warning'][$user_admin_language])){
2322
- $this->settings['repositories'][$repository_id]['data']['subscriptions_meta']['expiration'][$subscription_id]['warning_message']
2323
- = $localization['subscriptions-notes'][$subscription_id]['expiration-warning'][$user_admin_language];
2324
- }
2325
- }
2326
- }
2327
-
2328
- }
2329
- }
2330
-
2331
- }
2332
-
2333
- public function get_matching_cp($repository, $args = array()){
2334
- $match = false;
2335
-
2336
-
2337
- $cp_name = $cp_author = false;
2338
-
2339
- if(isset($this->config['src_name']) && isset($this->config['src_author'])){
2340
-
2341
- $cp_name = $this->config['src_name'];
2342
- $cp_author = $this->config['src_author'];
2343
-
2344
- }elseif(isset($args['src_name']) && isset($args['src_author'])){
2345
-
2346
- $cp_name = $args['src_name'];
2347
- $cp_author = $args['src_author'];
2348
-
2349
- }
2350
-
2351
- if(isset($repository['data']['marketing_cp'])){
2352
-
2353
- foreach($repository['data']['marketing_cp'] as $cp){
2354
-
2355
- if(!empty($cp['exp']) && time() > $cp['exp']){
2356
- continue;
2357
- }
2358
-
2359
- //Use theme_name for plugins too
2360
- if(!empty($cp['theme_name'])){
2361
- if($cp['author_name'] == $cp_author && $cp['theme_name'] == $cp_name){
2362
- $match = $cp;
2363
- continue;
2364
- }
2365
- }else{
2366
- if($cp['author_name'] == $cp_author){
2367
- $match = $cp;
2368
- continue;
2369
- }
2370
- }
2371
-
2372
- }
2373
-
2374
- }
2375
-
2376
- return $match;
2377
- }
2378
-
2379
- public function set_filtered_prices($args = array()){
2380
-
2381
- foreach($this->settings['repositories'] as $repository_id => $repository){
2382
-
2383
- $match = $this->get_matching_cp($repository, $args);
2384
-
2385
- if(empty($match)) continue;
2386
-
2387
- foreach($repository['data']['packages'] as $package_id => $package){
2388
-
2389
- foreach($package['products'] as $product_id => $product){
2390
-
2391
- if($match['dtp'] == '%'){
2392
- $fprice = round( $product['price'] * (1 - $match['amt']/100), 2 );
2393
- $fprice = $fprice != round($fprice) ? sprintf('%.2f', $fprice) : round($fprice, 0);
2394
- }elseif($match['dtp'] == '-'){
2395
- $fprice = $product['price'] - $match['amt'];
2396
- }else{
2397
- $fprice = $product['price'];
2398
- }
2399
-
2400
- if($fprice){
2401
- $this->settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['price_disc'] = $fprice;
2402
-
2403
- $url_glue = false !== strpos($this->settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['url'], '?') ? '&' : '?';
2404
- $cpndata = base64_encode(json_encode(array('theme_author' => $match['author_name'], 'theme_name' => $match['theme_name'], 'vlc' => $match['vlc'])));
2405
- $this->settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['url'] .= $url_glue . 'cpn=' . $cpndata;
2406
-
2407
- foreach($product['upgrades'] as $upgrade_id => $upgrade){
2408
-
2409
- $fprice = false;
2410
- if($match['dtp'] == '%'){
2411
- $fprice = round( $upgrade['price'] * (1 - $match['amt']/100), 2 );
2412
- $fprice = $fprice != round($fprice) ? sprintf('%.2f', $fprice) : round($fprice, 0);
2413
- }elseif($match['dtp'] == '-'){
2414
- $fprice = $upgrade['price'] - $match['amt'];
2415
- }
2416
- if($fprice){
2417
- $this->settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['upgrades'][$upgrade_id]['price_disc'] = $fprice;
2418
- $this->settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['upgrades'][$upgrade_id]['url'] .= $url_glue . 'cpn=' . $cpndata;
2419
- }
2420
-
2421
-
2422
- }
2423
-
2424
- }
2425
-
2426
- }
2427
-
2428
- }
2429
-
2430
- }
2431
-
2432
- }
2433
-
2434
- public function set_hierarchy_and_order(){
2435
-
2436
- //2 levels
2437
- if(!empty($this->settings['repositories'])) {
2438
- foreach ($this->settings['repositories'] as $repository_id => $repository) {
2439
-
2440
- if( empty( $repository['data']['packages'] ) ) continue;
2441
-
2442
- $all_packages = $repository['data']['packages'];
2443
- $ordered_packages = array();
2444
-
2445
- //backward compatibility - 'order'
2446
- foreach($all_packages as $k => $v){
2447
- if(!isset($v['order'])){
2448
- $all_packages[$k]['order'] = 0;
2449
- }
2450
- }
2451
-
2452
- //select parents
2453
- foreach ($all_packages as $package_id => $package) {
2454
- if(empty($package['parent'])){
2455
- $ordered_packages[$package_id] = $package;
2456
- }
2457
- }
2458
-
2459
- //add sub-packages
2460
- foreach($all_packages as $package_id => $package){
2461
- if(!empty($package['parent'])) {
2462
- if(isset($ordered_packages[$package['parent']])){
2463
- $ordered_packages[$package['parent']]['sub-packages'][$package_id] = $package;
2464
- }
2465
- }
2466
- }
2467
-
2468
- // order parents
2469
- usort($ordered_packages, array($this, '_order_packages_callback'));
2470
- //order sub-packages
2471
- foreach($ordered_packages as $package_id => $package){
2472
- if(!empty($package['sub-packages'])) {
2473
- usort($ordered_packages[$package_id]['sub-packages'], create_function('$a, $b', 'return $a[\'order\'] > $b[\'order\'];'));
2474
- }
2475
- }
2476
-
2477
- $this->settings['repositories'][$repository_id]['data']['packages'] = $ordered_packages;
2478
-
2479
-
2480
- }
2481
- }
2482
-
2483
-
2484
- }
2485
-
2486
- public function _order_packages_callback($a, $b){
2487
- return $a['order'] > $b['order'];
2488
- }
2489
-
2490
- public function get_support_tag_by_name( $name, $repository ){
2491
-
2492
- if( is_array($this->settings['repositories'][$repository]['data']['support_tags'] )){
2493
- foreach( $this->settings['repositories'][$repository]['data']['support_tags'] as $support_tag){
2494
- if( $support_tag['name'] == $name ){
2495
- return $support_tag['url'];
2496
- }
2497
- }
2498
- }
2499
-
2500
- return false;
2501
- }
2502
-
2503
- public function plugin_upgrade_custom_errors(){
2504
-
2505
- if ( isset($_REQUEST['action']) ) {
2506
-
2507
- $action = isset($_REQUEST['action']) ? sanitize_text_field ( $_REQUEST['action'] ) : '';
2508
-
2509
- //bulk mode
2510
- if('update-selected' == $action) {
2511
-
2512
- global $plugins;
2513
-
2514
- if(isset($plugins) && is_array($plugins)) {
2515
-
2516
- foreach ($plugins as $k => $plugin) {
2517
- $plugin_repository = false;
2518
-
2519
- $wp_plugin_slug = dirname($plugin);
2520
-
2521
- foreach ($this->settings['repositories'] as $repository_id => $repository) {
2522
-
2523
- foreach ($repository['data']['packages'] as $package) {
2524
-
2525
- foreach ($package['products'] as $product) {
2526
-
2527
- foreach ($product['plugins'] as $plugin_slug) {
2528
-
2529
- $download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
2530
-
2531
- if ($download['slug'] == $wp_plugin_slug) {
2532
- $plugin_repository = $repository_id;
2533
- $product_name = $repository['data']['product-name'];
2534
- $plugin_name = $download['name'];
2535
- $free_on_wporg = !empty($download['free-on-wporg']);
2536
- break;
2537
- }
2538
-
2539
- }
2540
-
2541
- }
2542
-
2543
- }
2544
-
2545
- }
2546
-
2547
- if ($plugin_repository) {
2548
-
2549
- //validate subscription
2550
- static $sub_cache = array();
2551
-
2552
- if(empty($sub_cache[$plugin_repository])){
2553
- $site_key = $this->get_repository_site_key($plugin_repository);
2554
- if ($site_key) {
2555
- $subscription_data = $this->fetch_subscription_data( $plugin_repository, $site_key, self::SITE_KEY_VALIDATION_SOURCE_REVALIDATION );
2556
- }
2557
-
2558
- $sub_cache[$plugin_repository]['site_key'] = $site_key;
2559
- $sub_cache[$plugin_repository]['subscription_data'] = isset($subscription_data) ? $subscription_data : false;
2560
- }else{
2561
-
2562
- $site_key = $sub_cache[$plugin_repository]['site_key'];
2563
- $subscription_data = $sub_cache[$plugin_repository]['subscription_data'];
2564
-
2565
- }
2566
-
2567
- if(!$site_key && !empty($free_on_wporg)){ // allow the download from wp.org
2568
- continue;
2569
- }
2570
-
2571
- if (empty($site_key) || empty($subscription_data)) {
2572
-
2573
-
2574
- $error_message = sprintf(__("%s cannot update because your site's registration is not valid. Please %sregister %s%s again for this site first.", 'installer'),
2575
- '<strong>' . $plugin_name . '</strong>', '<a target="_top" href="' . $this->menu_url() . '&validate_repository=' . $plugin_repository .
2576
- '#repository-' . $plugin_repository . '">', $product_name, '</a>');
2577
-
2578
- echo '<div class="updated error"><p>' . $error_message . '</p></div>';
2579
-
2580
- unset($plugins[$k]);
2581
-
2582
-
2583
- }
2584
-
2585
- }
2586
-
2587
- }
2588
-
2589
- }
2590
-
2591
- }
2592
-
2593
-
2594
- if( 'upgrade-plugin' == $action || 'update-plugin' == $action ) {
2595
-
2596
- $plugin = isset($_REQUEST['plugin']) ? trim( sanitize_text_field ( $_REQUEST['plugin'] ) ) : '';
2597
-
2598
- $wp_plugin_slug = dirname($plugin);
2599
-
2600
- $plugin_repository = false;
2601
-
2602
- foreach($this->settings['repositories'] as $repository_id => $repository){
2603
-
2604
- foreach($repository['data']['packages'] as $package){
2605
-
2606
- foreach($package['products'] as $product){
2607
-
2608
- foreach($product['plugins'] as $plugin_slug){
2609
- $download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
2610
-
2611
- //match by folder, will change to match by name and folder
2612
- if($download['slug'] == $wp_plugin_slug) {
2613
- $plugin_repository = $repository_id;
2614
- $product_name = $repository['data']['product-name'];
2615
- $plugin_name = $download['name'];
2616
- $free_on_wporg = !empty($download['free-on-wporg']);
2617
- break;
2618
- }
2619
-
2620
- }
2621
-
2622
- }
2623
-
2624
- }
2625
-
2626
- }
2627
-
2628
- if($plugin_repository) {
2629
-
2630
- //validate subscription
2631
- $site_key = $this->get_repository_site_key($plugin_repository);
2632
- if ($site_key) {
2633
- $subscription_data = $this->fetch_subscription_data( $plugin_repository, $site_key, self::SITE_KEY_VALIDATION_SOURCE_REVALIDATION );
2634
- }
2635
-
2636
- if ( (empty($site_key) || empty($subscription_data)) && empty($free_on_wporg)) {
2637
-
2638
- $error_message = sprintf(__("%s cannot update because your site's registration is not valid. Please %sregister %s%s again for this site first.", 'installer'),
2639
- '<strong>'.$plugin_name . '</strong>', '<a href="' . $this->menu_url() . '&validate_repository=' . $plugin_repository .
2640
- '#repository-' . $plugin_repository . '">', $product_name, '</a>');
2641
-
2642
- if(defined('DOING_AJAX')){ //WP 4.2
2643
-
2644
- $status = array(
2645
- 'update' => 'plugin',
2646
- 'plugin' => $plugin,
2647
- 'slug' => sanitize_key( $_POST['slug'] ),
2648
- 'oldVersion' => '',
2649
- 'newVersion' => '',
2650
- );
2651
-
2652
- $status['errorCode'] = 'wp_installer_invalid_subscription';
2653
- $status['error'] = $error_message;
2654
-
2655
- wp_send_json_error( $status );
2656
-
2657
- } else { // WP 4.1.1
2658
- echo '<div class="updated error"><p>' . $error_message . '</p></div>';
2659
-
2660
-
2661
- echo '<div class="wrap">';
2662
- echo '<h2>' . __( 'Update Plugin', 'installer' ) . '</h2>';
2663
- echo '<a href="' . admin_url('plugins.php') . '">' . __( 'Return to the plugins page', 'installer' ) . '</a>';
2664
- echo '</div>';
2665
- require_once(ABSPATH . 'wp-admin/admin-footer.php');
2666
- exit;
2667
-
2668
- }
2669
-
2670
- }
2671
-
2672
-
2673
- }
2674
-
2675
- }
2676
- }
2677
-
2678
- }
2679
-
2680
- }
1
+ <?php
2
+
3
+ final class WP_Installer{
4
+ protected static $_instance = null;
5
+
6
+ public $settings = array();
7
+
8
+ private $repositories = array();
9
+
10
+ protected $api_debug = '';
11
+
12
+ private $config = array();
13
+
14
+ protected $_plugins_renew_warnings = array();
15
+
16
+ protected $_gz_on = false;
17
+
18
+ private $admin_messages = array();
19
+
20
+ private $_using_icl = false;
21
+ private $_wpml_version = false;
22
+
23
+ private $package_source = array();
24
+
25
+ const SITE_KEY_VALIDATION_SOURCE_OTHER = 0;
26
+ const SITE_KEY_VALIDATION_SOURCE_DOWNLOAD_SPECIFIC = 1;
27
+ const SITE_KEY_VALIDATION_SOURCE_DOWNLOAD_REPORT = 2;
28
+ const SITE_KEY_VALIDATION_SOURCE_REGISTRATION = 3;
29
+ const SITE_KEY_VALIDATION_SOURCE_REVALIDATION = 4;
30
+ const SITE_KEY_VALIDATION_SOURCE_UPDATES_CHECK = 5;
31
+
32
+ public $dependencies;
33
+
34
+ public static function instance() {
35
+
36
+ if ( is_null( self::$_instance ) ) {
37
+ self::$_instance = new self();
38
+ }
39
+
40
+ return self::$_instance;
41
+ }
42
+
43
+ public function __construct(){
44
+
45
+ if(!is_admin() || !is_user_logged_in()) return; //Only for admin
46
+
47
+ $this->_gz_on = function_exists('gzuncompress') && function_exists('gzcompress');
48
+ $this->settings = $this->get_settings();
49
+
50
+ add_action('admin_notices', array($this, 'show_site_key_nags'));
51
+
52
+ add_action('admin_notices', array($this, 'show_admin_messages'));
53
+
54
+ add_action('admin_init', array($this, 'load_embedded_plugins'), 0);
55
+
56
+ add_action('admin_menu', array($this, 'menu_setup'));
57
+ add_action('network_admin_menu', array($this, 'menu_setup'));
58
+
59
+ if(defined('DOING_AJAX') && isset($_POST['action']) && $_POST['action'] == 'installer_download_plugin'){
60
+ add_filter( 'site_transient_update_plugins', array( $this, 'plugins_upgrade_check') );
61
+ }
62
+ add_filter('plugins_api', array( $this, 'custom_plugins_api_call'), 10, 3);
63
+ add_filter('pre_set_site_transient_update_plugins', array( $this, 'plugins_upgrade_check'));
64
+
65
+ // register repositories
66
+ $this->load_repositories_list();
67
+
68
+ if( empty($this->settings['last_repositories_update']) || time() - $this->settings['last_repositories_update'] > 86400
69
+ || ( isset($_GET['force-check']) && $_GET['force-check'] == 1 ) ){
70
+ $this->refresh_repositories_data();
71
+ }
72
+
73
+ // default config
74
+ $this->config['plugins_install_tab'] = false;
75
+
76
+ add_action('init', array($this, 'init'));
77
+
78
+ //add_filter('wp_installer_buy_url', array($this, 'append_parameters_to_buy_url'));
79
+
80
+ add_action('init', array($this,'load_locale'));
81
+
82
+ }
83
+
84
+ public function get_repositories() {
85
+
86
+ return $this->repositories;
87
+
88
+ }
89
+
90
+ public function set_config($key, $value){
91
+
92
+ $this->config[$key] = $value;
93
+
94
+ }
95
+
96
+ public function init(){
97
+ global $pagenow;
98
+
99
+ $this->dependencies = new Installer_Dependencies;
100
+
101
+ if(empty($this->settings['_pre_1_0_clean_up'])) {
102
+ $this->_pre_1_0_clean_up();
103
+ }
104
+
105
+ $this->settings = $this->_old_products_format_backwards_compatibility($this->settings);
106
+
107
+ if ( !function_exists( 'get_plugins' ) ) {
108
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
109
+ }
110
+
111
+ $this->_using_icl = function_exists('wpml_site_uses_icl') && wpml_site_uses_icl();
112
+ $this->_wpml_version = defined('ICL_SITEPRESS_VERSION') ? ICL_SITEPRESS_VERSION : '';
113
+
114
+ wp_enqueue_script('installer-admin', $this->res_url() . '/res/js/admin.js', array('jquery'), $this->version());
115
+ wp_enqueue_style('installer-admin', $this->res_url() . '/res/css/admin.css', array(), $this->version());
116
+
117
+ $translation_array = array(
118
+ 'installing' => __( 'Installing %s', 'installer' ),
119
+ 'updating' => __( 'Updating %s', 'installer' ),
120
+ 'activating' => __( 'Activating %s', 'installer' )
121
+ );
122
+
123
+ wp_localize_script( 'installer-admin', 'installer_strings', $translation_array );
124
+
125
+ if($pagenow == 'plugins.php'){
126
+ add_action('admin_notices', array($this, 'setup_plugins_page_notices'));
127
+ add_action('admin_notices', array($this, 'setup_plugins_renew_warnings'), 10);
128
+ add_action('admin_notices', array($this, 'queue_plugins_renew_warnings'), 20);
129
+
130
+ add_action('admin_init', array($this, 'setup_plugins_action_links'));
131
+
132
+ }
133
+
134
+ if($this->is_repositories_page()){
135
+ add_action('admin_init', array($this, 'validate_repository_subscription'));
136
+ }
137
+
138
+ if(defined('DOING_AJAX')){
139
+ add_action('wp_ajax_save_site_key', array($this, 'save_site_key'));
140
+ add_action('wp_ajax_remove_site_key', array($this, 'remove_site_key_ajax'));
141
+ add_action('wp_ajax_update_site_key', array($this, 'update_site_key'));
142
+
143
+ add_action('wp_ajax_installer_download_plugin', array($this, 'download_plugin_ajax_handler'));
144
+ add_action('wp_ajax_installer_activate_plugin', array($this, 'activate_plugin'));
145
+
146
+ add_action('wp_ajax_installer_dismiss_nag', array($this, 'dismiss_nag'));
147
+ }
148
+
149
+ if($pagenow == 'update.php'){
150
+ if(isset($_GET['action']) && $_GET['action'] == 'update-selected'){
151
+ add_action('admin_head', array($this, 'plugin_upgrade_custom_errors')); //iframe/bulk
152
+ }else{
153
+ add_action('all_admin_notices', array($this, 'plugin_upgrade_custom_errors')); //regular/singular
154
+ }
155
+ }
156
+
157
+ // WP 4.2
158
+ if(defined('DOING_AJAX')){
159
+ add_action('wp_ajax_update-plugin', array($this, 'plugin_upgrade_custom_errors'), 0); // high priority, before WP
160
+ }
161
+
162
+ //Include theme support
163
+ include_once $this->plugin_path() . '/includes/class-installer-theme.php';
164
+
165
+ // Extra information about the source of Installer
166
+ $package_source_file = $this->plugin_path() . '/installer-source.json';
167
+ if( file_exists( $package_source_file ) ){
168
+ WP_Filesystem();
169
+ global $wp_filesystem;
170
+ $this->package_source = json_decode( $wp_filesystem->get_contents( $package_source_file ) );
171
+ }
172
+ }
173
+
174
+ protected function log($message){
175
+ require_once ABSPATH . 'wp-admin/includes/file.php';
176
+ WP_Filesystem();
177
+ global $wp_filesystem;
178
+ if( defined('WPML_INSTALLER_LOGGING') && WPML_INSTALLER_LOGGING ){
179
+ $wp_filesystem->put_contents( $this->plugin_path() . '/installer.log', current_time( 'mysql' ) . "\t" . $message . "\n" );
180
+ }
181
+ }
182
+
183
+ public function register_admin_message($text, $type = 'updated'){
184
+ $this->admin_messages[] = array('text' => $text, 'type' => $type);
185
+ }
186
+
187
+ public function show_admin_messages(){
188
+ if(!empty($this->admin_messages)){
189
+ $types = array( 'error', 'updated', 'notice' );
190
+ foreach($this->admin_messages as $message){
191
+ $class = in_array( $message['type'], $types ) ? $message['type'] : 'updated';
192
+ ?>
193
+ <div class="<?php echo $class ?>">
194
+ <p>
195
+ <?php echo $message['text'] ?>
196
+ </p>
197
+ </div>
198
+ <?php
199
+ }
200
+ }
201
+ }
202
+
203
+ public function load_locale(){
204
+ $locale = get_locale();
205
+ $locale = apply_filters( 'plugin_locale', $locale, 'installer' );
206
+ $mo_file = $this->plugin_path() . '/locale/installer-' . $locale . '.mo';
207
+ if(file_exists($mo_file)){
208
+ load_textdomain( 'installer', $mo_file );
209
+ }
210
+ }
211
+
212
+ public function load_embedded_plugins(){
213
+ if(file_exists($this->plugin_path() . '/embedded-plugins' )) {
214
+ include_once $this->plugin_path() . '/embedded-plugins/embedded-plugins.class.php';
215
+ $this->installer_embedded_plugins = new Installer_Embedded_Plugins();
216
+ }
217
+ }
218
+
219
+ public function menu_setup(){
220
+ global $pagenow;
221
+
222
+ if(is_multisite() && !is_network_admin()){
223
+ $this->menu_multisite_redirect();
224
+ add_options_page(__('Installer', 'installer'), __('Installer', 'installer'), 'manage_options', 'installer', array($this, 'show_products')) ;
225
+ }else{
226
+ if($this->config['plugins_install_tab'] && is_admin() && $pagenow == 'plugin-install.php'){
227
+ // Default GUI, under Plugins -> Install
228
+ add_filter('install_plugins_tabs', array($this, 'add_install_plugins_tab'));
229
+ add_action('install_plugins_commercial', array($this, 'show_products'));
230
+ }
231
+ }
232
+
233
+ }
234
+
235
+ public function menu_url(){
236
+ if(is_multisite()){
237
+ if(is_network_admin()){
238
+ $url = network_admin_url('plugin-install.php?tab=commercial');
239
+ }else{
240
+ $url = admin_url('options-general.php?page=installer');
241
+ }
242
+ }else{
243
+ $url = admin_url('plugin-install.php?tab=commercial');
244
+ }
245
+ return $url;
246
+ }
247
+
248
+ private function menu_multisite_redirect(){
249
+ global $pagenow;
250
+
251
+ if($pagenow == 'plugin-install.php' && isset($_GET['tab']) && $_GET['tab'] == 'commercial'){
252
+ wp_redirect($this->menu_url());
253
+ exit;
254
+ }
255
+
256
+ }
257
+
258
+ private function _pre_1_0_clean_up(){
259
+ global $wpdb;
260
+
261
+ if(!defined('WPRC_VERSION')){
262
+ $old_tables = array(
263
+ $wpdb->prefix . 'wprc_cached_requests',
264
+ $wpdb->prefix . 'wprc_extension_types',
265
+ $wpdb->prefix . 'wprc_extensions',
266
+ $wpdb->prefix . 'wprc_repositories',
267
+ $wpdb->prefix . 'wprc_repositories_relationships',
268
+ );
269
+
270
+ foreach($old_tables as $table){
271
+ $wpdb->query(sprintf("DROP TABLE IF EXISTS %s", $table));
272
+ }
273
+
274
+ }
275
+
276
+ $this->settings['_pre_1_0_clean_up'] = true;
277
+ $this->save_settings();
278
+ }
279
+
280
+ public function setup_plugins_action_links(){
281
+
282
+ $plugins = get_plugins();
283
+
284
+ $repositories_plugins = array();
285
+
286
+ if( !empty($this->settings['repositories']) ) {
287
+
288
+ foreach ( $this->settings['repositories'] as $repository_id => $repository ) {
289
+
290
+ foreach ( $repository['data']['packages'] as $package ) {
291
+
292
+ foreach ( $package['products'] as $product ) {
293
+
294
+ foreach ( $product['plugins'] as $plugin_slug ) {
295
+
296
+ $download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
297
+
298
+ if ( !isset($repositories_plugins[$repository_id][$download['slug']]) ) {
299
+ $repositories_plugins[$repository_id][$download['slug']] = array(
300
+ 'name' => $download['name'],
301
+ 'registered' => $this->plugin_is_registered( $repository_id, $download['slug'] ) ? 1 : 0
302
+ );
303
+ }
304
+
305
+ }
306
+
307
+ }
308
+
309
+ }
310
+
311
+ foreach ( $plugins as $plugin_id => $plugin ) {
312
+
313
+ $wp_plugin_slug = dirname( $plugin_id );
314
+ if ( empty($wp_plugin_slug) ) {
315
+ $wp_plugin_slug = basename( $plugin_id, '.php' );
316
+ }
317
+
318
+ foreach ( $repositories_plugins as $repository_id => $r_plugins ) {
319
+
320
+ foreach ( $r_plugins as $slug => $r_plugin ) {
321
+
322
+ if ( $wp_plugin_slug == $slug || $r_plugin['name'] == $plugin['Name'] || $r_plugin['name'] == $plugin['Title'] ) { //match order: slug, name, title
323
+
324
+ if ( $r_plugin['registered'] ) {
325
+ add_filter( 'plugin_action_links_' . $plugin_id, array($this, 'plugins_action_links_registered') );
326
+ } else {
327
+ add_filter( 'plugin_action_links_' . $plugin_id, array($this, 'plugins_action_links_not_registered') );
328
+ }
329
+
330
+ }
331
+
332
+ }
333
+
334
+ }
335
+
336
+
337
+ }
338
+
339
+ }
340
+ }
341
+
342
+ }
343
+
344
+ public function plugins_action_links_registered($links){
345
+ $links[] = '<a href="' . $this->menu_url() . '">' . __('Registered', 'installer') . '</a>';
346
+ return $links;
347
+ }
348
+
349
+ public function plugins_action_links_not_registered($links){
350
+ $links[] = '<a href="' . $this->menu_url() . '">' . __('Register', 'installer') . '</a>';
351
+ return $links;
352
+ }
353
+
354
+ public function plugin_is_registered($repository_id, $slug){
355
+
356
+ $registered = false;
357
+
358
+ if( $this->repository_has_valid_subscription($repository_id) ){
359
+
360
+ $subscription_type = $this->get_subscription_type_for_repository($repository_id);
361
+ $r_plugins = array();
362
+
363
+ foreach($this->settings['repositories'][$repository_id]['data']['packages'] as $package){
364
+
365
+ foreach($package['products'] as $product){
366
+
367
+ if( $product['subscription_type'] == $subscription_type || $this->have_superior_subscription($subscription_type, $product) ) {
368
+
369
+ foreach ($product['plugins'] as $plugin_slug) {
370
+
371
+ $download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
372
+
373
+ if (!isset($rep_plugins[$download['slug']])) {
374
+ $r_plugins[$download['slug']] = $download['slug'];
375
+ }
376
+
377
+ }
378
+
379
+ }
380
+
381
+ }
382
+
383
+ }
384
+
385
+ $registered = isset($r_plugins[$slug]);
386
+
387
+ }
388
+
389
+
390
+ return $registered;
391
+
392
+ }
393
+
394
+ public function version(){
395
+ return WP_INSTALLER_VERSION;
396
+ }
397
+
398
+ public function plugin_path() {
399
+ return untrailingslashit( plugin_dir_path( dirname(__FILE__) ) );
400
+ }
401
+
402
+ public function plugin_url() {
403
+ if(isset($this->config['in_theme_folder']) && !empty($this->config['in_theme_folder'])){
404
+ $url = untrailingslashit(get_template_directory_uri() . '/' . $this->config['in_theme_folder']);
405
+ }else{
406
+ $url = untrailingslashit( plugins_url( '/', dirname(__FILE__) ) );
407
+ }
408
+
409
+ return $url;
410
+ }
411
+
412
+ public function is_repositories_page(){
413
+ global $pagenow;
414
+
415
+ return $pagenow == 'plugin-install.php' && isset($_GET['tab']) && $_GET['tab'] == 'commercial';
416
+ }
417
+
418
+ public function res_url(){
419
+ if(isset($this->config['in_theme_folder']) && !empty($this->config['in_theme_folder'])){
420
+ $url = untrailingslashit(get_template_directory_uri() . '/' . $this->config['in_theme_folder']);
421
+ }else{
422
+ $url = $this->plugin_url();
423
+ }
424
+ return $url;
425
+ }
426
+
427
+ public function save_settings(){
428
+
429
+ $_settings = serialize($this->settings);
430
+ if($this->_gz_on){
431
+ $_settings = gzcompress($_settings);
432
+ }
433
+ $_settings = base64_encode($_settings);
434
+
435
+ update_option( 'wp_installer_settings', $_settings );
436
+
437
+ if( is_multisite() && is_main_site() && isset($this->settings['repositories']) ){
438
+ $network_settings = array();
439
+
440
+ foreach( $this->settings['repositories'] as $rep_id => $repository ){
441
+ if( isset($repository['subscription']) )
442
+ $network_settings[$rep_id] = $repository['subscription'];
443
+ }
444
+
445
+ update_site_option( 'wp_installer_network', $network_settings );
446
+
447
+
448
+ }
449
+
450
+ }
451
+
452
+ public function get_settings($refresh = false){
453
+
454
+ if($refresh || empty($this->settings)){
455
+
456
+ $_settings = get_option('wp_installer_settings');
457
+
458
+
459
+ if (is_array($_settings) || empty($_settings)) { //backward compatibility 1.1
460
+ $this->settings = $_settings;
461
+
462
+ } else {
463
+ $_settings = base64_decode($_settings);
464
+ if ($this->_gz_on) {
465
+ $_settings = gzuncompress($_settings);
466
+ }
467
+ $this->settings = unserialize($_settings);
468
+ }
469
+
470
+ if (is_multisite() && isset($this->settings['repositories'])) {
471
+ $network_settings = maybe_unserialize(get_site_option('wp_installer_network'));
472
+ if ($network_settings) {
473
+ foreach ($this->settings['repositories'] as $rep_id => $repository) {
474
+ if (isset($network_settings[$rep_id])) {
475
+ $this->settings['repositories'][$rep_id]['subscription'] = $network_settings[$rep_id];
476
+ }
477
+ }
478
+ }
479
+ }
480
+
481
+ $this->load_hardcoded_site_keys();
482
+
483
+ $this->settings = $this->_pre_1_6_backwards_compatibility($this->settings);
484
+
485
+ $this->settings = $this->_old_products_format_backwards_compatibility($this->settings);
486
+
487
+ }
488
+
489
+ return $this->settings;
490
+ }
491
+
492
+ private function load_hardcoded_site_keys(){
493
+
494
+ if( !empty( $this->settings['repositories'] ) ) {
495
+ foreach ( $this->settings['repositories'] as $repository_id => $repository ) {
496
+
497
+ if ( $site_key = self::get_repository_hardcoded_site_key( $repository_id ) ) {
498
+
499
+ $site_key_missing = empty($this->settings['repositories'][$repository_id]['subscription']['data']);
500
+ $site_key_changed = !$site_key_missing &&
501
+ $this->settings['repositories'][$repository_id]['subscription']['key'] != $site_key;
502
+
503
+ if ( $site_key_missing || $site_key_changed ) {
504
+
505
+ if ( !function_exists( 'get_plugins' ) ) {
506
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
507
+ }
508
+ $this->load_repositories_list();
509
+ $response = $this->save_site_key(
510
+ array(
511
+ 'repository_id' => $repository_id,
512
+ 'site_key' => $site_key,
513
+ 'return' => true,
514
+ 'nonce' => wp_create_nonce( 'save_site_key_' . $repository_id )
515
+ )
516
+ );
517
+
518
+ if ( !empty($response['error']) ) {
519
+ $this->remove_site_key( $repository_id );
520
+
521
+ $this->admin_messages[] = array(
522
+ 'type' => 'error',
523
+ 'text' => sprintf( __( 'You are using an invalid site key defined as the constant %s (most likely in wp-config.php).
524
+ Please remove it or use the correct value in order to be able to register correctly.', 'installer' ), 'OTGS_INSTALLER_SITE_KEY_' . strtoupper( $repository_id ) )
525
+ );
526
+
527
+ }
528
+
529
+ }
530
+
531
+ }
532
+
533
+ }
534
+ }
535
+
536
+ }
537
+
538
+ public static function get_repository_hardcoded_site_key( $repository_id ){
539
+
540
+ $site_key = false;
541
+
542
+ $site_key_constant = 'OTGS_INSTALLER_SITE_KEY_' . strtoupper( $repository_id );
543
+ if( defined( $site_key_constant ) ){
544
+ $site_key = constant( $site_key_constant );
545
+ }
546
+
547
+ return $site_key;
548
+ }
549
+
550
+ //backward compatibility, will remove 'basename' in version 1.8
551
+ private function _pre_1_6_backwards_compatibility($settings){
552
+
553
+ if( version_compare($this->version(), '1.8', '<') && !empty($settings['repositories']) ){
554
+
555
+ foreach ($settings['repositories'] as $repository_id => $repository) {
556
+
557
+ foreach ($repository['data']['downloads']['plugins'] as $slug => $download) {
558
+
559
+ $settings['repositories'][$repository_id]['data']['downloads']['plugins'][$slug]['slug'] = $download['basename'];
560
+
561
+ }
562
+ }
563
+
564
+ }
565
+
566
+ return $settings;
567
+
568
+ }
569
+
570
+ //backward compatibility - support old products list format (downloads under products instead of global downloads list)
571
+ private function _old_products_format_backwards_compatibility($settings){
572
+
573
+ if( version_compare($this->version(), '1.8', '<') && !empty($settings['repositories']) && empty($this->_old_products_format_backwards_compatibility) ) {
574
+
575
+ foreach ($settings['repositories'] as $repository_id => $repository) {
576
+
577
+ $populate_downloads = false;
578
+
579
+ foreach ($repository['data']['packages'] as $package_id => $package) {
580
+
581
+ foreach ($package['products'] as $product_id => $product) {
582
+
583
+ if (!isset($product['plugins'])) {
584
+
585
+ $populate_downloads = true;
586
+
587
+ foreach ($product['downloads'] as $download_id => $download) {
588
+
589
+ $settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['plugins'][] = $download['slug'];
590
+
591
+ }
592
+
593
+ }
594
+
595
+ }
596
+
597
+ }
598
+
599
+ if ($populate_downloads) {
600
+
601
+ // Add downloads branch
602
+ foreach ($repository['data']['packages'] as $package_id => $package) {
603
+
604
+ foreach ($package['products'] as $product_id => $product) {
605
+
606
+ foreach ($product['downloads'] as $download_id => $download) {
607
+
608
+ if (!isset($settings['repositories'][$repository_id]['data']['downloads']['plugins'][$download['slug']])) {
609
+ $settings['repositories'][$repository_id]['data']['downloads']['plugins'][$download['slug']] = $download;
610
+ }
611
+
612
+ $settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['plugins'][] = $download['slug'];
613
+ }
614
+
615
+ unset($settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['downloads']);
616
+
617
+ }
618
+
619
+ }
620
+
621
+ }
622
+
623
+ }
624
+
625
+ $this->_old_products_format_backwards_compatibility = true;
626
+
627
+ }
628
+
629
+ return $settings;
630
+
631
+ }
632
+
633
+ public function get_installer_site_url( $repository_id = false ){
634
+ global $current_site;
635
+
636
+ $site_url = get_site_url();
637
+
638
+ if( $repository_id && is_multisite() && isset( $this->settings['repositories'] ) ){
639
+ $network_settings = maybe_unserialize( get_site_option('wp_installer_network') );
640
+
641
+ if ( isset( $network_settings[$repository_id] ) ) {
642
+ $site_url = get_site_url( $current_site->blog_id );
643
+ }
644
+
645
+ }
646
+
647
+ return $site_url;
648
+ }
649
+
650
+ public function show_site_key_nags(){
651
+ $screen = get_current_screen();
652
+
653
+ if($screen->base == 'settings_page_installer' || ($screen->base == 'plugin-install' && isset($_GET['tab']) && $_GET['tab'] == 'commercial')){
654
+ return;
655
+ }
656
+
657
+ if(!empty($this->config['site_key_nags'])){
658
+
659
+ foreach($this->config['site_key_nags'] as $nag){
660
+
661
+ if(!$this->repository_has_subscription($nag['repository_id'] )){
662
+ $show = true;
663
+ if(!empty($nag['condition_cb'])){
664
+ $show = call_user_func($nag['condition_cb']);
665
+ }
666
+
667
+ if(empty($this->settings['dismissed_nags'][$nag['repository_id']]) && $show){
668
+ echo '<div class="updated error otgs-is-dismissible"><p>';
669
+ printf(__("To get automatic updates, you need to register %s for this site. %sRegister %s%s", 'sitepress'),
670
+ $nag['product_name'], '<a class="button-primary" href="' . $this->menu_url() . '">', $nag['product_name'], '</a>');
671
+
672
+ echo '</p>';
673
+ echo '<span class="installer-dismiss-nag notice-dismiss" data-repository="' . $nag['repository_id'] . '"><span class="screen-reader-text">' . __('Dismiss', 'sitepress') . '</span></span>';
674
+ echo '</div>';
675
+ }
676
+ }
677
+
678
+ }
679
+
680
+ }
681
+
682
+ }
683
+
684
+ public function dismiss_nag(){
685
+ $this->settings['dismissed_nags'][$_POST['repository']] = 1;
686
+
687
+ $this->save_settings();
688
+
689
+ echo json_encode(array());
690
+ exit;
691
+ }
692
+
693
+ public function add_install_plugins_tab($tabs){
694
+
695
+ $tabs['commercial'] = __('Commercial', 'installer');
696
+
697
+ return $tabs;
698
+ }
699
+
700
+ public function load_repositories_list(){
701
+ global $wp_installer_instances;
702
+
703
+ foreach ($wp_installer_instances as $instance) {
704
+
705
+ if (file_exists(dirname($instance['bootfile']) . '/repositories.xml')) {
706
+ $config_file = dirname($instance['bootfile']) . '/repositories.xml';
707
+
708
+ if (file_exists(dirname($instance['bootfile']) . '/repositories.sandbox.xml')) {
709
+ $config_file = dirname($instance['bootfile']) . '/repositories.sandbox.xml';
710
+ add_filter('https_ssl_verify', '__return_false');
711
+ }
712
+
713
+ $repos = simplexml_load_file($config_file);
714
+
715
+ if($repos) {
716
+ foreach ($repos as $repo) {
717
+ $id = strval($repo->id);
718
+
719
+ $data['api-url'] = strval($repo->apiurl);
720
+ $data['products'] = strval($repo->products);
721
+
722
+ // excludes rule;
723
+ if (isset($this->config['repositories_exclude']) && in_array($id, $this->config['repositories_exclude'])) {
724
+ continue;
725
+ }
726
+
727
+ // includes rule;
728
+ if (isset($this->config['repositories_include']) && !in_array($id, $this->config['repositories_include'])) {
729
+ continue;
730
+ }
731
+
732
+ $this->repositories[$id] = $data;
733
+
734
+ }
735
+ }
736
+
737
+ }
738
+ }
739
+
740
+ }
741
+
742
+ public function filter_repositories_list(){
743
+
744
+ if(!empty($this->settings['repositories'])) {
745
+ foreach ($this->settings['repositories'] as $id => $repo_data) {
746
+
747
+ // excludes rule;
748
+ if (isset($this->config['repositories_exclude']) && in_array($id, $this->config['repositories_exclude'])) {
749
+ unset($this->settings['repositories'][$id]);
750
+ }
751
+
752
+ // includes rule;
753
+ if (isset($this->config['repositories_include']) && !in_array($id, $this->config['repositories_include'])) {
754
+ unset($this->settings['repositories'][$id]);
755
+ }
756
+
757
+
758
+ }
759
+ }
760
+
761
+
762
+ }
763
+
764
+ public function refresh_repositories_data(){
765
+ static $checked = false;
766
+
767
+ if( defined('OTGS_DISABLE_AUTO_UPDATES') && OTGS_DISABLE_AUTO_UPDATES && empty($_GET['force-check']) || $checked ){
768
+
769
+ if(empty($this->settings['repositories']) && $this->is_repositories_page()){
770
+
771
+ foreach($this->repositories as $id => $data) {
772
+ $repository_names[] = $id;
773
+
774
+ }
775
+
776
+ $error = sprintf(__("Installer cannot display the products information because the automatic updating for %s was explicitly disabled with the configuration below (usually in wp-config.php):", 'installer'), strtoupper( join(', ', $repository_names) ));
777
+ $error .= '<br /><br /><code>define("OTGS_DISABLE_AUTO_UPDATES", true);</code><br /><br />';
778
+ $error .= sprintf(__("In order to see the products information, please run the %smanual updates check%s to initialize the products list or (temporarily) remove the above code.", 'installer'), '<a href="' . admin_url('update-core.php') . '">', '</a>');
779
+
780
+ $this->register_admin_message($error, 'error');
781
+
782
+
783
+ }
784
+
785
+ return;
786
+ }
787
+
788
+ $checked = true;
789
+
790
+ foreach($this->repositories as $id => $data){
791
+
792
+ $response = wp_remote_get($data['products']);
793
+
794
+ if(is_wp_error($response)){
795
+ // http fallback
796
+ $data['products'] = preg_replace("@^https://@", 'http://', $data['products']);
797
+ $response = wp_remote_get($data['products']);
798
+ }
799
+
800
+ if(is_wp_error($response)){
801
+
802
+ $error = sprintf(__("Installer cannot contact our updates server to get information about the available products and check for new versions. If you are seeing this message for the first time, you can ignore it, as it may be a temporary communication problem. If the problem persists and your WordPress admin is slowing down, you can disable automated version checks. Add the following line to your wp-config.php file:", 'installer'), strtoupper($id));
803
+ $error .= '<br /><br /><code>define("OTGS_DISABLE_AUTO_UPDATES", true);</code>';
804
+
805
+ $this->register_admin_message($error, 'error');
806
+
807
+ continue;
808
+ }
809
+
810
+ if($response && isset($response['response']['code']) && $response['response']['code'] == 200){
811
+ $body = wp_remote_retrieve_body($response);
812
+ if($body){
813
+ $products = json_decode($body, true);
814
+
815
+ if(is_array($products)){
816
+ $this->settings['repositories'][$id]['data'] = $products;
817
+ $this->settings = $this->_pre_1_6_backwards_compatibility($this->settings);
818
+ }
819
+ }
820
+
821
+ }
822
+
823
+ $this->log( sprintf("Checked for %s updates: %s", $id, $data['products']) );
824
+
825
+
826
+ }
827
+
828
+ // cleanup
829
+ if(empty($this->settings['repositories'])){
830
+ $this->settings['repositories'] = array();
831
+ }
832
+ foreach($this->settings['repositories'] as $id => $data){
833
+ if(!in_array($id, array_keys($this->repositories))){
834
+ unset($this->settings['repositories'][$id]);
835
+ }
836
+ }
837
+
838
+ $this->settings['last_repositories_update']= time();
839
+
840
+ $this->save_settings();
841
+
842
+ }
843
+
844
+ public function show_products($args = array()){
845
+
846
+ $screen = get_current_screen();
847
+
848
+ if($screen->base == 'settings_page_installer'){ // settings page
849
+ echo '<div class="wrap">';
850
+ echo '<h2>' . __('Installer', 'installer') . '</h2>';
851
+ echo '<br />';
852
+ }
853
+
854
+ if(!is_array($args)) $args = array();
855
+ if(empty($args['template'])) $args['template'] = 'default';
856
+
857
+ $this->filter_repositories_list();
858
+
859
+ if(!empty($this->settings['repositories'])){
860
+
861
+ $this->localize_strings();
862
+ $this->set_filtered_prices($args);
863
+ $this->set_hierarchy_and_order();
864
+
865
+ foreach($this->settings['repositories'] as $repository_id => $repository){
866
+
867
+ if($args['template'] == 'compact'){
868
+
869
+ if(isset($args['repository']) && $args['repository'] == $repository_id){
870
+ include $this->plugin_path() . '/templates/products-compact.php';
871
+ }
872
+
873
+ }else{
874
+
875
+ include $this->plugin_path() . '/templates/repository-listing.php';
876
+
877
+ }
878
+
879
+ unset($site_key, $subscription_type, $expired, $upgrade_options, $products_avaliable);
880
+
881
+ }
882
+
883
+ }else{
884
+
885
+ echo '<center>' . __('No repositories defined.', 'installer') . '</center>';
886
+
887
+ }
888
+
889
+ if($screen->base == 'settings_page_installer'){ // settings page
890
+ echo '</div>';
891
+ }
892
+
893
+
894
+ }
895
+
896
+ public function get_product_price($repository_id, $package_id, $product_id, $incl_discount = false){
897
+
898
+ $price = false;
899
+
900
+ foreach($this->settings['repositories'][$repository_id]['data']['packages'] as $package ){
901
+
902
+ if($package['id'] == $package_id){
903
+ if(isset($package['products'][$product_id])){
904
+ if($incl_discount && isset($package['products'][$product_id]['price_disc'])){
905
+ $price = $package['products'][$product_id]['price_disc'];
906
+ }elseif(isset($package['products'][$product_id]['price'])){
907
+ $price = $package['products'][$product_id]['price'];
908
+ }
909
+ }
910
+ break;
911
+ }
912
+ }
913
+
914
+ return $price;
915
+ }
916
+
917
+ private function _render_product_packages($packages, $subscription_type, $expired, $upgrade_options, $repository_id){
918
+
919
+ $data = array();
920
+
921
+ foreach($packages as $package_id => $package){
922
+
923
+ $row = array('products' => array(), 'downloads' => array());
924
+ foreach($package['products'] as $product){
925
+
926
+ // filter out free subscriptions from being displayed as buying options
927
+ if( empty($product['price']) && (empty($subscription_type) || $expired) ){
928
+ continue;
929
+ }
930
+
931
+ //consider equivalent subscriptions
932
+ if( empty($product['subscription_type_equivalent'])){
933
+ $product['subscription_type_equivalent'] = '';
934
+ }
935
+
936
+ // buy base
937
+ if(empty($subscription_type) || $expired) {
938
+
939
+ $p['url'] = $this->append_parameters_to_buy_url($product['url'], $repository_id);
940
+ if (!empty($product['price_disc'])) {
941
+ $p['label'] = $product['call2action'] . ' - ' . sprintf('$%s %s$%d%s (USD)', $product['price_disc'], '&nbsp;&nbsp;<del>', $product['price'], '</del>');
942
+ } else {
943
+ $p['label'] = $product['call2action'] . ' - ' . sprintf('$%d (USD)', $product['price']);
944
+ }
945
+ $row['products'][] = $p;
946
+
947
+ // renew
948
+ } elseif(isset($subscription_type) && ($product['subscription_type'] == $subscription_type || $product['subscription_type_equivalent'] == $subscription_type)){
949
+
950
+ if($product['renewals']) {
951
+ foreach ($product['renewals'] as $renewal) {
952
+ $p['url'] = $this->append_parameters_to_buy_url($renewal['url'], $repository_id);
953
+ $p['label'] = $renewal['call2action'] . ' - ' . sprintf('$%d (USD)', $renewal['price']);
954
+ }
955
+
956
+ $row['products'][] = $p;
957
+ }
958
+
959
+ }
960
+
961
+ // upgrades
962
+ if(!empty($upgrade_options[$product['subscription_type']])){
963
+
964
+ foreach($upgrade_options[$product['subscription_type']] as $stype => $upgrade){
965
+ if($stype != $subscription_type) continue;
966
+
967
+ $p['url'] = $this->append_parameters_to_buy_url($upgrade['url'], $repository_id);
968
+ if (!empty($upgrade['price_disc'])) {
969
+ $p['label'] = $upgrade['call2action'] . ' - ' . sprintf('$%s %s$%d%s (USD)', $upgrade['price_disc'], '&nbsp;&nbsp;<del>', $upgrade['price'], '</del>');
970
+ } else {
971
+ $p['label'] = $upgrade['call2action'] . ' - ' . sprintf('$%d (USD)', $upgrade['price']);
972
+ }
973
+ $row['products'][] = $p;
974
+
975
+ }
976
+
977
+ }
978
+
979
+ // downloads
980
+ if(isset($subscription_type) && !$expired && ($product['subscription_type'] == $subscription_type || $product['subscription_type_equivalent'] == $subscription_type)){
981
+ foreach($product['plugins'] as $plugin_slug){
982
+
983
+ $row['downloads'][] = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
984
+
985
+ }
986
+
987
+ }
988
+
989
+ //subpackages
990
+ if(!empty($package['sub-packages'])){
991
+ $row['sub-packages'] = $package['sub-packages'];
992
+ }
993
+
994
+ }
995
+
996
+ $row['id'] = $package['id'];
997
+ $row['image_url'] = $package['image_url'];
998
+ $row['name'] = $package['name'];
999
+ $row['description'] = $package['description'];
1000
+
1001
+ if(!empty($row['products']) || !empty($row['downloads']) || !empty($row['sub-packages'])){
1002
+ $data[] = $row;
1003
+ }
1004
+
1005
+
1006
+ }
1007
+
1008
+ return $data;
1009
+
1010
+ }
1011
+
1012
+ public function get_extra_url_parameters(){
1013
+
1014
+ $parameters = array();
1015
+
1016
+ if(!empty($this->package_source)){
1017
+ foreach($this->package_source as $key => $val){
1018
+ $parameters[$key] = $val;
1019
+ }
1020
+ }
1021
+
1022
+ $parameters['installer_version'] = WP_INSTALLER_VERSION;
1023
+ $parameters['theme'] = wp_get_theme()->get( 'Name' );
1024
+ $parameters['site_name'] = get_bloginfo( 'name' );
1025
+
1026
+ return $parameters;
1027
+ }
1028
+
1029
+ public function append_parameters_to_buy_url($url, $repository_id, $args = array()){
1030
+
1031
+ $url = add_query_arg( array('icl_site_url' => $this->get_installer_site_url( $repository_id ) ), $url );
1032
+
1033
+ $affiliate_id = false;
1034
+ $affiliate_key = false;
1035
+
1036
+ // Add extra parameters for custom Installer packages
1037
+ if( !empty($this->package_source) ){
1038
+ $extra = $this->get_extra_url_parameters();
1039
+
1040
+ if( !empty($extra['repository']) && $extra['repository'] == $repository_id ) {
1041
+
1042
+ if( !empty($extra['affiliate_key']) && !empty($extra['user_id']) ){
1043
+ $this->config['affiliate_id:' . $repository_id] = $extra['user_id'];
1044
+ $this->config['affiliate_key:' . $repository_id] = $extra['affiliate_key'];
1045
+ unset($extra['affiliate_key'], $extra['user_id'], $extra['repository']); // no need to include these ones
1046
+ }
1047
+
1048
+ $url = add_query_arg($extra, $url);
1049
+ }
1050
+
1051
+ }
1052
+
1053
+ if(isset($this->config['affiliate_id:' . $repository_id]) && isset($this->config['affiliate_key:' . $repository_id])){
1054
+
1055
+ $affiliate_id = $this->config['affiliate_id:' . $repository_id];
1056
+ $affiliate_key = $this->config['affiliate_key:' . $repository_id];
1057
+
1058
+ }elseif(isset($args['affiliate_id:' . $repository_id]) && isset($args['affiliate_key:' . $repository_id])){
1059
+
1060
+ $affiliate_id = $args['affiliate_id:' . $repository_id];
1061
+ $affiliate_key = $args['affiliate_key:' . $repository_id];
1062
+
1063
+ }elseif(defined('ICL_AFFILIATE_ID') && defined('ICL_AFFILIATE_KEY')){ //support for 1 repo
1064
+
1065
+ $affiliate_id = ICL_AFFILIATE_ID;
1066
+ $affiliate_key = ICL_AFFILIATE_KEY;
1067
+
1068
+ }elseif(isset($this->config['affiliate_id']) && isset($this->config['affiliate_key'])) {
1069
+ // BACKWARDS COMPATIBILITY
1070
+ $affiliate_id = $this->config['affiliate_id'];
1071
+ $affiliate_key = $this->config['affiliate_key'];
1072
+ }
1073
+
1074
+ if($affiliate_id && $affiliate_key){
1075
+ $url = add_query_arg(array('aid' => $affiliate_id, 'affiliate_key' => $affiliate_key), $url);
1076
+ }
1077
+
1078
+ if($repository_id == 'wpml'){
1079
+ $url = add_query_arg(array('using_icl' => $this->_using_icl, 'wpml_version' => $this->_wpml_version), $url);
1080
+ }
1081
+
1082
+ $url = apply_filters('wp_installer_buy_url', $url);
1083
+
1084
+ $url = esc_url($url);
1085
+
1086
+ return $url;
1087
+
1088
+ }
1089
+
1090
+ public function save_site_key($args = array()){
1091
+
1092
+ $error = '';
1093
+
1094
+ if( isset( $args['repository_id'] ) ){
1095
+ $repository_id = $args['repository_id'];
1096
+ }elseif( isset( $_POST['repository_id'] ) ){
1097
+ $repository_id = sanitize_text_field( $_POST['repository_id'] );
1098
+ }else{
1099
+ $repository_id = false;
1100
+ }
1101
+
1102
+ if( isset( $args['nonce'] ) ){
1103
+ $nonce = $args['nonce'];
1104
+ }elseif( isset($_POST['nonce'] ) ){
1105
+ $nonce = sanitize_text_field( $_POST['nonce'] );
1106
+ }else{
1107
+ $nonce = '';
1108
+ }
1109
+
1110
+ if( isset( $args['site_key'] ) ){
1111
+ $site_key = $args['site_key'];
1112
+ } else {
1113
+ $site_key = sanitize_text_field( $_POST[ 'site_key_' . $repository_id] );
1114
+ }
1115
+ $site_key = preg_replace("/[^A-Za-z0-9]/", '', $site_key);
1116
+
1117
+ if($repository_id && $nonce && wp_create_nonce('save_site_key_' . $repository_id) == $nonce){
1118
+
1119
+ try {
1120
+ $subscription_data = $this->fetch_subscription_data( $repository_id, $site_key, self::SITE_KEY_VALIDATION_SOURCE_REGISTRATION );
1121
+
1122
+ if ( $subscription_data ) {
1123
+ $this->settings['repositories'][$repository_id]['subscription'] = array('key' => $site_key, 'data' => $subscription_data);
1124
+ $this->save_settings();
1125
+ } else {
1126
+ $error = __( 'Invalid site key for the current site.', 'installer' )
1127
+ . '<br /><div class="installer-footnote">' . __('Please note that the site key is case sensitive.', 'installer') . '</div>';
1128
+ }
1129
+
1130
+ } catch (Exception $e ){
1131
+ $error = $e->getMessage();
1132
+ if( preg_match('#Could not resolve host: (.*)#', $error, $matches) || preg_match('#Couldn\'t resolve host \'(.*)\'#', $error, $matches) ){
1133
+ $error = sprintf(__("%s cannot access %s to register. Try again to see if it's a temporary problem. If the problem continues, make sure that this site has access to the Internet. You can still use the plugin without registration, but you will not receive automated updates.", 'installer'),
1134
+ '<strong><i>' . $this->get_generic_product_name($repository_id) . '</i></strong>',
1135
+ '<strong><i>' . $matches[1]. '</i></strong>'
1136
+ ) ;
1137
+ }
1138
+ }
1139
+
1140
+ }
1141
+
1142
+ $return = array('error' => $error);
1143
+
1144
+ if($this->api_debug){
1145
+ $return['debug'] = $this->api_debug;
1146
+ }
1147
+
1148
+ if(!empty($args['return'])){
1149
+ return $return;
1150
+ }else{
1151
+ echo json_encode($return);
1152
+ exit;
1153
+ }
1154
+
1155
+ }
1156
+
1157
+ /**
1158
+ * Alias for WP_Installer::get_repository_site_key
1159
+ * @see WP_Installer::get_repository_site_key()
1160
+ *
1161
+ * @param string $repository_id
1162
+ * @return string (site key) or bool
1163
+ */
1164
+ public function get_site_key($repository_id){
1165
+ return WP_Installer::get_repository_site_key( $repository_id );
1166
+ }
1167
+
1168
+ public function remove_site_key( $repository_id ){
1169
+ if( isset( $this->settings['repositories'][$repository_id] ) ){
1170
+ unset($this->settings['repositories'][$repository_id]['subscription']);
1171
+ $this->save_settings();
1172
+ $this->refresh_repositories_data();
1173
+ }
1174
+ }
1175
+
1176
+ public function remove_site_key_ajax(){
1177
+ if($_POST['nonce'] == wp_create_nonce('remove_site_key_' . $_POST['repository_id'])){
1178
+ $this->remove_site_key( $_POST['repository_id'] );
1179
+ }
1180
+ exit;
1181
+ }
1182
+
1183
+ public function validate_repository_subscription(){
1184
+ $repository_id = isset($_GET['validate_repository']) ? sanitize_text_field( $_GET['validate_repository'] ) : false;
1185
+ if($repository_id){
1186
+
1187
+ $site_key = $this->get_site_key($repository_id);
1188
+ if($site_key) {
1189
+ $subscription_data = $this->fetch_subscription_data( $repository_id, $site_key, self::SITE_KEY_VALIDATION_SOURCE_REVALIDATION);
1190
+ if(empty($subscription_data)){
1191
+ unset($this->settings['repositories'][$repository_id]['subscription']);
1192
+ delete_site_transient('update_plugins');
1193
+ $this->save_settings();
1194
+ }
1195
+ }
1196
+
1197
+ wp_redirect($this->menu_url() . '#repository-' . $repository_id);
1198
+ exit;
1199
+
1200
+ }
1201
+
1202
+ }
1203
+
1204
+ public function update_site_key(){
1205
+
1206
+ $error = '';
1207
+
1208
+ $repository_id = sanitize_text_field ( $_POST['repository_id'] );
1209
+ if($_POST['nonce'] == wp_create_nonce('update_site_key_' . $repository_id )){
1210
+
1211
+ $site_key = $this->get_site_key($_POST['repository_id']);
1212
+
1213
+ if($site_key){
1214
+ try {
1215
+ $subscription_data = $this->fetch_subscription_data( $repository_id, $site_key, self::SITE_KEY_VALIDATION_SOURCE_UPDATES_CHECK );
1216
+
1217
+ if ( $subscription_data ) {
1218
+ $this->settings['repositories'][$repository_id]['subscription'] = array('key' => $site_key, 'data' => $subscription_data);
1219
+
1220
+ //also refresh products information
1221
+ $this->refresh_repositories_data();
1222
+
1223
+ $this->save_settings();
1224
+
1225
+ } else {
1226
+ unset($this->settings['repositories'][$repository_id]['subscription']);
1227
+ $error = __( 'Invalid site key for the current site. If the error persists, try to unregister first and then register again with the same site key.', 'installer' );
1228
+ }
1229
+
1230
+
1231
+ } catch (Exception $e ){
1232
+ $error = $e->getMessage();
1233
+ if( preg_match('#Could not resolve host: (.*)#', $error, $matches) || preg_match('#Couldn\'t resolve host \'(.*)\'#', $error, $matches) ){
1234
+ $error = sprintf(__("%s cannot access %s to register. Try again to see if it's a temporary problem. If the problem continues, make sure that this site has access to the Internet. You can still use the plugin without registration, but you will not receive automated updates.", 'installer'),
1235
+ '<strong><i>' . $this->get_generic_product_name($repository_id) . '</i></strong>',
1236
+ '<strong><i>' . $matches[1]. '</i></strong>'
1237
+ ) ;
1238
+ }
1239
+ }
1240
+
1241
+ }
1242
+
1243
+ }
1244
+
1245
+ echo json_encode(array('error' => $error));
1246
+
1247
+ exit;
1248
+ }
1249
+
1250
+ public function api_debug_log($text){
1251
+
1252
+ if(defined('WPML_DEBUG_INSTALLER') && WPML_DEBUG_INSTALLER){
1253
+
1254
+ if(!is_scalar($text)){
1255
+ $text = print_r($text, 1);
1256
+ }
1257
+
1258
+ $this->api_debug .= $text . "\n";
1259
+
1260
+ }
1261
+
1262
+ }
1263
+
1264
+ public function fetch_subscription_data( $repository_id, $site_key, $source = self::SITE_KEY_VALIDATION_SOURCE_OTHER ){
1265
+
1266
+ $subscription_data = false;
1267
+
1268
+ $args['body'] = array(
1269
+ 'action' => 'site_key_validation',
1270
+ 'site_key' => $site_key,
1271
+ 'site_url' => $this->get_installer_site_url( $repository_id ),
1272
+ 'source' => $source
1273
+ );
1274
+
1275
+ if($repository_id == 'wpml'){
1276
+ $args['body']['using_icl'] = $this->_using_icl;
1277
+ $args['body']['wpml_version'] = $this->_wpml_version;
1278
+ }
1279
+
1280
+ $args['body']['installer_version'] = WP_INSTALLER_VERSION;
1281
+ $args['body']['theme'] = wp_get_theme()->get( 'Name' );
1282
+ $args['body']['site_name'] = get_bloginfo( 'name' );
1283
+
1284
+ $args['body']['versions'] = $this->get_local_product_versions( $repository_id );
1285
+
1286
+ $args['timeout'] = 45;
1287
+
1288
+ // Add extra parameters for custom Installer packages
1289
+ if( !empty($this->package_source) ){
1290
+ $extra = $this->get_extra_url_parameters();
1291
+ if( !empty($extra['repository']) && $extra['repository'] == $repository_id ) {
1292
+ unset($extra['repository']);
1293
+ foreach($extra as $key => $val){
1294
+ $args['body'][$key] = $val;
1295
+ }
1296
+ }
1297
+ }
1298
+
1299
+ $response = wp_remote_post($this->repositories[$repository_id]['api-url'], $args);
1300
+
1301
+ $this->api_debug_log("POST {$this->repositories[$repository_id]['api-url']}");
1302
+ $this->api_debug_log($args);
1303
+
1304
+ $this->log("POST {$this->repositories[$repository_id]['api-url']} - fetch subscription data");
1305
+
1306
+ if( !is_wp_error($response) ){
1307
+ $datas = wp_remote_retrieve_body($response);
1308
+
1309
+ if(is_serialized($datas)){
1310
+ $data = unserialize($datas);
1311
+ $this->api_debug_log($data);
1312
+
1313
+ if( !empty( $data->subscription_data ) ){
1314
+ $subscription_data = $data->subscription_data;
1315
+ }
1316
+
1317
+ do_action( 'installer_fetched_subscription_data', $data, $repository_id);
1318
+
1319
+ }else{
1320
+ $this->api_debug_log($datas);
1321
+ }
1322
+
1323
+ }else{
1324
+
1325
+ $this->api_debug_log($response);
1326
+ throw new Exception( $response->get_error_message() );
1327
+ }
1328
+
1329
+ return $subscription_data;
1330
+
1331
+ }
1332
+
1333
+ function get_local_product_versions( $repository_id ){
1334
+
1335
+ $versions = array();
1336
+
1337
+ foreach( $this->settings['repositories'][$repository_id]['data']['packages'] as $package_id => $package ){
1338
+
1339
+ foreach( $package['products'] as $product_id => $product ){
1340
+
1341
+ foreach( $product['plugins'] as $plugin_slug ){
1342
+
1343
+ $download = $this->settings['repositories'][$repository_id]['data']['downloads']['plugins'][$plugin_slug];
1344
+
1345
+ if( empty( $versions[$download['slug']] ) ) {
1346
+ $v = $this->get_plugin_installed_version($download['name'], $download['slug']);
1347
+ if($v){
1348
+ $versions[$download['slug']] = $v;
1349
+ }
1350
+ }
1351
+
1352
+ }
1353
+
1354
+ }
1355
+
1356
+ }
1357
+
1358
+ return $versions;
1359
+ }
1360
+
1361
+ public function get_repository_site_key($repository_id){
1362
+ $site_key = false;
1363
+
1364
+ if(!empty($this->settings['repositories'][$repository_id]['subscription']['key'])){
1365
+ $site_key = $this->settings['repositories'][$repository_id]['subscription']['key'];
1366
+ }
1367
+
1368
+ return $site_key;
1369
+ }
1370
+
1371
+ public function repository_has_valid_subscription($repository_id){
1372
+
1373
+ $valid = false;
1374
+
1375
+ if(!empty($this->settings['repositories'][$repository_id]['subscription'])){
1376
+
1377
+ $subscription = $this->settings['repositories'][$repository_id]['subscription']['data'];
1378
+ $valid = ( $subscription->status == 1 && (strtotime($subscription->expires) > time() || empty($subscription->expires)) ) || $subscription->status == 4;
1379
+
1380
+ }
1381
+ return $valid;
1382
+
1383
+ }
1384
+
1385
+ public function repository_has_subscription($repository_id){
1386
+ $key = false;
1387
+ if(!empty($this->settings['repositories'][$repository_id]['subscription']['key'])){
1388
+ $key = $this->settings['repositories'][$repository_id]['subscription']['key'];
1389
+ }
1390
+
1391
+ return $key;
1392
+
1393
+ }
1394
+
1395
+ public function repository_has_expired_subscription($repository_id){
1396
+
1397
+ return $this->repository_has_subscription($repository_id) && !$this->repository_has_valid_subscription($repository_id);
1398
+
1399
+ }
1400
+
1401
+ public function get_generic_product_name($repository_id){
1402
+
1403
+ return $this->settings['repositories'][$repository_id]['data']['product-name'];
1404
+
1405
+ }
1406
+
1407
+ public function show_subscription_renew_warning($repository_id, $subscription_id){
1408
+
1409
+ $show = false;
1410
+
1411
+ $data = $this->settings['repositories'][$repository_id]['data'];
1412
+ if(!empty($data['subscriptions_meta'])){
1413
+ if(isset($data['subscriptions_meta']['expiration'])){
1414
+
1415
+ if(!empty($data['subscriptions_meta']['expiration'][$subscription_id])){
1416
+
1417
+ $days = $data['subscriptions_meta']['expiration'][$subscription_id]['days_warning'];
1418
+ $message = $data['subscriptions_meta']['expiration'][$subscription_id]['warning_message'];
1419
+
1420
+ }else{
1421
+
1422
+ //defaults
1423
+ $days = 30;
1424
+ $message = __('You will have to renew your subscription in order to continue getting the updates and support.', 'installer');
1425
+
1426
+ }
1427
+
1428
+ if(!empty($this->settings['repositories'][$repository_id]['subscription'])){
1429
+ $subscription = $this->settings['repositories'][$repository_id]['subscription'];
1430
+
1431
+ if($subscription['data']->subscription_type == $subscription_id && !empty($subscription['data']->expires)){
1432
+
1433
+ if(strtotime($subscription['data']->expires) < strtotime(sprintf("+%d day", $days))){
1434
+
1435
+ $days_to_expiration = ceil((strtotime($subscription['data']->expires) - time()) / 86400);
1436
+
1437
+ echo '<div><p class="installer-warn-box">' .
1438
+ sprintf(_n('Your subscription expires in %d day.', 'Your subscription expires in %d days.', $days_to_expiration, 'installer'), $days_to_expiration) .
1439
+ '<br />' . $message .
1440
+ '</p></div>';
1441
+
1442
+ $show = true;
1443
+
1444
+ }
1445
+
1446
+ }
1447
+
1448
+ }
1449
+
1450
+
1451
+ }
1452
+ }
1453
+
1454
+
1455
+ return $show;
1456
+
1457
+ }
1458
+
1459
+ public function setup_plugins_renew_warnings(){
1460
+
1461
+ $plugins = get_plugins();
1462
+
1463
+ $subscriptions_with_warnings = array();
1464
+ foreach($this->settings['repositories'] as $repository_id => $repository){
1465
+
1466
+ if($this->repository_