2015-10-06 11:33:45 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Checkout terms and conditions checkbox
|
|
|
|
*
|
2018-02-16 07:27:34 +00:00
|
|
|
* @author WooThemes
|
|
|
|
* @package WooCommerce/Templates
|
|
|
|
* @version 3.4.0
|
2015-10-06 11:33:45 +00:00
|
|
|
*/
|
2018-02-16 07:27:34 +00:00
|
|
|
|
2015-10-06 11:33:45 +00:00
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2018-02-16 07:27:34 +00:00
|
|
|
$terms_page = wc_get_page_id( 'terms' ) > 0 ? get_post( wc_get_page_id( 'terms' ) ) : false;
|
2017-01-17 15:18:23 +00:00
|
|
|
|
2018-02-21 22:18:07 +00:00
|
|
|
if ( $terms_page && 'publish' === $terms_page->post_status && apply_filters( 'woocommerce_checkout_show_terms', true ) ) :
|
2018-02-16 07:27:34 +00:00
|
|
|
$terms_content = has_shortcode( $terms_page->post_content, 'woocommerce_checkout' ) ? '' : wc_format_content( $terms_page->post_content );
|
2017-07-04 13:03:08 +00:00
|
|
|
|
|
|
|
if ( $terms_content ) {
|
2017-01-17 15:18:23 +00:00
|
|
|
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>';
|
2017-07-04 13:03:08 +00:00
|
|
|
}
|
2017-01-17 15:18:23 +00:00
|
|
|
?>
|
2018-02-28 15:42:39 +00:00
|
|
|
<p class="form-row terms wc-terms-and-conditions validate-required">
|
2017-01-13 17:26:09 +00:00
|
|
|
<label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox">
|
2018-04-04 14:45:40 +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’ve read and accept the <a href="%s" target="_blank" class="woocommerce-terms-and-conditions-link">terms & 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>
|
2016-02-02 21:53:14 +00:00
|
|
|
<?php do_action( 'woocommerce_checkout_after_terms_and_conditions' ); ?>
|
2015-10-06 11:33:45 +00:00
|
|
|
<?php endif; ?>
|