woocommerce/templates/checkout/terms.php

32 lines
1.5 KiB
PHP
Raw Normal View History

<?php
/**
* Checkout terms and conditions checkbox
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 3.1.1
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$terms_page_id = wc_get_page_id( 'terms' );
2017-04-27 11:34:20 +00:00
if ( $terms_page_id > 0 && apply_filters( 'woocommerce_checkout_show_terms', true ) ) :
$terms = get_post( $terms_page_id );
$terms_content = has_shortcode( $terms->post_content, 'woocommerce_checkout' ) ? '' : wc_format_content( $terms->post_content );
if ( $terms_content ) {
do_action( 'woocommerce_checkout_before_terms_and_conditions' );
echo '<div class="woocommerce-terms-and-conditions" style="display: none; max-height: 200px; overflow: auto;">' . $terms_content . '</div>';
}
?>
2016-07-11 14:56:35 +00:00
<p class="form-row terms wc-terms-and-conditions">
<label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox">
2017-09-15 23:48:25 +00:00
<input type="checkbox" class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" name="terms" <?php checked( apply_filters( 'woocommerce_terms_is_checked_default', isset( $_POST['terms'] ) ), true ); ?> id="terms" /> <span><?php printf( __( 'I&rsquo;ve read and accept the <a href="%s" target="_blank" class="woocommerce-terms-and-conditions-link">terms &amp; conditions</a>', 'woocommerce' ), esc_url( wc_get_page_permalink( 'terms' ) ) ); ?></span> <span class="required">*</span>
2016-11-10 00:41:14 +00:00
</label>
2016-07-11 14:56:35 +00:00
<input type="hidden" name="terms-field" value="1" />
</p>
<?php do_action( 'woocommerce_checkout_after_terms_and_conditions' ); ?>
<?php endif; ?>