PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 1.10.1
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v1.10.1
2.3.2 2.3.1 2.3.0 2.2.8 2.2.7 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.11.0 1.11.1 1.11.2 1.6 1.7 1.8 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 1.9.10 1.9.11 All 60 releases
merchant / admin / pages / page-module.php

page-module.php in Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant 1.10.1, at admin/pages/page-module.php

287 lines 16.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit; // Exit if accessed directly
5 }
6
7 $merchant_module = ( ! empty( $_GET['module'] ) ) ? sanitize_text_field( wp_unslash( $_GET['module'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
8 $merchant_module_info = Merchant_Admin_Modules::get_module_info( $merchant_module );
9
10 Merchant_Admin_Preview::set_preview( $merchant_module );
11
12 ?>
13
14 <?php if ( ! empty( $merchant_module_info ) ) : ?>
15
16 <div class="merchant-module-page">
17
18 <div class="merchant-module-page-content">
19
20 <form method="post" action="" class="merchant-module-page-ajax-form" autocomplete="off">
21
22 <input type="hidden" name="merchant_nonce" value="<?php echo esc_attr( wp_create_nonce( 'merchant_nonce' ) ); ?>"/>
23
24 <div class="merchant-module-page-ajax-header">
25 <div class="merchant-module-page-ajax-notice"><?php esc_html_e( 'Your settings have been modified. Save?', 'merchant' ); ?></div>
26 <div class="merchant-module-page-ajax-buttons">
27 <a href="<?php echo esc_url( add_query_arg( array( 'page' => 'merchant', 'module' => $merchant_module ), 'admin.php' ) ); ?>"
28 class="merchant-module-discard-button"><?php esc_html_e( 'Discard', 'merchant' ); ?></a>
29 <button type="submit" name="merchant_save" value="save" class="merchant-module-save-button"><span class="merchant-module-save-button-label"><?php esc_html_e( 'Save',
30 'merchant' ); ?></span><i class="dashicons dashicons-update-alt"></i></button>
31 </div>
32 </div>
33
34 <div class="merchant-module-page-header">
35
36 <div class="merchant-module-page-header-content">
37
38 <div class="merchant-module-page-back">
39 <a href="<?php echo esc_url( add_query_arg( array( 'page' => 'merchant' ), 'admin.php' ) ); ?>">
40 <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
41 <rect width="16" height="16" rx="2" fill="white"/>
42 <path d="M13.3329 7.20013H4.46628L7.19961 4.20013L6.46628 3.4668L2.59961 7.6668L6.46628 11.5335L7.19961 10.8001L4.53294 8.20013H13.3329V7.20013Z" fill="#1D2327"/>
43 </svg>
44 <span><?php echo esc_html__( 'Go Back', 'merchant' ); ?></span>
45 </a>
46 </div>
47
48 <div class="merchant-module-page-heading">
49 <div class="merchant-module-page-info">
50 <div class="merchant-module-page-title">
51 <?php echo esc_html( $merchant_module_info['title'] ); ?>
52 </div>
53 <div class="merchant-module-page-desc"><?php echo esc_html( $merchant_module_info['desc'] ); ?></div>
54 </div>
55 </div>
56
57 <div class="merchant-module-page-actions">
58
59 <div class="merchant-module-page-actions-inner">
60
61 <?php
62 $merchant_module_enabled = ( Merchant_Modules::is_module_active( $merchant_module ) ) ? ' merchant-enabled' : '';
63 $merchant_module_is_upsell = ! defined( 'MERCHANT_PRO_VERSION' ) && isset( $merchant_module_info['pro'] ) && true === $merchant_module_info['pro'];
64 ?>
65
66 <div class="merchant-module-action<?php echo esc_attr( $merchant_module_enabled ); ?>">
67
68
69 <?php if ( $merchant_module_is_upsell ) : ?>
70 <div class="merchant-module-buy">
71
72 <a href="https://athemes.com/merchant-upgrade?utm_source=plugin_dashboard&utm_medium=merchant_dashboard&utm_campaign=Merchant" target="_blank"
73 class="merchant-module-page-button ">
74 <?php esc_html_e( 'Buy Pro', 'merchant' ); ?>
75 </a>
76
77 </div>
78 <?php else :
79 /**
80 * Hook 'merchant_admin_module_{module_id}_activate_button_class'
81 * Filters the class name for the activate button.
82 *
83 * @param string $button_activate_class The class name for the activate button.
84 * @since 1.0
85 */
86 $button_activate_class = apply_filters( "merchant_admin_module_{$merchant_module}_activate_button_class", 'merchant-module-page-button merchant-module-activate merchant-module-page-button-action-activate' );
87 ?>
88
89 <div data-module="<?php echo esc_attr( $merchant_module ); ?>"
90 class="<?php echo esc_attr( $button_activate_class ); ?>">
91 <?php esc_html_e( 'Enable', 'merchant' ); ?>
92 </div>
93 <div class="merchant-module-deactivate">
94
95 <div class="merchant-module-page-button merchant-module-page-button-deactivate">
96 <?php esc_html_e( 'Enabled', 'merchant' ); ?>
97 <svg width="8" height="5" viewBox="0 0 8 5" fill="none" xmlns="http://www.w3.org/2000/svg">
98 <path d="M7.09832 3.98009e-07L0.901685 -1.43717e-07C0.15069 -2.09371e-07 -0.269991 0.75351 0.193991 1.2676L3.29231 4.70055C3.65265 5.09982 4.34735 5.09982 4.70769 4.70055L7.80601 1.2676C8.26999 0.753511 7.84931 4.63664e-07 7.09832 3.98009e-07Z"
99 fill="#3858E9"/>
100 </svg>
101 </div>
102
103 <div class="merchant-module-deactivate-dropdown">
104 <div data-module="<?php echo esc_attr( $merchant_module ); ?>" class="merchant-module-page-button-action-deactivate">
105 <?php echo esc_html__( 'Disable', 'merchant' ) . ' ' . esc_html( $merchant_module_info['title'] ); ?>
106 </div>
107 </div>
108
109 </div>
110 <?php endif ?>
111
112
113 <div class="merchant-module-dropdown merchant-module-question-list-dropdown">
114 <div class="merchant-module-question-title">
115 <?php esc_html_e( 'Did something go wrong?', 'merchant' ); ?><i class="dashicons dashicons-no-alt merchant-module-dropdown-close"></i>
116 </div>
117 <ul>
118 <li data-answer-target="bug">
119 <span><?php esc_html_e( 'Submit a bug: the module doesn’t work as expected', 'merchant' ); ?></span>
120 </li>
121 <li data-answer-target="missing">
122 <span><?php esc_html_e( 'Some options are missing', 'merchant' ); ?></span>
123 </li>
124 <li data-answer-target="conflict">
125 <span><?php esc_html_e( 'It conflicts with another feature', 'merchant' ); ?></span>
126 </li>
127 <li data-answer-target="thank-you">
128 <span><?php esc_html_e( 'I don’t need it anymore.', 'merchant' ); ?></span>
129 </li>
130 <li data-answer-target="other">
131 <span><?php esc_html_e( 'Other', 'merchant' ); ?></span>
132 </li>
133 </ul>
134 </div>
135
136 <div class="merchant-module-dropdown merchant-module-question-answer-dropdown">
137
138 <div class="merchant-module-question-answer">
139
140 <div class="merchant-module-question-answer-title" data-answer-title="bug">
141 <?php esc_html_e( 'Please tell us why, and we’ll look into it.', 'merchant' ); ?><i
142 class="dashicons dashicons-no-alt merchant-module-dropdown-close"></i>
143 </div>
144
145 <div class="merchant-module-question-answer-title" data-answer-title="missing">
146 <?php esc_html_e( 'What feature are you looking for?', 'merchant' ); ?><i class="dashicons dashicons-no-alt merchant-module-dropdown-close"></i>
147 </div>
148
149 <div class="merchant-module-question-answer-title" data-answer-title="conflict">
150 <?php esc_html_e( 'Please tell us what plugin/theme it conflicts with.', 'merchant' ); ?><i
151 class="dashicons dashicons-no-alt merchant-module-dropdown-close"></i>
152 </div>
153
154 <div class="merchant-module-question-answer-title" data-answer-title="other">
155 <?php esc_html_e( 'Would you mind telling us why?', 'merchant' ); ?><i class="dashicons dashicons-no-alt merchant-module-dropdown-close"></i>
156 </div>
157
158 </div>
159
160 <div class="merchant-module-question-answer-form">
161 <textarea class="merchant-module-question-answer-textarea" data-subject=""></textarea>
162 <button class="merchant-module-page-button merchant-module-question-answer-button" disabled><?php esc_html_e( 'Submit', 'merchant' ); ?></button>
163 </div>
164
165 </div>
166
167 <div class="merchant-module-dropdown merchant-module-question-thank-you-dropdown">
168
169 <div class="merchant-module-question-answer-title">
170 <?php esc_html_e( 'Thank you', 'merchant' ); ?><i class="dashicons dashicons-no-alt merchant-module-dropdown-close"></i>
171 </div>
172
173 <div class="merchant-module-question-answer-thank-you-text">
174 <?php esc_html_e( 'Your feedback helps us improve Merchant.', 'merchant' ); ?>
175 </div>
176
177 </div>
178
179 </div>
180
181 <div class="merchant-module-page-actions-links">
182
183 <?php if ( ! empty( $merchant_module_info['tutorial_url'] ) ) : ?>
184 <a href="<?php echo esc_url( $merchant_module_info['tutorial_url'] ); ?>" class="merchant-module-page-link merchant-module-page-link-tutorial" target="_blank">
185 <span><?php echo esc_html__( 'Tutorial', 'merchant' ); ?></span>
186 <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
187 <path d="M11.4375 0H8.25C7.94531 0 7.66406 0.1875 7.54688 0.492188C7.42969 0.773438 7.5 1.10156 7.71094 1.3125L8.67188 2.27344L4.14844 6.79688C3.84375 7.07812 3.84375 7.57031 4.14844 7.85156C4.28906 7.99219 4.47656 8.0625 4.6875 8.0625C4.875 8.0625 5.0625 7.99219 5.20312 7.85156L9.72656 3.32812L10.6875 4.28906C10.8281 4.42969 11.0156 4.5 11.2266 4.5C11.3203 4.5 11.4141 4.5 11.5078 4.45312C11.8125 4.33594 12 4.05469 12 3.75V0.5625C12 0.257812 11.7422 0 11.4375 0ZM9.1875 7.5C8.85938 7.5 8.625 7.75781 8.625 8.0625V10.6875C8.625 10.8047 8.53125 10.875 8.4375 10.875H1.3125C1.19531 10.875 1.125 10.8047 1.125 10.6875V3.5625C1.125 3.46875 1.19531 3.375 1.3125 3.375H3.9375C4.24219 3.375 4.5 3.14062 4.5 2.8125C4.5 2.50781 4.24219 2.25 3.9375 2.25H1.3125C0.585938 2.25 0 2.85938 0 3.5625V10.6875C0 11.4141 0.585938 12 1.3125 12H8.4375C9.14062 12 9.75 11.4141 9.75 10.6875V8.0625C9.75 7.75781 9.49219 7.5 9.1875 7.5Z"
188 fill="#3858E9"/>
189 </svg>
190 </a>
191 <?php endif; ?>
192
193 </div>
194
195 </div>
196
197 </div>
198
199 </div>
200
201 </div>
202
203 <?php
204 /**
205 * Hook 'merchant_admin_after_module_page_page_header'
206 *
207 * @since 1.0
208 */
209 do_action( 'merchant_admin_after_module_page_page_header' );
210
211 ?>
212
213 <div class="merchant-module-page-body <?php echo Merchant_Admin_Preview::has_preview() ? 'has-preview' : ''; ?>">
214
215 <div class="merchant-module-page-content">
216
217 <?php
218
219 /**
220 * Hook: merchant_module_file_path
221 *
222 * @since 1.0
223 */
224 $merchant_module_file = apply_filters( 'merchant_module_file_path',
225 MERCHANT_DIR . 'admin/modules/' . $merchant_module . '/admin-page-' . $merchant_module . '.php',
226 $merchant_module );
227
228 if ( file_exists( $merchant_module_file ) ) {
229 require $merchant_module_file;
230 }
231
232 ?>
233
234 </div>
235
236 <?php if ( Merchant_Admin_Preview::has_preview() ) : ?>
237
238 <div class="merchant-module-page-preview">
239 <div class="merchant-module-page-preview-box">
240 <div class="merchant-module-page-preview-title">
241 <?php esc_html_e( 'Preview', 'merchant' ); ?>
242 </div>
243 <div class="merchant-module-page-preview-browser">
244 <div class="merchant-module-page-preview-browser-top">
245 <span class="merchant-module-page-preview-browser-top-circle"></span>
246 <span class="merchant-module-page-preview-browser-top-circle"></span>
247 <span class="merchant-module-page-preview-browser-top-circle"></span>
248 </div>
249 <div class="merchant-module-page-preview-browser-inner">
250 <?php echo wp_kses( Merchant_Admin_Preview::get_html(), merchant_kses_allowed_tags( array( 'all' ) ) ); ?>
251 </div>
252 </div>
253 </div>
254 </div>
255
256 <?php endif; ?>
257
258 </div>
259
260 </form>
261
262 </div>
263
264 </div>
265
266 <div class="merchant-module-alert">
267 <div class="merchant-module-alert-overlay"></div>
268 <div class="merchant-module-alert-wrapper">
269 <div class="merchant-module-alert-header"><strong><?php esc_html_e( 'Important info!', 'merchant' ); ?></strong><a href="#" class="merchant-module-alert-close"><i
270 class="dashicons dashicons-no-alt"></i></a></div>
271 <div class="merchant-module-alert-content">
272 <figure><img src="<?php echo esc_url( MERCHANT_URI . 'assets/images/enable-module.png' ); ?>"/></figure>
273 <p><?php esc_html_e( 'This module is currently disabled. Please enable the module to see it in your store.', 'merchant' ); ?></p>
274 </div>
275 </div>
276 </div>
277
278 <div class="merchant-module-footer-text">
279 <?php esc_html_e( 'Copyright © aThemes 2024. All Rights Reserved.', 'merchant' ); ?>
280 </div>
281
282 <?php else : ?>
283
284 <?php wp_safe_redirect( add_query_arg( array( 'page' => 'merchant' ), admin_url( 'admin.php' ) ) ); ?>
285
286 <?php endif; ?>
287