| 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 |
<div data-module="<?php echo esc_attr( $merchant_module ); ?>" |
| 80 |
class="merchant-module-page-button merchant-module-activate merchant-module-page-button-action-activate"> |
| 81 |
<?php esc_html_e( 'Enable', 'merchant' ); ?> |
| 82 |
</div> |
| 83 |
<div class="merchant-module-deactivate"> |
| 84 |
|
| 85 |
<div class="merchant-module-page-button merchant-module-page-button-deactivate"> |
| 86 |
<?php esc_html_e( 'Enabled', 'merchant' ); ?> |
| 87 |
<svg width="8" height="5" viewBox="0 0 8 5" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 88 |
<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" |
| 89 |
fill="#3858E9"/> |
| 90 |
</svg> |
| 91 |
</div> |
| 92 |
|
| 93 |
<div class="merchant-module-deactivate-dropdown"> |
| 94 |
<div data-module="<?php echo esc_attr( $merchant_module ); ?>" class="merchant-module-page-button-action-deactivate"> |
| 95 |
<?php echo esc_html__( 'Disable', 'merchant' ) . ' ' . esc_html( $merchant_module_info['title'] ); ?> |
| 96 |
</div> |
| 97 |
</div> |
| 98 |
|
| 99 |
</div> |
| 100 |
<?php endif ?> |
| 101 |
|
| 102 |
|
| 103 |
<div class="merchant-module-dropdown merchant-module-question-list-dropdown"> |
| 104 |
<div class="merchant-module-question-title"> |
| 105 |
<?php esc_html_e( 'Did something go wrong?', 'merchant' ); ?><i class="dashicons dashicons-no-alt merchant-module-dropdown-close"></i> |
| 106 |
</div> |
| 107 |
<ul> |
| 108 |
<li data-answer-target="bug"> |
| 109 |
<span><?php esc_html_e( 'Submit a bug: the module doesn’t work as expected', 'merchant' ); ?></span> |
| 110 |
</li> |
| 111 |
<li data-answer-target="missing"> |
| 112 |
<span><?php esc_html_e( 'Some options are missing', 'merchant' ); ?></span> |
| 113 |
</li> |
| 114 |
<li data-answer-target="conflict"> |
| 115 |
<span><?php esc_html_e( 'It conflicts with another feature', 'merchant' ); ?></span> |
| 116 |
</li> |
| 117 |
<li data-answer-target="thank-you"> |
| 118 |
<span><?php esc_html_e( 'I don’t need it anymore.', 'merchant' ); ?></span> |
| 119 |
</li> |
| 120 |
<li data-answer-target="other"> |
| 121 |
<span><?php esc_html_e( 'Other', 'merchant' ); ?></span> |
| 122 |
</li> |
| 123 |
</ul> |
| 124 |
</div> |
| 125 |
|
| 126 |
<div class="merchant-module-dropdown merchant-module-question-answer-dropdown"> |
| 127 |
|
| 128 |
<div class="merchant-module-question-answer"> |
| 129 |
|
| 130 |
<div class="merchant-module-question-answer-title" data-answer-title="bug"> |
| 131 |
<?php esc_html_e( 'Please tell us why, and we’ll look into it.', 'merchant' ); ?><i |
| 132 |
class="dashicons dashicons-no-alt merchant-module-dropdown-close"></i> |
| 133 |
</div> |
| 134 |
|
| 135 |
<div class="merchant-module-question-answer-title" data-answer-title="missing"> |
| 136 |
<?php esc_html_e( 'What feature are you looking for?', 'merchant' ); ?><i class="dashicons dashicons-no-alt merchant-module-dropdown-close"></i> |
| 137 |
</div> |
| 138 |
|
| 139 |
<div class="merchant-module-question-answer-title" data-answer-title="conflict"> |
| 140 |
<?php esc_html_e( 'Please tell us what plugin/theme it conflicts with.', 'merchant' ); ?><i |
| 141 |
class="dashicons dashicons-no-alt merchant-module-dropdown-close"></i> |
| 142 |
</div> |
| 143 |
|
| 144 |
<div class="merchant-module-question-answer-title" data-answer-title="other"> |
| 145 |
<?php esc_html_e( 'Would you mind telling us why?', 'merchant' ); ?><i class="dashicons dashicons-no-alt merchant-module-dropdown-close"></i> |
| 146 |
</div> |
| 147 |
|
| 148 |
</div> |
| 149 |
|
| 150 |
<div class="merchant-module-question-answer-form"> |
| 151 |
<textarea class="merchant-module-question-answer-textarea" data-subject=""></textarea> |
| 152 |
<button class="merchant-module-page-button merchant-module-question-answer-button"><?php esc_html_e( 'Submit', 'merchant' ); ?></button> |
| 153 |
</div> |
| 154 |
|
| 155 |
</div> |
| 156 |
|
| 157 |
<div class="merchant-module-dropdown merchant-module-question-thank-you-dropdown"> |
| 158 |
|
| 159 |
<div class="merchant-module-question-answer-title"> |
| 160 |
<?php esc_html_e( 'Thank you', 'merchant' ); ?><i class="dashicons dashicons-no-alt merchant-module-dropdown-close"></i> |
| 161 |
</div> |
| 162 |
|
| 163 |
<div class="merchant-module-question-answer-thank-you-text"> |
| 164 |
<?php esc_html_e( 'Your feedback helps us improve Merchant.', 'merchant' ); ?> |
| 165 |
</div> |
| 166 |
|
| 167 |
</div> |
| 168 |
|
| 169 |
</div> |
| 170 |
|
| 171 |
<div class="merchant-module-page-actions-links"> |
| 172 |
|
| 173 |
<?php if ( ! empty( $merchant_module_info['tutorial_url'] ) ) : ?> |
| 174 |
<a href="<?php echo esc_url( $merchant_module_info['tutorial_url'] ); ?>" class="merchant-module-page-link merchant-module-page-link-tutorial" target="_blank"> |
| 175 |
<span><?php echo esc_html__( 'Tutorial', 'merchant' ); ?></span> |
| 176 |
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 177 |
<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" |
| 178 |
fill="#3858E9"/> |
| 179 |
</svg> |
| 180 |
</a> |
| 181 |
<?php endif; ?> |
| 182 |
|
| 183 |
</div> |
| 184 |
|
| 185 |
</div> |
| 186 |
|
| 187 |
</div> |
| 188 |
|
| 189 |
</div> |
| 190 |
|
| 191 |
</div> |
| 192 |
|
| 193 |
<?php |
| 194 |
/** |
| 195 |
* Hook 'merchant_admin_after_module_page_page_header' |
| 196 |
* |
| 197 |
* @since 1.0 |
| 198 |
*/ |
| 199 |
do_action( 'merchant_admin_after_module_page_page_header' ); |
| 200 |
|
| 201 |
?> |
| 202 |
|
| 203 |
<div class="merchant-module-page-body <?php echo Merchant_Admin_Preview::has_preview() ? 'has-preview' : ''; ?>"> |
| 204 |
|
| 205 |
<div class="merchant-module-page-content"> |
| 206 |
|
| 207 |
<?php |
| 208 |
|
| 209 |
/** |
| 210 |
* Hook: merchant_module_file_path |
| 211 |
* |
| 212 |
* @since 1.0 |
| 213 |
*/ |
| 214 |
$merchant_module_file = apply_filters( 'merchant_module_file_path', |
| 215 |
MERCHANT_DIR . 'admin/modules/' . $merchant_module . '/admin-page-' . $merchant_module . '.php', |
| 216 |
$merchant_module ); |
| 217 |
|
| 218 |
if ( file_exists( $merchant_module_file ) ) { |
| 219 |
require $merchant_module_file; |
| 220 |
} |
| 221 |
|
| 222 |
?> |
| 223 |
|
| 224 |
</div> |
| 225 |
|
| 226 |
<?php if ( Merchant_Admin_Preview::has_preview() ) : ?> |
| 227 |
|
| 228 |
<div class="merchant-module-page-preview"> |
| 229 |
<div class="merchant-module-page-preview-box"> |
| 230 |
<div class="merchant-module-page-preview-title"> |
| 231 |
<?php esc_html_e( 'Preview', 'merchant' ); ?> |
| 232 |
</div> |
| 233 |
<div class="merchant-module-page-preview-browser"> |
| 234 |
<div class="merchant-module-page-preview-browser-top"> |
| 235 |
<span class="merchant-module-page-preview-browser-top-circle"></span> |
| 236 |
<span class="merchant-module-page-preview-browser-top-circle"></span> |
| 237 |
<span class="merchant-module-page-preview-browser-top-circle"></span> |
| 238 |
</div> |
| 239 |
<div class="merchant-module-page-preview-browser-inner"> |
| 240 |
<?php echo wp_kses( Merchant_Admin_Preview::get_html(), merchant_kses_allowed_tags( array( 'all' ) ) ); ?> |
| 241 |
</div> |
| 242 |
</div> |
| 243 |
</div> |
| 244 |
</div> |
| 245 |
|
| 246 |
<?php endif; ?> |
| 247 |
|
| 248 |
</div> |
| 249 |
|
| 250 |
</form> |
| 251 |
|
| 252 |
</div> |
| 253 |
|
| 254 |
</div> |
| 255 |
|
| 256 |
<div class="merchant-module-alert"> |
| 257 |
<div class="merchant-module-alert-overlay"></div> |
| 258 |
<div class="merchant-module-alert-wrapper"> |
| 259 |
<div class="merchant-module-alert-header"><strong><?php esc_html_e( 'Important info!', 'merchant' ); ?></strong><a href="#" class="merchant-module-alert-close"><i |
| 260 |
class="dashicons dashicons-no-alt"></i></a></div> |
| 261 |
<div class="merchant-module-alert-content"> |
| 262 |
<figure><img src="<?php echo esc_url( MERCHANT_URI . 'assets/images/enable-module.png' ); ?>"/></figure> |
| 263 |
<p><?php esc_html_e( 'This module is currently disabled. Please enable the module to see it in your store.', 'merchant' ); ?></p> |
| 264 |
</div> |
| 265 |
</div> |
| 266 |
</div> |
| 267 |
|
| 268 |
<div class="merchant-module-footer-text"> |
| 269 |
<?php esc_html_e( 'Copyright © aThemes 2023. All Rights Reserved.', 'merchant' ); ?> |
| 270 |
</div> |
| 271 |
|
| 272 |
<?php else : ?> |
| 273 |
|
| 274 |
<?php wp_safe_redirect( add_query_arg( array( 'page' => 'merchant' ), admin_url( 'admin.php' ) ) ); ?> |
| 275 |
|
| 276 |
<?php endif; ?> |
| 277 |
|