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 4.7.6 4.7.7 4.7.8 4.7.9 4.8.0 4.9.0 4.9.1 5.0.1 5.0.2 5.1.1 5.1.2 5.1.3 5.2.0 5.2.1 5.3.2 5.3.3.1 5.3.4 5.3.5 5.3.6 5.3.7
woocommerce-multilingual / inc / template-classes / class-wcml-settings-ui.php
woocommerce-multilingual / inc / template-classes Last commit date
currency-switcher 3 weeks ago multi-currency 3 weeks ago setup 3 weeks ago status 3 weeks ago store-urls 3 weeks ago class-wcml-currencies-dropdown-ui.php 5 years ago class-wcml-custom-files-ui.php 3 weeks ago class-wcml-languages-upgrade-notice.php 4 years ago class-wcml-menus-wrap-base.php 3 weeks ago class-wcml-menus-wrap.php 3 weeks ago class-wcml-multilingual-ui.php 9 months ago class-wcml-not-translatable-attributes.php 3 weeks ago class-wcml-pointer-ui.php 1 year ago class-wcml-removed-cart-items-ui.php 3 weeks ago class-wcml-settings-ui.php 3 weeks ago class-wcml-st-taxonomy-ui.php 11 months ago class-wcml-sync-taxonomy.php 3 weeks ago class-wcml-templates-factory.php 3 weeks ago class-wcml-troubleshooting-ui.php 3 weeks ago
class-wcml-settings-ui.php
166 lines
1 <?php
2
3 use WPML\Core\Twig_SimpleFunction;
4
5 class WCML_Settings_UI extends WCML_Templates_Factory {
6
7 private $woocommerce_wpml;
8 private $sitepress;
9
10 public function __construct( woocommerce_wpml $woocommerce_wpml, \WPML\Core\ISitePress $sitepress ) {
11
12 $functions = [
13 new Twig_SimpleFunction( 'wp_do_action', [ $this, 'wp_do_action' ] ),
14 ];
15
16 parent::__construct( $functions );
17
18 $this->woocommerce_wpml = $woocommerce_wpml;
19 $this->sitepress = $sitepress;
20 }
21
22 public function wp_do_action( $hook ) {
23 do_action( $hook );
24 }
25
26 public function get_model() {
27
28 $model = [
29 'form' => [
30 'action' => $_SERVER['REQUEST_URI'],
31
32 'synchronization' => [
33 'heading' => __( 'Products Synchronization', 'woocommerce-multilingual' ),
34 'tip' => __( 'Configure specific product properties that should be synced to translations.', 'woocommerce-multilingual' ),
35 'sync_date' => [
36 'value' => $this->woocommerce_wpml->settings['products_sync_date'],
37 'label' => __( 'Sync publishing date for translated products.', 'woocommerce-multilingual' ),
38 ],
39 'sync_order' => [
40 'value' => $this->woocommerce_wpml->settings['products_sync_order'],
41 'label' => __( 'Sync products and product taxonomies order.', 'woocommerce-multilingual' ),
42 ],
43 ],
44
45 'media_synchronization' => [
46 'heading' => __( 'Products Media Synchronization', 'woocommerce-multilingual' ),
47 'tip' => __( 'Configure thumbnail and gallery synchronization to translations.', 'woocommerce-multilingual' ),
48 'sync_media' => [
49 'value' => $this->woocommerce_wpml->get_setting( 'sync_media', true ),
50 'label' => __( 'Display original images on the translated product front page if images not specified', 'woocommerce-multilingual' ),
51 ],
52 ],
53
54 'file_sync' => [
55 'heading' => __( 'Products Download Files', 'woocommerce-multilingual' ),
56 'tip' => __(
57 'If you are using downloadable products, you can choose to have their paths
58 synchronized, or seperate for each language.',
59 'woocommerce-multilingual'
60 ),
61 'value' => $this->woocommerce_wpml->settings[ \WCML_Downloadable_Products::SYNC_MODE_SETTING_KEY ],
62 'label_same' => __( 'Use the same files for translations', 'woocommerce-multilingual' ),
63 'label_diff' => __( 'Add separate download files for translations when translating products', 'woocommerce-multilingual' ),
64 ],
65
66 'product_reviews' => [
67 'heading' => __( 'Product reviews', 'woocommerce-multilingual' ),
68 'tip' => __( 'Define how to display product reviews on the product page by default. The customer will be still able to filter reviews by language.', 'woocommerce-multilingual' ),
69 'reviews_in_all_languages' => [
70 'value' => $this->woocommerce_wpml->get_setting( 'reviews_in_all_languages', false ),
71 'label' => __( 'By default, show reviews in all languages', 'woocommerce-multilingual' ),
72 ],
73 ],
74
75 'cart_sync' => [
76 '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' ),
77 'heading' => __( 'Cart', 'woocommerce-multilingual' ),
78 'lang_switch' => [
79 'heading' => __( 'Switching languages when there are items in the cart', 'woocommerce-multilingual' ),
80 'sync_label' => __( 'Synchronize cart content when switching languages', 'woocommerce-multilingual' ),
81 'clear_label' => __( 'Prompt for a confirmation and reset the cart', 'woocommerce-multilingual' ),
82 'value' => $this->woocommerce_wpml->settings['cart_sync']['lang_switch'],
83 ],
84 'currency_switch' => [
85 'heading' => __( 'Switching currencies when there are items in the cart', 'woocommerce-multilingual' ),
86 'sync_label' => __( 'Synchronize cart content when switching currencies', 'woocommerce-multilingual' ),
87 'clear_label' => __( 'Prompt for a confirmation and reset the cart', 'woocommerce-multilingual' ),
88 'value' => $this->woocommerce_wpml->settings['cart_sync']['currency_switch'],
89 ],
90 'wpml_cookie_enabled' => $this->sitepress->get_setting( WPML_Cookie_Setting::COOKIE_SETTING_FIELD ),
91 'cookie_not_enabled_message' => sprintf(
92 /* translators: %1$s and %2$s are opening and closing HTML link tags */
93 __(
94 'This feature was disabled. Please enable %1$sWPML cookies%2$s to continue.',
95 'woocommerce-multilingual'
96 ),
97 '<a href="' . admin_url( 'admin.php?page=' . WPML_PLUGIN_FOLDER . '/menu/languages.php#cookie' ) . '" target="_blank">',
98 '</a>'
99 ),
100 'doc_link' => sprintf(
101 /* translators: %1$s and %2$s are opening and closing HTML link tags */
102 __(
103 'Not sure which option to choose? Read about %1$spotential issues when switching languages and currencies while the cart has items%2$s.',
104 'woocommerce-multilingual'
105 ),
106 '<a href="' . WCML_Tracking_Link::getWcmlClearCartDoc() . '" target="_blank">',
107 '</a>'
108 ),
109 ],
110
111 'nonce' => wp_nonce_field( 'wcml_save_settings_nonce', 'wcml_nonce', true, false ),
112 'save_label' => __( 'Save changes', 'woocommerce-multilingual' ),
113
114 ],
115
116 'native_translation' => WCML_TRANSLATION_METHOD_MANUAL,
117 'wpml_translation' => WCML_TRANSLATION_METHOD_EDITOR,
118
119 'wcml_cart_sync' => WCML_CART_SYNC,
120 'wcml_cart_clear' => WCML_CART_CLEAR,
121
122 'troubleshooting' => [
123 'url' => \WCML\Utilities\AdminUrl::getTroubleshootingTab(),
124 'label' => __( 'Troubleshooting', 'woocommerce-multilingual' ),
125 ],
126 ];
127
128 if ( $this->woocommerce_wpml->is_wpml_prior_4_2() ) {
129 $model['form']['translation_interface'] = [
130 'heading' => __( 'Product Translation Interface', 'woocommerce-multilingual' ),
131 'tip' => __(
132 '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.',
133 'woocommerce-multilingual'
134 ),
135 'wcml' => [
136 'label' => __( 'WPML Translation Editor', 'woocommerce-multilingual' ),
137
138 ],
139 'native' => [
140 'label' => __( 'Native WooCommerce product editing screen', 'woocommerce-multilingual' ),
141
142 ],
143 'controls_value' => $this->woocommerce_wpml->settings['trnsl_interface'],
144 'pb_warning' => __( "If you are using a page builder to design WooCommerce products, you should only use WPML's Translation Editor.", 'woocommerce-multilingual' ),
145 'pb_warning_ok_button' => __( 'OK (translate with the WordPress editor)', 'woocommerce-multilingual' ),
146 'pb_warning_cancel_button' => __( 'Cancel (stay with the Translation Editor)', 'woocommerce-multilingual' ),
147 ];
148 }
149
150 return $model;
151
152 }
153
154 protected function init_template_base_dir() {
155 $this->template_paths = [
156 WCML_PLUGIN_PATH . '/templates/',
157 ];
158 }
159
160 public function get_template() {
161 return 'settings-ui.twig';
162 }
163
164
165 }
166