| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; // Exit if accessed directly |
| 5 |
} |
| 6 |
|
| 7 |
$merchant_modules = Merchant_Admin_Modules::get_modules(); |
| 8 |
?> |
| 9 |
<div class="merchant-modules-header"> |
| 10 |
|
| 11 |
<div class="merchant-modules-header-left"> |
| 12 |
|
| 13 |
<div class="merchant-module-page-back"> |
| 14 |
<a href="<?php echo esc_url( add_query_arg( array( 'page' => 'merchant' ), 'admin.php' ) ); ?>"> |
| 15 |
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 16 |
<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"/> |
| 17 |
</svg> |
| 18 |
<span><?php esc_html_e( 'Go Back', 'merchant' ); ?></span> |
| 19 |
</a> |
| 20 |
</div> |
| 21 |
|
| 22 |
<div class="merchant-modules-header-heading"><?php esc_html_e( 'Explore All Merchant Modules', 'merchant' ); ?></div> |
| 23 |
|
| 24 |
<div class="merchant-modules-header-subheading"><?php esc_html_e( 'Select any module to configure its settings and enable it for your store.', 'merchant' ); ?></div> |
| 25 |
|
| 26 |
<div class="merchant-modules-header-status"> |
| 27 |
<div class="merchant-modules-header-status-box"> |
| 28 |
<?php esc_html_e( 'Total Modules', 'merchant' ); ?> |
| 29 |
<strong> |
| 30 |
<?php |
| 31 |
$merchant_count = 0; |
| 32 |
$merchant_active_modules = 0; |
| 33 |
$merchant_option_modules = get_option( 'merchant-modules', array() ); |
| 34 |
|
| 35 |
if ( ! empty( $merchant_modules ) ) { |
| 36 |
foreach ( $merchant_modules as $merchant_data ) { |
| 37 |
if ( ! empty( $merchant_data['modules'] ) ) { |
| 38 |
foreach ( $merchant_data['modules'] as $merchant_module_id => $merchant_module ) { |
| 39 |
if ( ! empty( $merchant_option_modules[ $merchant_module_id ] ) ) { |
| 40 |
++$merchant_active_modules; |
| 41 |
} |
| 42 |
|
| 43 |
++$merchant_count; |
| 44 |
} |
| 45 |
} |
| 46 |
} |
| 47 |
} |
| 48 |
|
| 49 |
echo esc_attr( $merchant_count ); |
| 50 |
?> |
| 51 |
</strong> |
| 52 |
</div> |
| 53 |
<div class="merchant-modules-header-status-box"> |
| 54 |
<span><?php esc_html_e( 'Active Modules', 'merchant' ); ?><i class="merchant-modules-indicator"></i></span> |
| 55 |
<strong><?php echo esc_html( $merchant_active_modules ); ?></strong> |
| 56 |
</div> |
| 57 |
</div> |
| 58 |
</div> |
| 59 |
|
| 60 |
<div class="merchant-modules-header-right"> |
| 61 |
<div class="merchant-modules-header-image"> |
| 62 |
<img src="<?php echo esc_url( MERCHANT_URI ); ?>assets/images/modules-hero.svg" alt="<?php echo esc_attr__( 'Merchant', 'merchant' ); ?>"/> |
| 63 |
</div> |
| 64 |
</div> |
| 65 |
</div> |
| 66 |
|
| 67 |
<div class="merchant-modules-panel"> |
| 68 |
<?php require_once MERCHANT_DIR . 'admin/components/all-modules.php'; ?> |
| 69 |
</div> |
| 70 |
|