| 1 |
<?php |
| 2 |
/** |
| 3 |
* The Template for displaying additional terms and conditions checkbox on the checkout page. |
| 4 |
* |
| 5 |
* @since 1.0.0 |
| 6 |
* |
| 7 |
* @package woo-additional-terms |
| 8 |
*/ |
| 9 |
|
| 10 |
defined( 'ABSPATH' ) || exit; |
| 11 |
defined( 'WC_VERSION' ) || exit; |
| 12 |
|
| 13 |
// List of allowed anchor attributes. |
| 14 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound |
| 15 |
$allowed_anchor_attributes = array( |
| 16 |
'a' => array( |
| 17 |
'href' => array(), |
| 18 |
'target' => array(), |
| 19 |
'class' => array(), |
| 20 |
'data-action' => array(), |
| 21 |
'data-fancybox' => array(), |
| 22 |
'data-animation-effect' => array(), |
| 23 |
'data-width' => array(), |
| 24 |
'data-height' => array(), |
| 25 |
'data-src' => array(), |
| 26 |
), |
| 27 |
); |
| 28 |
?> |
| 29 |
|
| 30 |
<div class="woocommerce-terms-and-conditions-wrapper woo-additional-terms"> |
| 31 |
<?php if ( ! empty( $args['page_content'] ) ) : ?> |
| 32 |
<div |
| 33 |
id="woo-additional-terms-content" |
| 34 |
class="woo-additional-terms__content woo-additional-terms__content--<?php echo esc_attr( $args['display_action'] ); ?>" |
| 35 |
><?php echo wp_kses_post( $args['page_content'] ); ?></div> |
| 36 |
<?php endif; ?> |
| 37 |
<p class="form-row <?php echo esc_attr( wc_string_to_bool( $args['is_required'] ) ? 'validate-required' : 'novalidate' ); ?>"> |
| 38 |
<label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox"> |
| 39 |
<input |
| 40 |
type="checkbox" |
| 41 |
class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" |
| 42 |
name="_woo_additional_terms" |
| 43 |
id="_woo_additional_terms" |
| 44 |
value="1" |
| 45 |
/> |
| 46 |
<span class="woocommerce-terms-and-conditions-checkbox-text"> |
| 47 |
<?php echo wp_kses( $args['checkbox_label'], $allowed_anchor_attributes ); ?> |
| 48 |
</span> |
| 49 |
<?php |
| 50 |
if ( wc_string_to_bool( $args['is_required'] ) ) : |
| 51 |
?> |
| 52 |
<abbr |
| 53 |
class="required" |
| 54 |
title="<?php esc_attr_e( 'Required', 'woo-additional-terms' ); ?>" |
| 55 |
>*</abbr> |
| 56 |
<?php endif; ?> |
| 57 |
</label> |
| 58 |
</p> |
| 59 |
</div> |
| 60 |
|
| 61 |
<?php |
| 62 |
/* Omit closing PHP tag at the end of PHP files to avoid "headers already sent" issues. */ |
| 63 |
|