| 1 |
<?php |
| 2 |
|
| 3 |
/** @var array $payment_method_list_active */ |
| 4 |
/** @var array $payment_method_list_no_active */ |
| 5 |
|
| 6 |
$payment_method_list = array_merge( $payment_method_list_active, $payment_method_list_no_active ); |
| 7 |
|
| 8 |
?> |
| 9 |
|
| 10 |
<div class="imoje-payment-method-container"> |
| 11 |
|
| 12 |
<div class="imoje-pbl-error woocommerce-error" role="alert"> |
| 13 |
<?php esc_html_e( 'Choose payment channel if is available. In other way choose another payment method', 'imoje' ) ?> |
| 14 |
</div> |
| 15 |
|
| 16 |
<ul class="imoje-channels"> |
| 17 |
<?php |
| 18 |
|
| 19 |
$wc_currency = get_woocommerce_currency(); |
| 20 |
|
| 21 |
foreach ( $payment_method_list as $payment_method ) { ?> |
| 22 |
|
| 23 |
<li class="imoje-channel imoje-channel-<?php echo esc_attr( $payment_method['payment_method_code'] ) ?> imoje-c-<?php echo $payment_method['is_available'] |
| 24 |
? 'active' |
| 25 |
: 'no-active' ?>" |
| 26 |
title="<?php |
| 27 |
|
| 28 |
$payment_method_title = esc_attr( $payment_method['description'] ); |
| 29 |
|
| 30 |
if ( ! $payment_method['is_available'] ) { |
| 31 |
|
| 32 |
$payment_method_title = __( 'Payment channel is not available.', 'imoje' ) . ' '; |
| 33 |
|
| 34 |
if ( |
| 35 |
$payment_method['limit'] |
| 36 |
&& ( |
| 37 |
$payment_method['min_transaction'] |
| 38 |
|| $payment_method['max_transaction'] ) |
| 39 |
) { |
| 40 |
|
| 41 |
$need_extra = $payment_method['limit'] === 1; |
| 42 |
|
| 43 |
$payment_method_title = sprintf( __( 'The payment method is available for transactions %s %.2f %s', 'imoje' ), |
| 44 |
( $need_extra |
| 45 |
? __( 'above', 'imoje' ) |
| 46 |
: __( 'below', 'imoje' ) ), |
| 47 |
( $need_extra |
| 48 |
? esc_attr( $payment_method['min_transaction'] ) |
| 49 |
: esc_attr( $payment_method['max_transaction'] ) |
| 50 |
), |
| 51 |
$wc_currency |
| 52 |
); |
| 53 |
} |
| 54 |
} |
| 55 |
|
| 56 |
echo esc_attr( $payment_method_title ); |
| 57 |
?>"> |
| 58 |
<label class="imoje-c-<?php echo $payment_method['is_available'] |
| 59 |
? 'active' |
| 60 |
: 'no-active' ?>"> |
| 61 |
<input type="radio" |
| 62 |
value="<?php echo esc_attr( $payment_method['payment_method'] . '-' . $payment_method['payment_method_code'] ) ?>" |
| 63 |
name="imoje-selected-channel"/> |
| 64 |
<div> |
| 65 |
<img src="<?php echo esc_url( $payment_method['logo'] ); ?>" alt="logo"> |
| 66 |
</div> |
| 67 |
</label> |
| 68 |
</li> |
| 69 |
<?php } ?> |
| 70 |
</ul> |
| 71 |
</div> |