| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template for free gifts module widget |
| 4 |
* |
| 5 |
* @var $args array template args |
| 6 |
* |
| 7 |
* @since 1.0 |
| 8 |
*/ |
| 9 |
|
| 10 |
if ( ! defined( 'ABSPATH' ) ) { |
| 11 |
exit; // Exit if accessed directly |
| 12 |
} |
| 13 |
|
| 14 |
$settings = isset( $args['settings'] ) ? $args['settings'] : array(); |
| 15 |
|
| 16 |
$fg_classes = 'merchant-free-gifts-widget'; |
| 17 |
$fg_classes .= ' merchant-free-gifts-widget--' . ( $settings['position'] ?? 'top_right' ); |
| 18 |
$fg_classes .= ! empty( $settings['mobile_width'] ) ? ' merchant-free-gifts-widget-has-mobile-width' : ''; |
| 19 |
?> |
| 20 |
<div id="merchant-free-gifts-widget" class="<?php echo esc_attr( $fg_classes ); ?>"> |
| 21 |
<div class="merchant-free-gifts-widget-inner"> |
| 22 |
<div class="merchant-free-gifts-widget-button"> |
| 23 |
<span class="merchant-free-gifts-widget-count"><?php echo absint( $args['count'] ?? 0 ); ?></span> |
| 24 |
<div class="merchant-free-gifts-widget-icon"> |
| 25 |
<?php echo wp_kses( Merchant_SVG_Icons::get_svg_icon( $settings['icon'] ?? 'gifts-icon-1' ), merchant_kses_allowed_tags( array(), false ) ); ?> |
| 26 |
</div> |
| 27 |
</div> |
| 28 |
<div class="merchant-free-gifts-widget-offers"> |
| 29 |
<?php merchant_get_template_part( Merchant_Free_Gifts::MODULE_TEMPLATES_PATH, 'widget-contents', $args ); ?> |
| 30 |
</div> |
| 31 |
</div> |
| 32 |
</div> |
| 33 |
|